Loading ...
Sorry, an error occurred while loading the content.

Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

Expand Messages
  • gkh
    Hello again; I have moved their CGIDEV2 stuff into it s own library & call all the REXX programs per Giovanni s instructions. I have also added the
    Message 1 of 16 , Jun 18, 2013
    • 0 Attachment
      Hello again;
      I have moved their CGIDEV2 stuff into it's own library & call all the REXX programs per Giovanni's instructions.  I have also added the %%EBCDIC/EBCDIC%% to their APACHE so that this is received correctly.

      When I run the program in debug mode, it looks like the program STILL isn't reading the HTML page correctly.  It looks like SOME elements, specfically ones which exists ONCE in the HTML are being correctly read; but duplicated fields are NOT read, for example:
      <INPUT TYPE=TEXT NAME="HDSPOO" value="AAA">

      <INPUT TYPE=HIDDEN NAME="SFKEY" VALUE="123">
      <INPUT TYPE=TEXT NAME="SFDATA" VALUE="XXX">

      <INPUT TYPE=HIDDEN NAME="SFKEY" VALUE="456">
      <INPUT TYPE=TEXT NAME="SFDATA" VALUE="YYY">

      eval HDSPOO = zhbGetVar('HDSPOO") ; // returns "AAA"
      EVAL      ItemCount = ZhbGetVarCnt('SFKEY') ; // returns 0
      dow @idx = 1 to ItemCount ;    // if I force a 1 into ItemCount to get into this loop
             EVAL sfINDEX  = ZhbGetVar('SFKEY':@idx) ; // returns blank
             eval   sfDATA = ZhbGetVar('SFDATA':@idx) ; // returns blank
       enddo;

      This program WORKS on their production box, but NOT on their new development box.  The only thing which jumps out at me is that their system is using QCCSID=65535, but the production box is identically set up & the STRTCPSVR command is identical on both boxes.

      I know this program lacks some of the best practice methodologies, but I'm not really allowed to change anything.  Now that CGIDEV2 is in it's own library, I CAN upgrade it- the only question is, would the newest version of CGIDEV2 work with HTML which is NOT written using HTML best practices?

      I thank everyone in advance, I know this system was not set up correctly, and I'm trying to fix this, w/o being a QSECOFR.

      On Thu, Jun 13, 2013 at 10:58 AM, Giovanni B. Perotti <gb_perotti@...> wrote:
       

      GHK,

       

      after picking up CGIDEV2 material and having moved it into their own libraries, they have taken responsibilities off from us and can no longer expect any significant support.

       

      Just a courtesy suggestion.

      You may enter debug, jump (F22) into the ZhbGetInput source and check what they receive from the instruction getenv('CGI_MODE':qusec) .

      The value to be received is %%EBCDIC/EBCDIC%% , any other value would not work.

      If they receive some other value, have them (re)visiting page cgidev2.easy400.net/cgidev2o/exhibit1.htm#3 (and send them to hell).

       

      Giovanni

       

      Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
      Inviato: giovedì 13 giugno 2013 16:21


      A: Easy400Group@yahoogroups.com
      Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

       

       

      Actually, it's the other way around, it looks like they copied the contents of CGIDEV2 into their own library.   I don't see any CGIDEV2 on their system at all.
      I also can't find a QREXSRC with an "INSTALL" which looks like the one from CGIDEV2 (on EITHER box)

      Let's shorten my litany of complaints to: "headdesk, headdesk, headdesk"

      So, with the tangled, tangled, box of wiggly worms I've been handed... what do you suggest?  Heck, I'm not even sure how OLD this version of CGIDEV2 is.  It looks to me that the issue is:

      [Wed Jun 12 12:59:48 2013] [error] [client 172.20.0.230] QzhbCgiParse: Unable to read CONTENT_LENGTH bytes from stdin., referer:

      What causes this?  Should I recompile something?

      On Wed, Jun 12, 2013 at 4:15 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

       

      GHK,

       

      -          Their own programs in library CGIDEV2? Outstanding approach, isn’it.

      -          They can run the STRREXPRC command, it doesn’t hurt their stuff (better save the library before, just in case they make another  a mistake)

      -          Several CGISRVPGM2 service programs? Just another excellent approach, right?

       

      Some people get killed from the cars they are driving, that’s why one should need a  license.

       

      Giovanni

       

       

      Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
      Inviato: mercoledì 12 giugno 2013 21:14


      A: Easy400Group@yahoogroups.com
      Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

       

       

      To answer all the questions:
      To Giovanni:
      1. It looks like they just put all the objects for CGIDEV2 into the same library as all their other programs... no wonder they didn't want to upgrade!  I have no idea where the sources are.
      Can I run that install command anyway, or does it depend on all the objects existing in the library CGIDEV2?

      To Kevin Turner:
      1. There are *3* copies of CGISRVPGM2 on the test box, and unknown number on the production box!  But only -one- of the three is in the library list for the web job.
      2. It looks like the custom web programs are compiled with activation group "CGI". How do I check the activation group for CGISRVPGM2 ?  Should I just change the programs to "*CALLER" ?

      On Wed, Jun 12, 2013 at 1:20 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

       

      Did they just save library CGIDEV2 and restore it to their new (development) box?

      If so, did they run the install command STRREXPRC SRCMBR(INSTALL) SRCFILE(CGIDEV2/QREXSRC) ?

      If not, they may be missing something.

       

      Giovanni B. Perotti

       

      Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
      Inviato: mercoledì 12 giugno 2013 19:10
      A: Easy400Group@yahoogroups.com
      Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

       

       

      I'm personally a fan of "upgrade4 it, and see if the problem goes away", but alas, THEIR internal IT guys does *that* stuff.  I can't even FTP a logo onto the as400.

      What's really strange to me is the fact that all of this code is LITERALLY lifted from their production box to this new (developement) box; of course, I am taking their internal IT people's word that their settings, PTF level, etc are all the same.  I was just brought in to look at this one problem.  I have the impression that I had this happen before in OUR programs, but can't for the life of me remember what we did in 2009 to resolve this problem (before we upgraded, after which we never saw it again).
      this is the error I see in the error logs:

      [Wed Jun 12 12:59:48 2013] [error] [client 172.20.0.230] QzhbCgiParse: Unable to read CONTENT_LENGTH bytes from stdin., referer:

      On Wed, Jun 12, 2013 at 12:16 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

       

      1-      Honestly I do not understand what is the problem with installing a CGIDEV2 fresh version on their  V6R1 box. Once that is done:

      2-      http://.../ /cgidev2o/demos.htm . There are 9 demos in that page. Run all of them.

      3-      If they run OK, HTTP is OK and CGIDEV2 is OK. Then the user program case is due to wrong coding.

      4-      If they do not run OK, then the HTTP server product (5761DG1) is missing some PTFs and that could be also the cause of problem with the user program.

       

      Giovanni B. Perotti

      Easy400.net site owner

       

      Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
      Inviato: mercoledì 12 giugn
      o 2013 17:27
      A: Easy400Group@yahoogroups.com
      Oggetto: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

       

       

      Our client has just set up a test box which is 95% identacle to their prouction box.  I *know* that they have an older version of CGIDEV2, and their system is now V6R1.  Alas, the 5% difference required that I recompile their programs, and for whatever reason, it looks like ZhbGetVarCnt('SFRFS') is returning a 0 (there's 6 on the page!)

      NO code has been changed, just recompiled :(    

      The only thing which stands out to me is the fact that THEIR programs must be compiled using CRTRPGMOD then CRTPGM instead of just CRTBNDPGM.  I have this impression from years ago that I've seen this happen before, and the fix had SOMETHING to do with the way the programs compiled...

       

       

       


    • gkh
      thanks to everyone! While I m not 100% sure what made this work... but this box started reading all the data it should be reading. ... thanks to everyone!
      Message 2 of 16 , Jun 18, 2013
      • 0 Attachment
        thanks to everyone!

        While I'm not 100% sure what made this work... but this box started reading all the data it should be reading.

        On Tue, Jun 18, 2013 at 11:26 AM, gkh <orelalaith@...> wrote:
        Hello again;
        I have moved their CGIDEV2 stuff into it's own library & call all the REXX programs per Giovanni's instructions.  I have also added the %%EBCDIC/EBCDIC%% to their APACHE so that this is received correctly.

        When I run the program in debug mode, it looks like the program STILL isn't reading the HTML page correctly.  It looks like SOME elements, specfically ones which exists ONCE in the HTML are being correctly read; but duplicated fields are NOT read, for example:
        <INPUT TYPE=TEXT NAME="HDSPOO" value="AAA">

        <INPUT TYPE=HIDDEN NAME="SFKEY" VALUE="123">
        <INPUT TYPE=TEXT NAME="SFDATA" VALUE="XXX">

        <INPUT TYPE=HIDDEN NAME="SFKEY" VALUE="456">
        <INPUT TYPE=TEXT NAME="SFDATA" VALUE="YYY">

        eval HDSPOO = zhbGetVar('HDSPOO") ; // returns "AAA"
        EVAL      ItemCount = ZhbGetVarCnt('SFKEY') ; // returns 0
        dow @idx = 1 to ItemCount ;    // if I force a 1 into ItemCount to get into this loop
               EVAL sfINDEX  = ZhbGetVar('SFKEY':@idx) ; // returns blank
               eval   sfDATA = ZhbGetVar('SFDATA':@idx) ; // returns blank
         enddo;

        This program WORKS on their production box, but NOT on their new development box.  The only thing which jumps out at me is that their system is using QCCSID=65535, but the production box is identically set up & the STRTCPSVR command is identical on both boxes.

        I know this program lacks some of the best practice methodologies, but I'm not really allowed to change anything.  Now that CGIDEV2 is in it's own library, I CAN upgrade it- the only question is, would the newest version of CGIDEV2 work with HTML which is NOT written using HTML best practices?

        I thank everyone in advance, I know this system was not set up correctly, and I'm trying to fix this, w/o being a QSECOFR.


        On Thu, Jun 13, 2013 at 10:58 AM, Giovanni B. Perotti <gb_perotti@...> wrote:
         

        GHK,

         

        after picking up CGIDEV2 material and having moved it into their own libraries, they have taken responsibilities off from us and can no longer expect any significant support.

         

        Just a courtesy suggestion.

        You may enter debug, jump (F22) into the ZhbGetInput source and check what they receive from the instruction getenv('CGI_MODE':qusec) .

        The value to be received is %%EBCDIC/EBCDIC%% , any other value would not work.

        If they receive some other value, have them (re)visiting page cgidev2.easy400.net/cgidev2o/exhibit1.htm#3 (and send them to hell).

         

        Giovanni

         

        Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
        Inviato: giovedì 13 giugno 2013 16:21


        A: Easy400Group@yahoogroups.com
        Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

         

         

        Actually, it's the other way around, it looks like they copied the contents of CGIDEV2 into their own library.   I don't see any CGIDEV2 on their system at all.
        I also can't find a QREXSRC with an "INSTALL" which looks like the one from CGIDEV2 (on EITHER box)

        Let's shorten my litany of complaints to: "headdesk, headdesk, headdesk"

        So, with the tangled, tangled, box of wiggly worms I've been handed... what do you suggest?  Heck, I'm not even sure how OLD this version of CGIDEV2 is.  It looks to me that the issue is:

        [Wed Jun 12 12:59:48 2013] [error] [client 172.20.0.230] QzhbCgiParse: Unable to read CONTENT_LENGTH bytes from stdin., referer:

        What causes this?  Should I recompile something?

        On Wed, Jun 12, 2013 at 4:15 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

         

        GHK,

         

        -          Their own programs in library CGIDEV2? Outstanding approach, isn’it.

        -          They can run the STRREXPRC command, it doesn’t hurt their stuff (better save the library before, just in case they make another  a mistake)

        -          Several CGISRVPGM2 service programs? Just another excellent approach, right?

         

        Some people get killed from the cars they are driving, that’s why one should need a  license.

         

        Giovanni

         

         

        Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
        Inviato: mercoledì 12 giugno 2013 21:14


        A: Easy400Group@yahoogroups.com
        Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

         

         

        To answer all the questions:
        To Giovanni:
        1. It looks like they just put all the objects for CGIDEV2 into the same library as all their other programs... no wonder they didn't want to upgrade!  I have no idea where the sources are.
        Can I run that install command anyway, or does it depend on all the objects existing in the library CGIDEV2?

        To Kevin Turner:
        1. There are *3* copies of CGISRVPGM2 on the test box, and unknown number on the production box!  But only -one- of the three is in the library list for the web job.
        2. It looks like the custom web programs are compiled with activation group "CGI". How do I check the activation group for CGISRVPGM2 ?  Should I just change the programs to "*CALLER" ?

        On Wed, Jun 12, 2013 at 1:20 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

         

        Did they just save library CGIDEV2 and restore it to their new (development) box?

        If so, did they run the install command STRREXPRC SRCMBR(INSTALL) SRCFILE(CGIDEV2/QREXSRC) ?

        If not, they may be missing something.

         

        Giovanni B. Perotti

         

        Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
        Inviato: mercoledì 12 giugno 2013 19:10
        A: Easy400Group@yahoogroups.com
        Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

         

         

        I'm personally a fan of "upgrade4 it, and see if the problem goes away", but alas, THEIR internal IT guys does *that* stuff.  I can't even FTP a logo onto the as400.

        What's really strange to me is the fact that all of this code is LITERALLY lifted from their production box to this new (developement) box; of course, I am taking their internal IT people's word that their settings, PTF level, etc are all the same.  I was just brought in to look at this one problem.  I have the impression that I had this happen before in OUR programs, but can't for the life of me remember what we did in 2009 to resolve this problem (before we upgraded, after which we never saw it again).
        this is the error I see in the error logs:

        [Wed Jun 12 12:59:48 2013] [error] [client 172.20.0.230] QzhbCgiParse: Unable to read CONTENT_LENGTH bytes from stdin., referer:

        On Wed, Jun 12, 2013 at 12:16 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

         

        1-      Honestly I do not understand what is the problem with installing a CGIDEV2 fresh version on their  V6R1 box. Once that is done:

        2-      http://.../ /cgidev2o/demos.htm . There are 9 demos in that page. Run all of them.

        3-      If they run OK, HTTP is OK and CGIDEV2 is OK. Then the user program case is due to wrong coding.

        4-      If they do not run OK, then the HTTP server product (5761DG1) is missing some PTFs and that could be also the cause of problem with the user program.

         

        Giovanni B. Perotti

        Easy400.net site owner

         

        Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
        Inviato: mercoledì 12 giugn
        o 2013 17:27
        A: Easy400Group@yahoogroups.com
        Oggetto: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

         

         

        Our client has just set up a test box which is 95% identacle to their prouction box.  I *know* that they have an older version of CGIDEV2, and their system is now V6R1.  Alas, the 5% difference required that I recompile their programs, and for whatever reason, it looks like ZhbGetVarCnt('SFRFS') is returning a 0 (there's 6 on the page!)

        NO code has been changed, just recompiled :(    

        The only thing which stands out to me is the fact that THEIR programs must be compiled using CRTRPGMOD then CRTPGM instead of just CRTBNDPGM.  I have this impression from years ago that I've seen this happen before, and the fix had SOMETHING to do with the way the programs compiled...

         

         

         



      • Giovanni B. Perotti
        I have reproduced your case on my V6R1 box, and of course it works as a charm. I’m enclosing the IFS stream file for external HTML (/easy400/ghk/ghk.txt on
        Message 3 of 16 , Jun 18, 2013
        • 0 Attachment

          I have reproduced your case on my V6R1 box, and of course it works as a charm.

          I’m enclosing the IFS stream file for external HTML (/easy400/ghk/ghk.txt on my system) the RPG source and the resulting screens.

          Install the whole and run it. If it does not work, your system has problems, better look for PTFs.

          Giovanni

           

          ===== 1 === EXTERNAL STREAM FILE /easy400/ghk/ghk.txt======================

          <as400>top

          Content-type: text/html

          Expires: 0

           

          <html>

          <head>

          <title>GHK case</title>

          </head>

          <body>

          <table>

          <as400>step1

          <form name=form1 method=post action="/easy400p/ghk.pgm">

          <input type=hidden name=xrequest value="go">

          <tr><td>HDSPOO:</td><td><input type=text   name=hdspoo value="AAA"></td></tr>

          <input type=hidden name=sfkey  value="123">

          <tr><td>SFDATA:</td><td><input type=text   name=sfdata value="XXX"></td></tr>

          <input type=hidden name=sfkey  value="456">

          <tr><td>SFDATA:</td><td><input type=text   name=sfdata value="YYY"></td></tr>

          <tr><td colspan=2 align=center><input type=submit value="GO"></td></tr>

          <as400>step2

          <tr><td>/%result%/</td></tr>

          <as400>end

          </table>

          </body>

          </html>

          ===== 2 === CGI program source code======================

          /copy CGIDEV2/qrpglesrc,hspecs                                  

           /copy CGIDEV2/qrpglesrc,hspecsbnd                               

           /copy CGIDEV2/qrpglesrc,prototypeb                               

           /copy CGIDEV2/qrpglesrc,usec                                    

           /copy CGIDEV2/qrpglesrc,variables3                              

          D testVar         pr                                             

          D  var                          20    const options(*varsize)    

          D extHtml         s           2000    inz('/easy400/GHK/GHK.txt')

           * Indicators for GetHtmlIfsMult subprocedure                    

          D IfsMultIndicators...                                           

          d                 ds                                              

          D  NoErrors                       n                              

          D  NameTooLong                    n                              

          D  NotAccessible                  n                              

          D  NoFilesUsable                  n                              

          D  DupSections                    n                              

          D  FileIsEmpty                    n                              

          D xrequest        s             10                                

           /free                                                           

                                                                       

                IfsMultIndicators=getHtmlIfsMult(%trim(exthtml):'<as400

                wrtsection('top');                                     

                                                                       

                nbrVars=zhbgetinput(savedquerystring:qusec);          

                xrequest=zhbgetvarupper('xrequest');                  

                select;                                               

                when xrequest=' ';                                    

                     wrtsection('step1');                             

                other;                                                

                     exsr Step2;                                      

                endsl;                                                

                                                                       

                wrtsection('end *fini');                                  

                return;                                               

                                                                       

                Begsr Step2;                                          

                testvar('HDSPOO');                                    

                testvar('SFKEY');

                testvar('SFDATA');                                      

                Endsr;                                                 

                                                                        

           /end-free                                                   

          P testVar         b                                           

          D testVar         pi                                         

          D  var                          20    const options(*varsize)

          D value           s             50                           

          D i               s             10i 0                        

          D count           s             10i 0                        

           /free                                                       

                count=ZhbGetVarCnt(%trim(var));                        

                for i=1 to count;                                      

                    value=zhbgetvar(%trim(var):i);                     

                    updhtmlvar('result':%trim(var)+'='+%trim(value));  

                    wrtsection('step2');                               

                endfor;                                                

           /end-free                                                   

          P testVar         e

          ===== 3 === WEB screen 1 (startup)======================                              

          <html>

          <head>

          <title>GHK case</title>

          </head>

          <body>

          <table>

          <form name=form1 method=post action="/easy400p/ghk.pgm">

          <input type=hidden name=xrequest value="go">

          <tr><td>HDSPOO:</td><td><input type=text   name=hdspoo value="AAA"></td></tr>

          <input type=hidden name=sfkey  value="123">

          <tr><td>SFDATA:</td><td><input type=text   name=sfdata value="XXX"></td></tr>

          <input type=hidden name=sfkey  value="456">

          <tr><td>SFDATA:</td><td><input type=text   name=sfdata value="YYY"></td></tr>

          <tr><td colspan=2 align=center><input type=submit value="GO"></td></tr>

          </table>

          </body>

          </html>

          ===== 4 === WEB screen 2 (result)======================                              

           <html>

          <head>

          <title>GHK case</title>

          </head>

          <body>

          <table>

          <tr><td>HDSPOO=AAA</td></tr>

          <tr><td>SFKEY=123</td></tr>

          <tr><td>SFKEY=456</td></tr>

          <tr><td>SFDATA=XXX</td></tr>

          <tr><td>SFDATA=YYY</td></tr>

          </table>

          </body>

          </html>

                                                                                      

           

          Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
          Inviato: martedì 18 giugno 2013 17:26
          A: Easy400Group@yahoogroups.com
          Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

           

           

          Hello again;
          I have moved their CGIDEV2 stuff into it's own library & call all the REXX programs per Giovanni's instructions.  I have also added the %%EBCDIC/EBCDIC%% to their APACHE so that this is received correctly.

          When I run the program in debug mode, it looks like the program STILL isn't reading the HTML page correctly.  It looks like SOME elements, specfically ones which exists ONCE in the HTML are being correctly read; but duplicated fields are NOT read, for example:
          <INPUT TYPE=TEXT NAME="HDSPOO" value="AAA">

          <INPUT TYPE=HIDDEN NAME="SFKEY" VALUE="123">
          <INPUT TYPE=TEXT NAME="SFDATA" VALUE="XXX">

          <INPUT TYPE=HIDDEN NAME="SFKEY" VALUE="456">
          <INPUT TYPE=TEXT NAME="SFDATA" VALUE="YYY">

          eval HDSPOO = zhbGetVar('HDSPOO") ; // returns "AAA"
          EVAL      ItemCount = ZhbGetVarCnt('SFKEY') ; // returns 0
          dow @idx = 1 to ItemCount ;    // if I force a 1 into ItemCount to get into this loop
                 EVAL sfINDEX  = ZhbGetVar('SFKEY':@idx) ; // returns blank
                 eval   sfDATA = ZhbGetVar('SFDATA':@idx) ; // returns blank
           enddo;

          This program WORKS on their production box, but NOT on their new development box.  The only thing which jumps out at me is that their system is using QCCSID=65535, but the production box is identically set up & the STRTCPSVR command is identical on both boxes.

          I know this program lacks some of the best practice methodologies, but I'm not really allowed to change anything.  Now that CGIDEV2 is in it's own library, I CAN upgrade it- the only question is, would the newest version of CGIDEV2 work with HTML which is NOT written using HTML best practices?

          I thank everyone in advance, I know this system was not set up correctly, and I'm trying to fix this, w/o being a QSECOFR.

          On Thu, Jun 13, 2013 at 10:58 AM, Giovanni B. Perotti <gb_perotti@...> wrote:

           

          GHK,

           

          after picking up CGIDEV2 material and having moved it into their own libraries, they have taken responsibilities off from us and can no longer expect any significant support.

           

          Just a courtesy suggestion.

          You may enter debug, jump (F22) into the ZhbGetInput source and check what they receive from the instruction getenv('CGI_MODE':qusec) .

          The value to be received is %%EBCDIC/EBCDIC%% , any other value would not work.

          If they receive some other value, have them (re)visiting page cgidev2.easy400.net/cgidev2o/exhibit1.htm#3 (and send them to hell).

           

          Giovanni

           

          Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
          Inviato: giovedì 13 giugno 2013 16:21


          A: Easy400Group@yahoogroups.com
          Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

           

           

          Actually, it's the other way around, it looks like they copied the contents of CGIDEV2 into their own library.   I don't see any CGIDEV2 on their system at all.
          I also can't find a QREXSRC with an "INSTALL" which looks like the one from CGIDEV2 (on EITHER box)

          Let's shorten my litany of complaints to: "headdesk, headdesk, headdesk"

          So, with the tangled, tangled, box of wiggly worms I've been handed... what do you suggest?  Heck, I'm not even sure how OLD this version of CGIDEV2 is.  It looks to me that the issue is:

          [Wed Jun 12 12:59:48 2013] [error] [client 172.20.0.230] QzhbCgiParse: Unable to read CONTENT_LENGTH bytes from stdin., referer:

          What causes this?  Should I recompile something?

          On Wed, Jun 12, 2013 at 4:15 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

           

          GHK,

           

          -          Their own programs in library CGIDEV2? Outstanding approach, isn’it.

          -          They can run the STRREXPRC command, it doesn’t hurt their stuff (better save the library before, just in case they make another  a mistake)

          -          Several CGISRVPGM2 service programs? Just another excellent approach, right?

           

          Some people get killed from the cars they are driving, that’s why one should need a  license.

           

          Giovanni

           

           

          Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
          Inviato: mercoledì 12 giugno 2013 21:14


          A: Easy400Group@yahoogroups.com
          Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

           

           

          To answer all the questions:
          To Giovanni:
          1. It looks like they just put all the objects for CGIDEV2 into the same library as all their other programs... no wonder they didn't want to upgrade!  I have no idea where the sources are.
          Can I run that install command anyway, or does it depend on all the objects existing in the library CGIDEV2?

          To Kevin Turner:
          1. There are *3* copies of CGISRVPGM2 on the test box, and unknown number on the production box!  But only -one- of the three is in the library list for the web job.
          2. It looks like the custom web programs are compiled with activation group "CGI". How do I check the activation group for CGISRVPGM2 ?  Should I just change the programs to "*CALLER" ?

          On Wed, Jun 12, 2013 at 1:20 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

           

          Did they just save library CGIDEV2 and restore it to their new (development) box?

          If so, did they run the install command STRREXPRC SRCMBR(INSTALL) SRCFILE(CGIDEV2/QREXSRC) ?

          If not, they may be missing something.

           

          Giovanni B. Perotti

           

          Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
          Inviato: mercoledì 12 giugno 2013 19:10
          A: Easy400Group@yahoogroups.com
          Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

           

           

          I'm personally a fan of "upgrade4 it, and see if the problem goes away", but alas, THEIR internal IT guys does *that* stuff.  I can't even FTP a logo onto the as400.

          What's really strange to me is the fact that all of this code is LITERALLY lifted from their production box to this new (developement) box; of course, I am taking their internal IT people's word that their settings, PTF level, etc are all the same.  I was just brought in to look at this one problem.  I have the impression that I had this happen before in OUR programs, but can't for the life of me remember what we did in 2009 to resolve this problem (before we upgraded, after which we never saw it again).
          this is the error I see in the error logs:

          [Wed Jun 12 12:59:48 2013] [error] [client 172.20.0.230] QzhbCgiParse: Unable to read CONTENT_LENGTH bytes from stdin., referer:

          On Wed, Jun 12, 2013 at 12:16 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

           

          1-      Honestly I do not understand what is the problem with installing a CGIDEV2 fresh version on their  V6R1 box. Once that is done:

          2-      http://.../ /cgidev2o/demos.htm . There are 9 demos in that page. Run all of them.

          3-      If they run OK, HTTP is OK and CGIDEV2 is OK. Then the user program case is due to wrong coding.

          4-      If they do not run OK, then the HTTP server product (5761DG1) is missing some PTFs and that could be also the cause of problem with the user program.

           

          Giovanni B. Perotti

          Easy400.net site owner

           

          Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
          Inviato: mercoledì 12 giugn
          o 2013 17:27
          A: Easy400Group@yahoogroups.com
          Oggetto: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

           

           

          Our client has just set up a test box which is 95% identacle to their prouction box.  I *know* that they have an older version of CGIDEV2, and their system is now V6R1.  Alas, the 5% difference required that I recompile their programs, and for whatever reason, it looks like ZhbGetVarCnt('SFRFS') is returning a 0 (there's 6 on the page!)

          NO code has been changed, just recompiled :(    

          The only thing which stands out to me is the fact that THEIR programs must be compiled using CRTRPGMOD then CRTPGM instead of just CRTBNDPGM.  I have this impression from years ago that I've seen this happen before, and the fix had SOMETHING to do with the way the programs compiled...

           

           

           

           

        • gkh
          Thanks Giovani! I meant to post thank you and it worked Tuesday, but managed to constantly get sidetracked. Either I sacrificed the correct goat & two
          Message 4 of 16 , Jun 21, 2013
          • 0 Attachment
            Thanks Giovani!  I meant to post  thank you" and "it worked" Tuesday, but managed to constantly get sidetracked.

            Either I sacrificed the correct goat & two chickens, or my client's internal IT people updated the PTF's on their training box to where they need to be.  Their web applications mysteriously started working on Tuesday for no reason that I can discern.  I'm going to have to do the same clean up on their production box over some weekend when they're not crazy busy (just in case).  I'm going to upgrade them to the most modern version of CGIDEV2 ASAP then.

            Might I add, I REALLY appreciate your help & patience with this problem; esp given the whole "CGIDEV2 has been fubarred b/c all the objects have been copied all over Hades & therefor isn't supported"


            On Tue, Jun 18, 2013 at 4:15 PM, Giovanni B. Perotti <gb_perotti@...> wrote:
             

            I have reproduced your case on my V6R1 box, and of course it works as a charm.

            I’m enclosing the IFS stream file for external HTML (/easy400/ghk/ghk.txt on my system) the RPG source and the resulting screens.

            Install the whole and run it. If it does not work, your system has problems, better look for PTFs.

            Giovanni

             

            ===== 1 === EXTERNAL STREAM FILE /easy400/ghk/ghk.txt======================

            <as400>top

            Content-type: text/html

            Expires: 0

             

            <html>

            <head>

            <title>GHK case</title>

            </head>

            <body>

            <table>

            <as400>step1

            <form name=form1 method=post action="/easy400p/ghk.pgm">

            <input type=hidden name=xrequest value="go">

            <tr><td>HDSPOO:</td><td><input type=text   name=hdspoo value="AAA"></td></tr>

            <input type=hidden name=sfkey  value="123">

            <tr><td>SFDATA:</td><td><input type=text   name=sfdata value="XXX"></td></tr>

            <input type=hidden name=sfkey  value="456">

            <tr><td>SFDATA:</td><td><input type=text   name=sfdata value="YYY"></td></tr>

            <tr><td colspan=2 align=center><input type=submit value="GO"></td></tr>

            <as400>step2

            <tr><td>/%result%/</td></tr>

            <as400>end

            </table>

            </body>

            </html>

            ===== 2 === CGI program source code======================

            /copy CGIDEV2/qrpglesrc,hspecs                                  

             /copy CGIDEV2/qrpglesrc,hspecsbnd                               

             /copy CGIDEV2/qrpglesrc,prototypeb                               

             /copy CGIDEV2/qrpglesrc,usec                                    

             /copy CGIDEV2/qrpglesrc,variables3                              

            D testVar         pr                                             

            D  var                          20    const options(*varsize)    

            D extHtml         s           2000    inz('/easy400/GHK/GHK.txt')

             * Indicators for GetHtmlIfsMult subprocedure                    

            D IfsMultIndicators...                                           

            d                 ds                                              

            D  NoErrors                       n                              

            D  NameTooLong                    n                              

            D  NotAccessible                  n                              

            D  NoFilesUsable                  n                              

            D  DupSections                    n                              

            D  FileIsEmpty                    n                              

            D xrequest        s             10                                

             /free                                                           

                                                                         

                  IfsMultIndicators=getHtmlIfsMult(%trim(exthtml):'<as400

                  wrtsection('top');                                     

                                                                         

                  nbrVars=zhbgetinput(savedquerystring:qusec);          

                  xrequest=zhbgetvarupper('xrequest');                  

                  select;                                               

                  when xrequest=' ';                                    

                       wrtsection('step1');                             

                  other;                                                

                       exsr Step2;                                      

                  endsl;                                                

                                                                         

                  wrtsection('end *fini');                                  

                  return;                                               

                                                                         

                  Begsr Step2;                                          

                  testvar('HDSPOO');                                    

                  testvar('SFKEY');

                  testvar('SFDATA');                                      

                  Endsr;                                                 

                                                                          

             /end-free                                                   

            P testVar         b                                           

            D testVar         pi                                         

            D  var                          20    const options(*varsize)

            D value           s             50                           

            D i               s             10i 0                        

            D count           s             10i 0                        

             /free                                                       

                  count=ZhbGetVarCnt(%trim(var));                        

                  for i=1 to count;                                      

                      value=zhbgetvar(%trim(var):i);                     

                      updhtmlvar('result':%trim(var)+'='+%trim(value));  

                      wrtsection('step2');                               

                  endfor;                                                

             /end-free                                                   

            P testVar         e

            ===== 3 === WEB screen 1 (startup)======================                              

            <html>

            <head>

            <title>GHK case</title>

            </head>

            <body>

            <table>

            <form name=form1 method=post action="/easy400p/ghk.pgm">

            <input type=hidden name=xrequest value="go">

            <tr><td>HDSPOO:</td><td><input type=text   name=hdspoo value="AAA"></td></tr>

            <input type=hidden name=sfkey  value="123">

            <tr><td>SFDATA:</td><td><input type=text   name=sfdata value="XXX"></td></tr>

            <input type=hidden name=sfkey  value="456">

            <tr><td>SFDATA:</td><td><input type=text   name=sfdata value="YYY"></td></tr>

            <tr><td colspan=2 align=center><input type=submit value="GO"></td></tr>

            </table>

            </body>

            </html>

            ===== 4 === WEB screen 2 (result)======================                              

             <html>

            <head>

            <title>GHK case</title>

            </head>

            <body>

            <table>

            <tr><td>HDSPOO=AAA</td></tr>

            <tr><td>SFKEY=123</td></tr>

            <tr><td>SFKEY=456</td></tr>

            <tr><td>SFDATA=XXX</td></tr>

            <tr><td>SFDATA=YYY</td></tr>

            </table>

            </body>

            </html>

                                                                                        

             

            Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
            Inviato: martedì 18 giugno 2013 17:26
            A: Easy400Group@yahoogroups.com
            Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

             

             

            Hello again;
            I have moved their CGIDEV2 stuff into it's own library & call all the REXX programs per Giovanni's instructions.  I have also added the %%EBCDIC/EBCDIC%% to their APACHE so that this is received correctly.

            When I run the program in debug mode, it looks like the program STILL isn't reading the HTML page correctly.  It looks like SOME elements, specfically ones which exists ONCE in the HTML are being correctly read; but duplicated fields are NOT read, for example:
            <INPUT TYPE=TEXT NAME="HDSPOO" value="AAA">

            <INPUT TYPE=HIDDEN NAME="SFKEY" VALUE="123">
            <INPUT TYPE=TEXT NAME="SFDATA" VALUE="XXX">

            <INPUT TYPE=HIDDEN NAME="SFKEY" VALUE="456">
            <INPUT TYPE=TEXT NAME="SFDATA" VALUE="YYY">

            eval HDSPOO = zhbGetVar('HDSPOO") ; // returns "AAA"
            EVAL      ItemCount = ZhbGetVarCnt('SFKEY') ; // returns 0
            dow @idx = 1 to ItemCount ;    // if I force a 1 into ItemCount to get into this loop
                   EVAL sfINDEX  = ZhbGetVar('SFKEY':@idx) ; // returns blank
                   eval   sfDATA = ZhbGetVar('SFDATA':@idx) ; // returns blank
             enddo;

            This program WORKS on their production box, but NOT on their new development box.  The only thing which jumps out at me is that their system is using QCCSID=65535, but the production box is identically set up & the STRTCPSVR command is identical on both boxes.

            I know this program lacks some of the best practice methodologies, but I'm not really allowed to change anything.  Now that CGIDEV2 is in it's own library, I CAN upgrade it- the only question is, would the newest version of CGIDEV2 work with HTML which is NOT written using HTML best practices?

            I thank everyone in advance, I know this system was not set up correctly, and I'm trying to fix this, w/o being a QSECOFR.

            On Thu, Jun 13, 2013 at 10:58 AM, Giovanni B. Perotti <gb_perotti@...> wrote:

             

            GHK,

             

            after picking up CGIDEV2 material and having moved it into their own libraries, they have taken responsibilities off from us and can no longer expect any significant support.

             

            Just a courtesy suggestion.

            You may enter debug, jump (F22) into the ZhbGetInput source and check what they receive from the instruction getenv('CGI_MODE':qusec) .

            The value to be received is %%EBCDIC/EBCDIC%% , any other value would not work.

            If they receive some other value, have them (re)visiting page cgidev2.easy400.net/cgidev2o/exhibit1.htm#3 (and send them to hell).

             

            Giovanni

             

            Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
            Inviato: giovedì 13 giugno 2013 16:21


            A: Easy400Group@yahoogroups.com
            Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

             

             

            Actually, it's the other way around, it looks like they copied the contents of CGIDEV2 into their own library.   I don't see any CGIDEV2 on their system at all.
            I also can't find a QREXSRC with an "INSTALL" which looks like the one from CGIDEV2 (on EITHER box)

            Let's shorten my litany of complaints to: "headdesk, headdesk, headdesk"

            So, with the tangled, tangled, box of wiggly worms I've been handed... what do you suggest?  Heck, I'm not even sure how OLD this version of CGIDEV2 is.  It looks to me that the issue is:

            [Wed Jun 12 12:59:48 2013] [error] [client 172.20.0.230] QzhbCgiParse: Unable to read CONTENT_LENGTH bytes from stdin., referer:

            What causes this?  Should I recompile something?

            On Wed, Jun 12, 2013 at 4:15 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

             

            GHK,

             

            -          Their own programs in library CGIDEV2? Outstanding approach, isn’it.

            -          They can run the STRREXPRC command, it doesn’t hurt their stuff (better save the library before, just in case they make another  a mistake)

            -          Several CGISRVPGM2 service programs? Just another excellent approach, right?

             

            Some people get killed from the cars they are driving, that’s why one should need a  license.

             

            Giovanni

             

             

            Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
            Inviato: mercoledì 12 giugno 2013 21:14


            A: Easy400Group@yahoogroups.com
            Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

             

             

            To answer all the questions:
            To Giovanni:
            1. It looks like they just put all the objects for CGIDEV2 into the same library as all their other programs... no wonder they didn't want to upgrade!  I have no idea where the sources are.
            Can I run that install command anyway, or does it depend on all the objects existing in the library CGIDEV2?

            To Kevin Turner:
            1. There are *3* copies of CGISRVPGM2 on the test box, and unknown number on the production box!  But only -one- of the three is in the library list for the web job.
            2. It looks like the custom web programs are compiled with activation group "CGI". How do I check the activation group for CGISRVPGM2 ?  Should I just change the programs to "*CALLER" ?

            On Wed, Jun 12, 2013 at 1:20 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

             

            Did they just save library CGIDEV2 and restore it to their new (development) box?

            If so, did they run the install command STRREXPRC SRCMBR(INSTALL) SRCFILE(CGIDEV2/QREXSRC) ?

            If not, they may be missing something.

             

            Giovanni B. Perotti

             

            Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
            Inviato: mercoledì 12 giugno 2013 19:10
            A: Easy400Group@yahoogroups.com
            Oggetto: Re: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

             

             

            I'm personally a fan of "upgrade4 it, and see if the problem goes away", but alas, THEIR internal IT guys does *that* stuff.  I can't even FTP a logo onto the as400.

            What's really strange to me is the fact that all of this code is LITERALLY lifted from their production box to this new (developement) box; of course, I am taking their internal IT people's word that their settings, PTF level, etc are all the same.  I was just brought in to look at this one problem.  I have the impression that I had this happen before in OUR programs, but can't for the life of me remember what we did in 2009 to resolve this problem (before we upgraded, after which we never saw it again).
            this is the error I see in the error logs:

            [Wed Jun 12 12:59:48 2013] [error] [client 172.20.0.230] QzhbCgiParse: Unable to read CONTENT_LENGTH bytes from stdin., referer:

            On Wed, Jun 12, 2013 at 12:16 PM, Giovanni B. Perotti <gb_perotti@...> wrote:

             

            1-      Honestly I do not understand what is the problem with installing a CGIDEV2 fresh version on their  V6R1 box. Once that is done:

            2-      http://.../ /cgidev2o/demos.htm . There are 9 demos in that page. Run all of them.

            3-      If they run OK, HTTP is OK and CGIDEV2 is OK. Then the user program case is due to wrong coding.

            4-      If they do not run OK, then the HTTP server product (5761DG1) is missing some PTFs and that could be also the cause of problem with the user program.

             

            Giovanni B. Perotti

            Easy400.net site owner

             

            Da: Easy400Group@yahoogroups.com [mailto:Easy400Group@yahoogroups.com] Per conto di gkh
            Inviato: mercoledì 12 giugn
            o 2013 17:27
            A: Easy400Group@yahoogroups.com
            Oggetto: [Easy400Group] Working on an older version of CGIDEV2, HELP!!

             

             

            Our client has just set up a test box which is 95% identacle to their prouction box.  I *know* that they have an older version of CGIDEV2, and their system is now V6R1.  Alas, the 5% difference required that I recompile their programs, and for whatever reason, it looks like ZhbGetVarCnt('SFRFS') is returning a 0 (there's 6 on the page!)

            NO code has been changed, just recompiled :(    

            The only thing which stands out to me is the fact that THEIR programs must be compiled using CRTRPGMOD then CRTPGM instead of just CRTBNDPGM.  I have this impression from years ago that I've seen this happen before, and the fix had SOMETHING to do with the way the programs compiled...

             

             

             

             


          Your message has been successfully submitted and would be delivered to recipients shortly.