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

R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

Expand Messages
  • Enrico Amisano
    many thanks but: if I have a form in wich users input data to have a result, do you call in Html directly the CLP program ? Or you run first a Cgi Rpg to and
    Message 1 of 26 , Aug 1, 2003
      many thanks but:
       
      if I have a form in wich users input data to have a result, do you call in Html directly the CLP program ?
      Or you run first a Cgi Rpg to and after run the CLP ?
       
      Thanks
       
      -----Messaggio originale-----
      Da: Elbert Cook [mailto:emcook@...]
      Inviato: giovedì 31 luglio 2003 16.09
      A: Easy400Group@yahoogroups.com
      Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

      I use CLP's all the time. I have created commands to
      extract the values from the HTML Query String into CL
      variables.

      >From there I pass the variables to RPG's, or use them
      in Opnqryf's, or pass them to other CLP's.

      I'm not sure why all the Web focus in on RPG alone.
      But 99% of my web app's launches CLP's as the initial
      program.

      Example.

      PGM                                        
      DCL VAR(&USER) TYPE(*CHAR) LEN(10)         
      DCL VAR(&RESULT) TYPE(*CHAR) LEN(1024)     
      DCL VAR(&CST) TYPE(*CHAR) LEN(8)          
      DCL VAR(&STY) TYPE(*CHAR) LEN(12)        
      DCL VAR(&FAB) TYPE(*CHAR) LEN(10)
      DCL VAR(&FILE) TYPE(*CHAR) LEN(10)          
                           
      /* CGIRMTUSR - GET REMOTE USER ID */
      /* CGIPARSE - PARSE QUERY STRING */
       
      CGIRMTUSR USER(&USER)

      CGIPARSE SEARCH('CUSTOMER') RESULT(&RESULT)       
      CHGVAR VAR(&CST) VALUE(&RESULT)                     

      CGIPARSE SEARCH('STYLE') RESULT(&RESULT)          
      CHGVAR VAR(&STY) VALUE(&RESULT)                    
          
      /* call RPG to send HTML back to webuser */

      CHGVAR VAR(&FILE) VALUE('OP' *CAT &USER)
      OVRDBF ORDERFILE TOFILE(&FILE)
      CALL RPGPGM PARM(&CST &STY)

      ENDPGM       
                                              
      --- eamisano <eamisano@...> wrote:
      > Hi to all
      >
      > I have to write some vendor reports statistics using
      > Cgi programs.
      >
      > Now these reports are traditionally batch programs
      > and results are
      > only printed.
      >
      > These reports are complicated because they have
      > differents subtotals
      > and in this case it's easy (in non Cgi programs...)
      > 1) use Opnqryf to order data
      > 2) use control level indicator in Rpg to sum and
      > print subtotals.
      >
      > Can I use the same technology in Cgi programs ?
      >
      > Can I run a CL program before an Ile Cgi or I have
      > to run Opnqryf
      > and Ovrdbf share(*yes) width DOCMD ?
      >
      > Does anybody use Opnqryf to order data and level
      > indicator ?
      >
      > Thanks to all
      >

      >
      >


      __________________________________
      Do you Yahoo!?
      Yahoo! SiteBuilder - Free, easy-to-use web site design software
      http://sitebuilder.yahoo.com


      To unsubscribe from this group, send an email to:
      Easy400Group-unsubscribe@yahoogroups.com



      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
    • Enrico Amisano
      Richard I decide to use your suggests but I have some problems: when I execute the CPYSPLF an error CPF3303 issue. CPYSPLF FILE(STV1100P)
      Message 2 of 26 , Aug 1, 2003
        Richard I decide to use your suggests but I have some problems:
         
        when I execute the CPYSPLF an error CPF3303 issue.
         
         CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                      SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
         
        File STV1100P was not found in Job 271683/QTMHHTTP/PROD
         
         
        In fact if I use wrkactjob no spool exists for jobs:
                PROD        QTMHHTTP    BCI     0,0                  TIMW    
         
        My spool file is finished on PRT01 with different attributes:
        Job: QPRTJOB
        User: Amisano (me)
        Number: 271678/4
         
        Why ?
         
        Why the spool file is finished on PRT01 ?
         
         
         
         
         
         
         
        -----Messaggio originale-----
        Da: Richard ECUYER [mailto:recuyer@...]
        Inviato: giovedì 31 luglio 2003 16.17
        A: Easy400Group@yahoogroups.com
        Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

        when the spool is made, you can read each line and send them to the browser.
        you have many ways to do that : with API or with a simple CPYSPLF in a work file.
         
            in the CLP
         
                opnqryf ...
                run your PGM
                CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
         
                then you have your spool in a file
         
        back to the CGI :
         
            Open Qtemp/fichier
            Read fichier   
            dow not %eof
         
            updhtmlvar ....
            .....
         
         
         
        ----- Original Message -----
        Sent: Thursday, July 31, 2003 4:06 PM
        Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

        I beg your pardon but I don't understand what does it mean:
         
        ...........and cach the spool to send it by mail browse it.
         
        because I need to output the form only in the browser....
         
        and
         
        what does it mean
        "get back spool......" you say
         
        thanks
         
         
        -----Messaggio originale-----
        Da: Richard ECUYER [mailto:recuyer@...]
        Inviato: giovedì 31 luglio 2003 15.31
        A: Easy400Group@yahoogroups.com
        Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

        Hi,
        MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
         
        your Cgi interact with the browser.
         
        perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
         
            1) send form
            2) read values
                    Call CLP
                    Get back spool ....
                    Send the spool under table
            3) leave the Cgi
         
         
        ----- Original Message -----
        Sent: Thursday, July 31, 2003 3:13 PM
        Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

        I prefer break level because in Sql I have a lot of problems to work if there are
        many subtotals to do.
         
         
        My case is this: (but there are much more complicated cases)
         
        a) in one form I request the user for a representative name or <all>
         
        what I have to do in this case ?
         
        - call a Cgi program that in this case is a CLP normal program.
         
        This program will execute:
        1) Ovrdbf(xxxxx) share(*yes)
        2) Opnqryf xxxxxxx
        3) call MYCGIRPG
        4) clof xxxxx
        5) dltovr xxxxx
         
        6) In Ile MYCGIRPG I use this file as primary and use L1...L9
         
        it's correct this workflow ?
         
        Many thanks
         
         
         
         
        -----Messaggio originale-----
        Da: Stephen Corbett [mailto:corbett@...]
        Inviato: giovedì 31 luglio 2003 14.14
        A: Easy400Group@yahoogroups.com
        Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

        As with many programming problems there are at least twice as many ways as
        solving it as there are programmers working on it.

        There is probably no reason why you couldn't call a CL program as the CGI
        program.  Someone correct me if I'm wrong, but all a CGI program does is
        read from standard input and writes to standard output.  So long as that
        happens somewhere within your CGI program it probably doesn't matter when.
        (After all, I'm sure there are several internal programs called before we
        get control in any case.)

        As to what is easier.  Possibly an ILE program to read the request
        parameters from the browser calling a CL program that does an OPNQRYF, and
        calls an RPG program to create the required output using level breaks.  Like
        any tool, use the right one for the job.  Using level breaks can simplify
        many traditional reporting requirements by using the RPG cycle, including
        Level Breaks and Matching Record logic. (Remember that RPG does stand for
        Report Program Generator.)  However, there are many people who don't know or
        understand how the cycle works or the power it provides and avoid it like
        the plauge.  I have had the "pleasure" on many occassions of debugging code
        where the original programmer had not used the cycle and has coded level
        breaking code manually.  Personally, I use the cycle for most simple
        reporting .  For more unusual processing it is sometimes better to code it
        manually.

        One advantage of not using the cycle is that you can do your data selection
        within the program using embedded SQL.  This gives you many options that
        might not be available with OPNQRYF.

        At the end of the day you have to produce a result that satisfies your
        requirements and is robust and easily maintained in the future.

        Steve
        ----- Original Message -----
        From: "eamisano" <eamisano@...>
        To: <Easy400Group@yahoogroups.com>
        Sent: Thursday, July 31, 2003 9:08 PM
        Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
        programs


        > Hi to all
        >
        > I have to write some vendor reports statistics using Cgi programs.
        >
        > Now these reports are traditionally batch programs and results are
        > only printed.
        >
        > These reports are complicated because they have differents subtotals
        > and in this case it's easy (in non Cgi programs...)
        > 1) use Opnqryf to order data
        > 2) use control level indicator in Rpg to sum and print subtotals.
        >
        > Can I use the same technology in Cgi programs ?
        >
        > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
        > and Ovrdbf share(*yes) width DOCMD ?
        >
        > Does anybody use Opnqryf to order data and level indicator ?
        >
        > Thanks to all
        >
        >
        >
        >
        >
        > To unsubscribe from this group, send an email to:
        > Easy400Group-unsubscribe@yahoogroups.com
        >
        >
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >



        To unsubscribe from this group, send an email to:
        Easy400Group-unsubscribe@yahoogroups.com



        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


        To unsubscribe from this group, send an email to:
        Easy400Group-unsubscribe@yahoogroups.com



        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


        To unsubscribe from this group, send an email to:
        Easy400Group-unsubscribe@yahoogroups.com



        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


        To unsubscribe from this group, send an email to:
        Easy400Group-unsubscribe@yahoogroups.com



        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


        To unsubscribe from this group, send an email to:
        Easy400Group-unsubscribe@yahoogroups.com



        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
      • Ron Egyed
        Enrico, Add the following printer file override to your CL driver program. OVRPRTF FILE(STV1100P) SPLFOWN(*JOB) You should then be able to use the CPYSPLF
        Message 3 of 26 , Aug 1, 2003
          Enrico,
           
          Add the following printer file override to your CL driver program.
           
          OVRPRTF  FILE(STV1100P) SPLFOWN(*JOB)       
           
          You should then be able to use the CPYSPLF command.
           
           
          ----- Original Message -----
          Sent: Friday, August 01, 2003 8:10 AM
          Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

          Richard I decide to use your suggests but I have some problems:
           
          when I execute the CPYSPLF an error CPF3303 issue.
           
           CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                        SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
           
          File STV1100P was not found in Job 271683/QTMHHTTP/PROD
           
           
          In fact if I use wrkactjob no spool exists for jobs:
                  PROD        QTMHHTTP    BCI     0,0                  TIMW    
           
          My spool file is finished on PRT01 with different attributes:
          Job: QPRTJOB
          User: Amisano (me)
          Number: 271678/4
           
          Why ?
           
          Why the spool file is finished on PRT01 ?
           
           
           
           
           
           
           
          -----Messaggio originale-----
          Da: Richard ECUYER [mailto:recuyer@...]
          Inviato: giovedì 31 luglio 2003 16.17
          A: Easy400Group@yahoogroups.com
          Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

          when the spool is made, you can read each line and send them to the browser.
          you have many ways to do that : with API or with a simple CPYSPLF in a work file.
           
              in the CLP
           
                  opnqryf ...
                  run your PGM
                  CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                  CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
           
                  then you have your spool in a file
           
          back to the CGI :
           
              Open Qtemp/fichier
              Read fichier   
              dow not %eof
           
              updhtmlvar ....
              .....
           
           
           
          ----- Original Message -----
          Sent: Thursday, July 31, 2003 4:06 PM
          Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

          I beg your pardon but I don't understand what does it mean:
           
          ...........and cach the spool to send it by mail browse it.
           
          because I need to output the form only in the browser....
           
          and
           
          what does it mean
          "get back spool......" you say
           
          thanks
           
           
          -----Messaggio originale-----
          Da: Richard ECUYER [mailto:recuyer@...]
          Inviato: giovedì 31 luglio 2003 15.31
          A: Easy400Group@yahoogroups.com
          Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

          Hi,
          MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
           
          your Cgi interact with the browser.
           
          perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
           
              1) send form
              2) read values
                      Call CLP
                      Get back spool ....
                      Send the spool under table
              3) leave the Cgi
           
           
          ----- Original Message -----
          Sent: Thursday, July 31, 2003 3:13 PM
          Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

          I prefer break level because in Sql I have a lot of problems to work if there are
          many subtotals to do.
           
           
          My case is this: (but there are much more complicated cases)
           
          a) in one form I request the user for a representative name or <all>
           
          what I have to do in this case ?
           
          - call a Cgi program that in this case is a CLP normal program.
           
          This program will execute:
          1) Ovrdbf(xxxxx) share(*yes)
          2) Opnqryf xxxxxxx
          3) call MYCGIRPG
          4) clof xxxxx
          5) dltovr xxxxx
           
          6) In Ile MYCGIRPG I use this file as primary and use L1...L9
           
          it's correct this workflow ?
           
          Many thanks
           
           
           
           
          -----Messaggio originale-----
          Da: Stephen Corbett [mailto:corbett@...]
          Inviato: giovedì 31 luglio 2003 14.14
          A: Easy400Group@yahoogroups.com
          Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

          As with many programming problems there are at least twice as many ways as
          solving it as there are programmers working on it.

          There is probably no reason why you couldn't call a CL program as the CGI
          program.  Someone correct me if I'm wrong, but all a CGI program does is
          read from standard input and writes to standard output.  So long as that
          happens somewhere within your CGI program it probably doesn't matter when.
          (After all, I'm sure there are several internal programs called before we
          get control in any case.)

          As to what is easier.  Possibly an ILE program to read the request
          parameters from the browser calling a CL program that does an OPNQRYF, and
          calls an RPG program to create the required output using level breaks.  Like
          any tool, use the right one for the job.  Using level breaks can simplify
          many traditional reporting requirements by using the RPG cycle, including
          Level Breaks and Matching Record logic. (Remember that RPG does stand for
          Report Program Generator.)  However, there are many people who don't know or
          understand how the cycle works or the power it provides and avoid it like
          the plauge.  I have had the "pleasure" on many occassions of debugging code
          where the original programmer had not used the cycle and has coded level
          breaking code manually.  Personally, I use the cycle for most simple
          reporting .  For more unusual processing it is sometimes better to code it
          manually.

          One advantage of not using the cycle is that you can do your data selection
          within the program using embedded SQL.  This gives you many options that
          might not be available with OPNQRYF.

          At the end of the day you have to produce a result that satisfies your
          requirements and is robust and easily maintained in the future.

          Steve
          ----- Original Message -----
          From: "eamisano" <eamisano@...>
          To: <Easy400Group@yahoogroups.com>
          Sent: Thursday, July 31, 2003 9:08 PM
          Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
          programs


          > Hi to all
          >
          > I have to write some vendor reports statistics using Cgi programs.
          >
          > Now these reports are traditionally batch programs and results are
          > only printed.
          >
          > These reports are complicated because they have differents subtotals
          > and in this case it's easy (in non Cgi programs...)
          > 1) use Opnqryf to order data
          > 2) use control level indicator in Rpg to sum and print subtotals.
          >
          > Can I use the same technology in Cgi programs ?
          >
          > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
          > and Ovrdbf share(*yes) width DOCMD ?
          >
          > Does anybody use Opnqryf to order data and level indicator ?
          >
          > Thanks to all
          >
          >
          >
          >
          >
          > To unsubscribe from this group, send an email to:
          > Easy400Group-unsubscribe@yahoogroups.com
          >
          >
          >
          > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
          >
          >



          To unsubscribe from this group, send an email to:
          Easy400Group-unsubscribe@yahoogroups.com



          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          To unsubscribe from this group, send an email to:
          Easy400Group-unsubscribe@yahoogroups.com



          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          To unsubscribe from this group, send an email to:
          Easy400Group-unsubscribe@yahoogroups.com



          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          To unsubscribe from this group, send an email to:
          Easy400Group-unsubscribe@yahoogroups.com



          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          To unsubscribe from this group, send an email to:
          Easy400Group-unsubscribe@yahoogroups.com



          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


          To unsubscribe from this group, send an email to:
          Easy400Group-unsubscribe@yahoogroups.com



          Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
        • Richard ECUYER
          i don t know how you produce your spool, but if you produce it from a CL, you ll be able to make the cpysplf inside the same CL (after the spool is made)
          Message 4 of 26 , Aug 1, 2003
            i don't know how you produce your spool, but if you produce it from a CL, you'll be able to make the cpysplf inside the same CL (after the spool is made)
            Another thing, the user that run the cgi PGM is not QTMHTTP but QTMHHTP1.
            Try to make an OVRPRTF with HOLD(*YES) and OUTQ(yourOUTQ)
             
            Hope this help.
             
            ----- Original Message -----
            Sent: Friday, August 01, 2003 2:10 PM
            Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

            Richard I decide to use your suggests but I have some problems:
             
            when I execute the CPYSPLF an error CPF3303 issue.
             
             CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                          SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
             
            File STV1100P was not found in Job 271683/QTMHHTTP/PROD
             
             
            In fact if I use wrkactjob no spool exists for jobs:
                    PROD        QTMHHTTP    BCI     0,0                  TIMW    
             
            My spool file is finished on PRT01 with different attributes:
            Job: QPRTJOB
            User: Amisano (me)
            Number: 271678/4
             
            Why ?
             
            Why the spool file is finished on PRT01 ?
             
             
             
             
             
             
             
            -----Messaggio originale-----
            Da: Richard ECUYER [mailto:recuyer@...]
            Inviato: giovedì 31 luglio 2003 16.17
            A: Easy400Group@yahoogroups.com
            Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

            when the spool is made, you can read each line and send them to the browser.
            you have many ways to do that : with API or with a simple CPYSPLF in a work file.
             
                in the CLP
             
                    opnqryf ...
                    run your PGM
                    CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                    CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
             
                    then you have your spool in a file
             
            back to the CGI :
             
                Open Qtemp/fichier
                Read fichier   
                dow not %eof
             
                updhtmlvar ....
                .....
             
             
             
            ----- Original Message -----
            Sent: Thursday, July 31, 2003 4:06 PM
            Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

            I beg your pardon but I don't understand what does it mean:
             
            ...........and cach the spool to send it by mail browse it.
             
            because I need to output the form only in the browser....
             
            and
             
            what does it mean
            "get back spool......" you say
             
            thanks
             
             
            -----Messaggio originale-----
            Da: Richard ECUYER [mailto:recuyer@...]
            Inviato: giovedì 31 luglio 2003 15.31
            A: Easy400Group@yahoogroups.com
            Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

            Hi,
            MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
             
            your Cgi interact with the browser.
             
            perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
             
                1) send form
                2) read values
                        Call CLP
                        Get back spool ....
                        Send the spool under table
                3) leave the Cgi
             
             
            ----- Original Message -----
            Sent: Thursday, July 31, 2003 3:13 PM
            Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

            I prefer break level because in Sql I have a lot of problems to work if there are
            many subtotals to do.
             
             
            My case is this: (but there are much more complicated cases)
             
            a) in one form I request the user for a representative name or <all>
             
            what I have to do in this case ?
             
            - call a Cgi program that in this case is a CLP normal program.
             
            This program will execute:
            1) Ovrdbf(xxxxx) share(*yes)
            2) Opnqryf xxxxxxx
            3) call MYCGIRPG
            4) clof xxxxx
            5) dltovr xxxxx
             
            6) In Ile MYCGIRPG I use this file as primary and use L1...L9
             
            it's correct this workflow ?
             
            Many thanks
             
             
             
             
            -----Messaggio originale-----
            Da: Stephen Corbett [mailto:corbett@...]
            Inviato: giovedì 31 luglio 2003 14.14
            A: Easy400Group@yahoogroups.com
            Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

            As with many programming problems there are at least twice as many ways as
            solving it as there are programmers working on it.

            There is probably no reason why you couldn't call a CL program as the CGI
            program.  Someone correct me if I'm wrong, but all a CGI program does is
            read from standard input and writes to standard output.  So long as that
            happens somewhere within your CGI program it probably doesn't matter when.
            (After all, I'm sure there are several internal programs called before we
            get control in any case.)

            As to what is easier.  Possibly an ILE program to read the request
            parameters from the browser calling a CL program that does an OPNQRYF, and
            calls an RPG program to create the required output using level breaks.  Like
            any tool, use the right one for the job.  Using level breaks can simplify
            many traditional reporting requirements by using the RPG cycle, including
            Level Breaks and Matching Record logic. (Remember that RPG does stand for
            Report Program Generator.)  However, there are many people who don't know or
            understand how the cycle works or the power it provides and avoid it like
            the plauge.  I have had the "pleasure" on many occassions of debugging code
            where the original programmer had not used the cycle and has coded level
            breaking code manually.  Personally, I use the cycle for most simple
            reporting .  For more unusual processing it is sometimes better to code it
            manually.

            One advantage of not using the cycle is that you can do your data selection
            within the program using embedded SQL.  This gives you many options that
            might not be available with OPNQRYF.

            At the end of the day you have to produce a result that satisfies your
            requirements and is robust and easily maintained in the future.

            Steve
            ----- Original Message -----
            From: "eamisano" <eamisano@...>
            To: <Easy400Group@yahoogroups.com>
            Sent: Thursday, July 31, 2003 9:08 PM
            Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
            programs


            > Hi to all
            >
            > I have to write some vendor reports statistics using Cgi programs.
            >
            > Now these reports are traditionally batch programs and results are
            > only printed.
            >
            > These reports are complicated because they have differents subtotals
            > and in this case it's easy (in non Cgi programs...)
            > 1) use Opnqryf to order data
            > 2) use control level indicator in Rpg to sum and print subtotals.
            >
            > Can I use the same technology in Cgi programs ?
            >
            > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
            > and Ovrdbf share(*yes) width DOCMD ?
            >
            > Does anybody use Opnqryf to order data and level indicator ?
            >
            > Thanks to all
            >
            >
            >
            >
            >
            > To unsubscribe from this group, send an email to:
            > Easy400Group-unsubscribe@yahoogroups.com
            >
            >
            >
            > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
            >
            >



            To unsubscribe from this group, send an email to:
            Easy400Group-unsubscribe@yahoogroups.com



            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


            To unsubscribe from this group, send an email to:
            Easy400Group-unsubscribe@yahoogroups.com



            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


            To unsubscribe from this group, send an email to:
            Easy400Group-unsubscribe@yahoogroups.com



            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


            To unsubscribe from this group, send an email to:
            Easy400Group-unsubscribe@yahoogroups.com



            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


            To unsubscribe from this group, send an email to:
            Easy400Group-unsubscribe@yahoogroups.com



            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


            To unsubscribe from this group, send an email to:
            Easy400Group-unsubscribe@yahoogroups.com



            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
          • Enrico Amisano
            YES, YES, YES !!! WITH SPLFOWN(*YES) I CAN COPY THE SPOOL FILE !! ... Da: Ron Egyed [mailto:ronegyed@gte.net] Inviato: venerdì 1 agosto 2003 14.36 A:
            Message 5 of 26 , Aug 1, 2003
              YES, YES, YES !!!
               
              WITH SPLFOWN(*YES) I CAN COPY THE SPOOL FILE !!
              -----Messaggio originale-----
              Da: Ron Egyed [mailto:ronegyed@...]
              Inviato: venerdì 1 agosto 2003 14.36
              A: Easy400Group@yahoogroups.com
              Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

              Enrico,
               
              Add the following printer file override to your CL driver program.
               
              OVRPRTF  FILE(STV1100P) SPLFOWN(*JOB)       
               
              You should then be able to use the CPYSPLF command.
               
               
              ----- Original Message -----
              Sent: Friday, August 01, 2003 8:10 AM
              Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

              Richard I decide to use your suggests but I have some problems:
               
              when I execute the CPYSPLF an error CPF3303 issue.
               
               CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                            SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
               
              File STV1100P was not found in Job 271683/QTMHHTTP/PROD
               
               
              In fact if I use wrkactjob no spool exists for jobs:
                      PROD        QTMHHTTP    BCI     0,0                  TIMW    
               
              My spool file is finished on PRT01 with different attributes:
              Job: QPRTJOB
              User: Amisano (me)
              Number: 271678/4
               
              Why ?
               
              Why the spool file is finished on PRT01 ?
               
               
               
               
               
               
               
              -----Messaggio originale-----
              Da: Richard ECUYER [mailto:recuyer@...]
              Inviato: giovedì 31 luglio 2003 16.17
              A: Easy400Group@yahoogroups.com
              Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

              when the spool is made, you can read each line and send them to the browser.
              you have many ways to do that : with API or with a simple CPYSPLF in a work file.
               
                  in the CLP
               
                      opnqryf ...
                      run your PGM
                      CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                      CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
               
                      then you have your spool in a file
               
              back to the CGI :
               
                  Open Qtemp/fichier
                  Read fichier   
                  dow not %eof
               
                  updhtmlvar ....
                  .....
               
               
               
              ----- Original Message -----
              Sent: Thursday, July 31, 2003 4:06 PM
              Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

              I beg your pardon but I don't understand what does it mean:
               
              ...........and cach the spool to send it by mail browse it.
               
              because I need to output the form only in the browser....
               
              and
               
              what does it mean
              "get back spool......" you say
               
              thanks
               
               
              -----Messaggio originale-----
              Da: Richard ECUYER [mailto:recuyer@...]
              Inviato: giovedì 31 luglio 2003 15.31
              A: Easy400Group@yahoogroups.com
              Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

              Hi,
              MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
               
              your Cgi interact with the browser.
               
              perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
               
                  1) send form
                  2) read values
                          Call CLP
                          Get back spool ....
                          Send the spool under table
                  3) leave the Cgi
               
               
              ----- Original Message -----
              Sent: Thursday, July 31, 2003 3:13 PM
              Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

              I prefer break level because in Sql I have a lot of problems to work if there are
              many subtotals to do.
               
               
              My case is this: (but there are much more complicated cases)
               
              a) in one form I request the user for a representative name or <all>
               
              what I have to do in this case ?
               
              - call a Cgi program that in this case is a CLP normal program.
               
              This program will execute:
              1) Ovrdbf(xxxxx) share(*yes)
              2) Opnqryf xxxxxxx
              3) call MYCGIRPG
              4) clof xxxxx
              5) dltovr xxxxx
               
              6) In Ile MYCGIRPG I use this file as primary and use L1...L9
               
              it's correct this workflow ?
               
              Many thanks
               
               
               
               
              -----Messaggio originale-----
              Da: Stephen Corbett [mailto:corbett@...]
              Inviato: giovedì 31 luglio 2003 14.14
              A: Easy400Group@yahoogroups.com
              Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

              As with many programming problems there are at least twice as many ways as
              solving it as there are programmers working on it.

              There is probably no reason why you couldn't call a CL program as the CGI
              program.  Someone correct me if I'm wrong, but all a CGI program does is
              read from standard input and writes to standard output.  So long as that
              happens somewhere within your CGI program it probably doesn't matter when.
              (After all, I'm sure there are several internal programs called before we
              get control in any case.)

              As to what is easier.  Possibly an ILE program to read the request
              parameters from the browser calling a CL program that does an OPNQRYF, and
              calls an RPG program to create the required output using level breaks.  Like
              any tool, use the right one for the job.  Using level breaks can simplify
              many traditional reporting requirements by using the RPG cycle, including
              Level Breaks and Matching Record logic. (Remember that RPG does stand for
              Report Program Generator.)  However, there are many people who don't know or
              understand how the cycle works or the power it provides and avoid it like
              the plauge.  I have had the "pleasure" on many occassions of debugging code
              where the original programmer had not used the cycle and has coded level
              breaking code manually.  Personally, I use the cycle for most simple
              reporting .  For more unusual processing it is sometimes better to code it
              manually.

              One advantage of not using the cycle is that you can do your data selection
              within the program using embedded SQL.  This gives you many options that
              might not be available with OPNQRYF.

              At the end of the day you have to produce a result that satisfies your
              requirements and is robust and easily maintained in the future.

              Steve
              ----- Original Message -----
              From: "eamisano" <eamisano@...>
              To: <Easy400Group@yahoogroups.com>
              Sent: Thursday, July 31, 2003 9:08 PM
              Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
              programs


              > Hi to all
              >
              > I have to write some vendor reports statistics using Cgi programs.
              >
              > Now these reports are traditionally batch programs and results are
              > only printed.
              >
              > These reports are complicated because they have differents subtotals
              > and in this case it's easy (in non Cgi programs...)
              > 1) use Opnqryf to order data
              > 2) use control level indicator in Rpg to sum and print subtotals.
              >
              > Can I use the same technology in Cgi programs ?
              >
              > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
              > and Ovrdbf share(*yes) width DOCMD ?
              >
              > Does anybody use Opnqryf to order data and level indicator ?
              >
              > Thanks to all
              >
              >
              >
              >
              >
              > To unsubscribe from this group, send an email to:
              > Easy400Group-unsubscribe@yahoogroups.com
              >
              >
              >
              > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
              >
              >



              To unsubscribe from this group, send an email to:
              Easy400Group-unsubscribe@yahoogroups.com



              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


              To unsubscribe from this group, send an email to:
              Easy400Group-unsubscribe@yahoogroups.com



              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


              To unsubscribe from this group, send an email to:
              Easy400Group-unsubscribe@yahoogroups.com



              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


              To unsubscribe from this group, send an email to:
              Easy400Group-unsubscribe@yahoogroups.com



              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


              To unsubscribe from this group, send an email to:
              Easy400Group-unsubscribe@yahoogroups.com



              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


              To unsubscribe from this group, send an email to:
              Easy400Group-unsubscribe@yahoogroups.com



              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


              To unsubscribe from this group, send an email to:
              Easy400Group-unsubscribe@yahoogroups.com



              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
            • Enrico Amisano
              Another question: 1) In html I tried to use but there is a problem: the records in the database file (QTEMP) are printed in the browser with an empty
              Message 6 of 26 , Aug 1, 2003
                Another question:
                 
                1) In html I tried to use <pre>  but there is a problem:
                the records in the database file (QTEMP) are printed in the browser with an empty line between every two written lines.
                 
                Example:
                ROW1
                empty line
                ROW2
                empty line   
                 
                etc
                 
                Why ?
                In the database file generated from Cpysplf I have no empty record.........
                 
                My Html is:
                 
                /$header                                                               
                <table width="100%" border=0 cellspacing="0" cellpadding="0" border="0">
                                                                                       
                /$tablerow                                                             
                <tr>                                                                   
                <td valign=top align=left bgcolor="#ffffff">                           
                <font face="courier" size=2>                                           
                <pre>                                                                  
                <b> /%datiriga%/&nbsp;                                                 
                </pre>                                                                 
                </font>                                                                
                </td>                                                                  
                </tr>                                                                  
                                                                                       
                /$endtable                                                             
                </table>
                 
                 
                                                      
                2) many of my spool file are of 220 Cpi......
                what is the best method to view them in the browser avoiding to move on
                the right side ?
                Is there an Html function that allows to adapt the table in one page, or I have to
                modify all my printer files ?
                 
                 
                 
                 
                3) In Cpysplf command, I tried to use *PRTCTL parameter but what I have to do
                in Rpg ?
                Should I read the control characters to reproduce new page or to write bold char in Html form ?
                How should I do it ?
                 
                 
                Thank you very much in advance for your help.
                Enrico Amisano
                 
                 
                 
                -----Messaggio originale-----
                Da: Richard ECUYER [mailto:recuyer@...]
                Inviato: venerdì 1 agosto 2003 14.39
                A: Easy400Group@yahoogroups.com
                Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                i don't know how you produce your spool, but if you produce it from a CL, you'll be able to make the cpysplf inside the same CL (after the spool is made)
                Another thing, the user that run the cgi PGM is not QTMHTTP but QTMHHTP1.
                Try to make an OVRPRTF with HOLD(*YES) and OUTQ(yourOUTQ)
                 
                Hope this help.
                 
                ----- Original Message -----
                Sent: Friday, August 01, 2003 2:10 PM
                Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                Richard I decide to use your suggests but I have some problems:
                 
                when I execute the CPYSPLF an error CPF3303 issue.
                 
                 CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                              SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
                 
                File STV1100P was not found in Job 271683/QTMHHTTP/PROD
                 
                 
                In fact if I use wrkactjob no spool exists for jobs:
                        PROD        QTMHHTTP    BCI     0,0                  TIMW    
                 
                My spool file is finished on PRT01 with different attributes:
                Job: QPRTJOB
                User: Amisano (me)
                Number: 271678/4
                 
                Why ?
                 
                Why the spool file is finished on PRT01 ?
                 
                 
                 
                 
                 
                 
                 
                -----Messaggio originale-----
                Da: Richard ECUYER [mailto:recuyer@...]
                Inviato: giovedì 31 luglio 2003 16.17
                A: Easy400Group@yahoogroups.com
                Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                when the spool is made, you can read each line and send them to the browser.
                you have many ways to do that : with API or with a simple CPYSPLF in a work file.
                 
                    in the CLP
                 
                        opnqryf ...
                        run your PGM
                        CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                        CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
                 
                        then you have your spool in a file
                 
                back to the CGI :
                 
                    Open Qtemp/fichier
                    Read fichier   
                    dow not %eof
                 
                    updhtmlvar ....
                    .....
                 
                 
                 
                ----- Original Message -----
                Sent: Thursday, July 31, 2003 4:06 PM
                Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                I beg your pardon but I don't understand what does it mean:
                 
                ...........and cach the spool to send it by mail browse it.
                 
                because I need to output the form only in the browser....
                 
                and
                 
                what does it mean
                "get back spool......" you say
                 
                thanks
                 
                 
                -----Messaggio originale-----
                Da: Richard ECUYER [mailto:recuyer@...]
                Inviato: giovedì 31 luglio 2003 15.31
                A: Easy400Group@yahoogroups.com
                Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                Hi,
                MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
                 
                your Cgi interact with the browser.
                 
                perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
                 
                    1) send form
                    2) read values
                            Call CLP
                            Get back spool ....
                            Send the spool under table
                    3) leave the Cgi
                 
                 
                ----- Original Message -----
                Sent: Thursday, July 31, 2003 3:13 PM
                Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                I prefer break level because in Sql I have a lot of problems to work if there are
                many subtotals to do.
                 
                 
                My case is this: (but there are much more complicated cases)
                 
                a) in one form I request the user for a representative name or <all>
                 
                what I have to do in this case ?
                 
                - call a Cgi program that in this case is a CLP normal program.
                 
                This program will execute:
                1) Ovrdbf(xxxxx) share(*yes)
                2) Opnqryf xxxxxxx
                3) call MYCGIRPG
                4) clof xxxxx
                5) dltovr xxxxx
                 
                6) In Ile MYCGIRPG I use this file as primary and use L1...L9
                 
                it's correct this workflow ?
                 
                Many thanks
                 
                 
                 
                 
                -----Messaggio originale-----
                Da: Stephen Corbett [mailto:corbett@...]
                Inviato: giovedì 31 luglio 2003 14.14
                A: Easy400Group@yahoogroups.com
                Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                As with many programming problems there are at least twice as many ways as
                solving it as there are programmers working on it.

                There is probably no reason why you couldn't call a CL program as the CGI
                program.  Someone correct me if I'm wrong, but all a CGI program does is
                read from standard input and writes to standard output.  So long as that
                happens somewhere within your CGI program it probably doesn't matter when.
                (After all, I'm sure there are several internal programs called before we
                get control in any case.)

                As to what is easier.  Possibly an ILE program to read the request
                parameters from the browser calling a CL program that does an OPNQRYF, and
                calls an RPG program to create the required output using level breaks.  Like
                any tool, use the right one for the job.  Using level breaks can simplify
                many traditional reporting requirements by using the RPG cycle, including
                Level Breaks and Matching Record logic. (Remember that RPG does stand for
                Report Program Generator.)  However, there are many people who don't know or
                understand how the cycle works or the power it provides and avoid it like
                the plauge.  I have had the "pleasure" on many occassions of debugging code
                where the original programmer had not used the cycle and has coded level
                breaking code manually.  Personally, I use the cycle for most simple
                reporting .  For more unusual processing it is sometimes better to code it
                manually.

                One advantage of not using the cycle is that you can do your data selection
                within the program using embedded SQL.  This gives you many options that
                might not be available with OPNQRYF.

                At the end of the day you have to produce a result that satisfies your
                requirements and is robust and easily maintained in the future.

                Steve
                ----- Original Message -----
                From: "eamisano" <eamisano@...>
                To: <Easy400Group@yahoogroups.com>
                Sent: Thursday, July 31, 2003 9:08 PM
                Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
                programs


                > Hi to all
                >
                > I have to write some vendor reports statistics using Cgi programs.
                >
                > Now these reports are traditionally batch programs and results are
                > only printed.
                >
                > These reports are complicated because they have differents subtotals
                > and in this case it's easy (in non Cgi programs...)
                > 1) use Opnqryf to order data
                > 2) use control level indicator in Rpg to sum and print subtotals.
                >
                > Can I use the same technology in Cgi programs ?
                >
                > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
                > and Ovrdbf share(*yes) width DOCMD ?
                >
                > Does anybody use Opnqryf to order data and level indicator ?
                >
                > Thanks to all
                >
                >
                >
                >
                >
                > To unsubscribe from this group, send an email to:
                > Easy400Group-unsubscribe@yahoogroups.com
                >
                >
                >
                > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                >
                >



                To unsubscribe from this group, send an email to:
                Easy400Group-unsubscribe@yahoogroups.com



                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                To unsubscribe from this group, send an email to:
                Easy400Group-unsubscribe@yahoogroups.com



                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                To unsubscribe from this group, send an email to:
                Easy400Group-unsubscribe@yahoogroups.com



                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                To unsubscribe from this group, send an email to:
                Easy400Group-unsubscribe@yahoogroups.com



                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                To unsubscribe from this group, send an email to:
                Easy400Group-unsubscribe@yahoogroups.com



                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                To unsubscribe from this group, send an email to:
                Easy400Group-unsubscribe@yahoogroups.com



                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                To unsubscribe from this group, send an email to:
                Easy400Group-unsubscribe@yahoogroups.com



                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
              • Flaker, Jeff
                are you sure there are no x 0d25 (CR/LF) in the file? Jeffrey Flaker Senior Programmer/Analyst Linens N Things 6 Brighton Rd Clifton, NJ 07015 Phone:
                Message 7 of 26 , Aug 1, 2003
                  are you sure there are no x'0d25' (CR/LF) in the file?
                   
                  Jeffrey Flaker
                  Senior Programmer/Analyst
                  Linens 'N Things
                  6 Brighton Rd
                  Clifton, NJ 07015
                  Phone: 973-249-4384
                  Fax: 973-249-4901
                  http://www.lnt.com

                  "A good player makes himself look good; a great player makes the team look good."
                  Author unknown

                  -----Original Message-----
                  From: Enrico Amisano [mailto:eamisano@...]
                  Sent: Friday, August 01, 2003 11:48 AM
                  To: Easy400Group@yahoogroups.com
                  Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                  Another question:
                   
                  1) In html I tried to use <pre>  but there is a problem:
                  the records in the database file (QTEMP) are printed in the browser with an empty line between every two written lines.
                   
                  Example:
                  ROW1
                  empty line
                  ROW2
                  empty line   
                   
                  etc
                   
                  Why ?
                  In the database file generated from Cpysplf I have no empty record.........
                   
                  My Html is:
                   
                  /$header                                                               
                  <table width="100%" border=0 cellspacing="0" cellpadding="0" border="0">
                                                                                         
                  /$tablerow                                                             
                  <tr>                                                                   
                  <td valign=top align=left bgcolor="#ffffff">                           
                  <font face="courier" size=2>                                           
                  <pre>                                                                  
                  <b> /%datiriga%/&nbsp;                                                 
                  </pre>                                                                 
                  </font>                                                                
                  </td>                                                                  
                  </tr>                                                                  
                                                                                         
                  /$endtable                                                             
                  </table>
                   
                   
                                                        
                  2) many of my spool file are of 220 Cpi......
                  what is the best method to view them in the browser avoiding to move on
                  the right side ?
                  Is there an Html function that allows to adapt the table in one page, or I have to
                  modify all my printer files ?
                   
                   
                   
                   
                  3) In Cpysplf command, I tried to use *PRTCTL parameter but what I have to do
                  in Rpg ?
                  Should I read the control characters to reproduce new page or to write bold char in Html form ?
                  How should I do it ?
                   
                   
                  Thank you very much in advance for your help.
                  Enrico Amisano
                   
                   
                   
                  -----Messaggio originale-----
                  Da: Richard ECUYER [mailto:recuyer@...]
                  Inviato: venerdì 1 agosto 2003 14.39
                  A: Easy400Group@yahoogroups.com
                  Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                  i don't know how you produce your spool, but if you produce it from a CL, you'll be able to make the cpysplf inside the same CL (after the spool is made)
                  Another thing, the user that run the cgi PGM is not QTMHTTP but QTMHHTP1.
                  Try to make an OVRPRTF with HOLD(*YES) and OUTQ(yourOUTQ)
                   
                  Hope this help.
                   
                  ----- Original Message -----
                  Sent: Friday, August 01, 2003 2:10 PM
                  Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                  Richard I decide to use your suggests but I have some problems:
                   
                  when I execute the CPYSPLF an error CPF3303 issue.
                   
                   CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                                SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
                   
                  File STV1100P was not found in Job 271683/QTMHHTTP/PROD
                   
                   
                  In fact if I use wrkactjob no spool exists for jobs:
                          PROD        QTMHHTTP    BCI     0,0                  TIMW    
                   
                  My spool file is finished on PRT01 with different attributes:
                  Job: QPRTJOB
                  User: Amisano (me)
                  Number: 271678/4
                   
                  Why ?
                   
                  Why the spool file is finished on PRT01 ?
                   
                   
                   
                   
                   
                   
                   
                  -----Messaggio originale-----
                  Da: Richard ECUYER [mailto:recuyer@...]
                  Inviato: giovedì 31 luglio 2003 16.17
                  A: Easy400Group@yahoogroups.com
                  Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                  when the spool is made, you can read each line and send them to the browser.
                  you have many ways to do that : with API or with a simple CPYSPLF in a work file.
                   
                      in the CLP
                   
                          opnqryf ...
                          run your PGM
                          CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                          CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
                   
                          then you have your spool in a file
                   
                  back to the CGI :
                   
                      Open Qtemp/fichier
                      Read fichier   
                      dow not %eof
                   
                      updhtmlvar ....
                      .....
                   
                   
                   
                  ----- Original Message -----
                  Sent: Thursday, July 31, 2003 4:06 PM
                  Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                  I beg your pardon but I don't understand what does it mean:
                   
                  ...........and cach the spool to send it by mail browse it.
                   
                  because I need to output the form only in the browser....
                   
                  and
                   
                  what does it mean
                  "get back spool......" you say
                   
                  thanks
                   
                   
                  -----Messaggio originale-----
                  Da: Richard ECUYER [mailto:recuyer@...]
                  Inviato: giovedì 31 luglio 2003 15.31
                  A: Easy400Group@yahoogroups.com
                  Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                  Hi,
                  MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
                   
                  your Cgi interact with the browser.
                   
                  perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
                   
                      1) send form
                      2) read values
                              Call CLP
                              Get back spool ....
                              Send the spool under table
                      3) leave the Cgi
                   
                   
                  ----- Original Message -----
                  Sent: Thursday, July 31, 2003 3:13 PM
                  Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                  I prefer break level because in Sql I have a lot of problems to work if there are
                  many subtotals to do.
                   
                   
                  My case is this: (but there are much more complicated cases)
                   
                  a) in one form I request the user for a representative name or <all>
                   
                  what I have to do in this case ?
                   
                  - call a Cgi program that in this case is a CLP normal program.
                   
                  This program will execute:
                  1) Ovrdbf(xxxxx) share(*yes)
                  2) Opnqryf xxxxxxx
                  3) call MYCGIRPG
                  4) clof xxxxx
                  5) dltovr xxxxx
                   
                  6) In Ile MYCGIRPG I use this file as primary and use L1...L9
                   
                  it's correct this workflow ?
                   
                  Many thanks
                   
                   
                   
                   
                  -----Messaggio originale-----
                  Da: Stephen Corbett [mailto:corbett@...]
                  Inviato: giovedì 31 luglio 2003 14.14
                  A: Easy400Group@yahoogroups.com
                  Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                  As with many programming problems there are at least twice as many ways as
                  solving it as there are programmers working on it.

                  There is probably no reason why you couldn't call a CL program as the CGI
                  program.  Someone correct me if I'm wrong, but all a CGI program does is
                  read from standard input and writes to standard output.  So long as that
                  happens somewhere within your CGI program it probably doesn't matter when.
                  (After all, I'm sure there are several internal programs called before we
                  get control in any case.)

                  As to what is easier.  Possibly an ILE program to read the request
                  parameters from the browser calling a CL program that does an OPNQRYF, and
                  calls an RPG program to create the required output using level breaks.  Like
                  any tool, use the right one for the job.  Using level breaks can simplify
                  many traditional reporting requirements by using the RPG cycle, including
                  Level Breaks and Matching Record logic. (Remember that RPG does stand for
                  Report Program Generator.)  However, there are many people who don't know or
                  understand how the cycle works or the power it provides and avoid it like
                  the plauge.  I have had the "pleasure" on many occassions of debugging code
                  where the original programmer had not used the cycle and has coded level
                  breaking code manually.  Personally, I use the cycle for most simple
                  reporting .  For more unusual processing it is sometimes better to code it
                  manually.

                  One advantage of not using the cycle is that you can do your data selection
                  within the program using embedded SQL.  This gives you many options that
                  might not be available with OPNQRYF.

                  At the end of the day you have to produce a result that satisfies your
                  requirements and is robust and easily maintained in the future.

                  Steve
                  ----- Original Message -----
                  From: "eamisano" <eamisano@...>
                  To: <Easy400Group@yahoogroups.com>
                  Sent: Thursday, July 31, 2003 9:08 PM
                  Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
                  programs


                  > Hi to all
                  >
                  > I have to write some vendor reports statistics using Cgi programs.
                  >
                  > Now these reports are traditionally batch programs and results are
                  > only printed.
                  >
                  > These reports are complicated because they have differents subtotals
                  > and in this case it's easy (in non Cgi programs...)
                  > 1) use Opnqryf to order data
                  > 2) use control level indicator in Rpg to sum and print subtotals.
                  >
                  > Can I use the same technology in Cgi programs ?
                  >
                  > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
                  > and Ovrdbf share(*yes) width DOCMD ?
                  >
                  > Does anybody use Opnqryf to order data and level indicator ?
                  >
                  > Thanks to all
                  >
                  >
                  >
                  >
                  >
                  > To unsubscribe from this group, send an email to:
                  > Easy400Group-unsubscribe@yahoogroups.com
                  >
                  >
                  >
                  > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                  >
                  >



                  To unsubscribe from this group, send an email to:
                  Easy400Group-unsubscribe@yahoogroups.com



                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                  To unsubscribe from this group, send an email to:
                  Easy400Group-unsubscribe@yahoogroups.com



                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                  To unsubscribe from this group, send an email to:
                  Easy400Group-unsubscribe@yahoogroups.com



                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                  To unsubscribe from this group, send an email to:
                  Easy400Group-unsubscribe@yahoogroups.com



                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                  To unsubscribe from this group, send an email to:
                  Easy400Group-unsubscribe@yahoogroups.com



                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                  To unsubscribe from this group, send an email to:
                  Easy400Group-unsubscribe@yahoogroups.com



                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                  To unsubscribe from this group, send an email to:
                  Easy400Group-unsubscribe@yahoogroups.com



                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                  To unsubscribe from this group, send an email to:
                  Easy400Group-unsubscribe@yahoogroups.com



                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
                • Richard ECUYER
                  To display a spool here is what i use (fichier must be more than 210 for you) Dspspl_html.txt is my HTML canevas. hope this help ... From: Enrico Amisano To:
                  Message 8 of 26 , Aug 1, 2003
                    To display a spool here is what i use (fichier must be more than 210 for you)
                     
                    Dspspl_html.txt is my HTML canevas.
                    hope this help                    
                    ----- Original Message -----
                    Sent: Friday, August 01, 2003 5:47 PM
                    Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                    Another question:
                     
                    1) In html I tried to use <pre>  but there is a problem:
                    the records in the database file (QTEMP) are printed in the browser with an empty line between every two written lines.
                     
                    Example:
                    ROW1
                    empty line
                    ROW2
                    empty line   
                     
                    etc
                     
                    Why ?
                    In the database file generated from Cpysplf I have no empty record.........
                     
                    My Html is:
                     
                    /$header                                                               
                    <table width="100%" border=0 cellspacing="0" cellpadding="0" border="0">
                                                                                           
                    /$tablerow                                                             
                    <tr>                                                                   
                    <td valign=top align=left bgcolor="#ffffff">                           
                    <font face="courier" size=2>                                           
                    <pre>                                                                  
                    <b> /%datiriga%/&nbsp;                                                 
                    </pre>                                                                 
                    </font>                                                                
                    </td>                                                                  
                    </tr>                                                                  
                                                                                           
                    /$endtable                                                             
                    </table>
                     
                     
                                                          
                    2) many of my spool file are of 220 Cpi......
                    what is the best method to view them in the browser avoiding to move on
                    the right side ?
                    Is there an Html function that allows to adapt the table in one page, or I have to
                    modify all my printer files ?
                     
                     
                     
                     
                    3) In Cpysplf command, I tried to use *PRTCTL parameter but what I have to do
                    in Rpg ?
                    Should I read the control characters to reproduce new page or to write bold char in Html form ?
                    How should I do it ?
                     
                     
                    Thank you very much in advance for your help.
                    Enrico Amisano
                     
                     
                     
                    -----Messaggio originale-----
                    Da: Richard ECUYER [mailto:recuyer@...]
                    Inviato: venerdì 1 agosto 2003 14.39
                    A: Easy400Group@yahoogroups.com
                    Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                    i don't know how you produce your spool, but if you produce it from a CL, you'll be able to make the cpysplf inside the same CL (after the spool is made)
                    Another thing, the user that run the cgi PGM is not QTMHTTP but QTMHHTP1.
                    Try to make an OVRPRTF with HOLD(*YES) and OUTQ(yourOUTQ)
                     
                    Hope this help.
                     
                    ----- Original Message -----
                    Sent: Friday, August 01, 2003 2:10 PM
                    Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                    Richard I decide to use your suggests but I have some problems:
                     
                    when I execute the CPYSPLF an error CPF3303 issue.
                     
                     CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                                  SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
                     
                    File STV1100P was not found in Job 271683/QTMHHTTP/PROD
                     
                     
                    In fact if I use wrkactjob no spool exists for jobs:
                            PROD        QTMHHTTP    BCI     0,0                  TIMW    
                     
                    My spool file is finished on PRT01 with different attributes:
                    Job: QPRTJOB
                    User: Amisano (me)
                    Number: 271678/4
                     
                    Why ?
                     
                    Why the spool file is finished on PRT01 ?
                     
                     
                     
                     
                     
                     
                     
                    -----Messaggio originale-----
                    Da: Richard ECUYER [mailto:recuyer@...]
                    Inviato: giovedì 31 luglio 2003 16.17
                    A: Easy400Group@yahoogroups.com
                    Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                    when the spool is made, you can read each line and send them to the browser.
                    you have many ways to do that : with API or with a simple CPYSPLF in a work file.
                     
                        in the CLP
                     
                            opnqryf ...
                            run your PGM
                            CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                            CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
                     
                            then you have your spool in a file
                     
                    back to the CGI :
                     
                        Open Qtemp/fichier
                        Read fichier   
                        dow not %eof
                     
                        updhtmlvar ....
                        .....
                     
                     
                     
                    ----- Original Message -----
                    Sent: Thursday, July 31, 2003 4:06 PM
                    Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                    I beg your pardon but I don't understand what does it mean:
                     
                    ...........and cach the spool to send it by mail browse it.
                     
                    because I need to output the form only in the browser....
                     
                    and
                     
                    what does it mean
                    "get back spool......" you say
                     
                    thanks
                     
                     
                    -----Messaggio originale-----
                    Da: Richard ECUYER [mailto:recuyer@...]
                    Inviato: giovedì 31 luglio 2003 15.31
                    A: Easy400Group@yahoogroups.com
                    Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                    Hi,
                    MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
                     
                    your Cgi interact with the browser.
                     
                    perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
                     
                        1) send form
                        2) read values
                                Call CLP
                                Get back spool ....
                                Send the spool under table
                        3) leave the Cgi
                     
                     
                    ----- Original Message -----
                    Sent: Thursday, July 31, 2003 3:13 PM
                    Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                    I prefer break level because in Sql I have a lot of problems to work if there are
                    many subtotals to do.
                     
                     
                    My case is this: (but there are much more complicated cases)
                     
                    a) in one form I request the user for a representative name or <all>
                     
                    what I have to do in this case ?
                     
                    - call a Cgi program that in this case is a CLP normal program.
                     
                    This program will execute:
                    1) Ovrdbf(xxxxx) share(*yes)
                    2) Opnqryf xxxxxxx
                    3) call MYCGIRPG
                    4) clof xxxxx
                    5) dltovr xxxxx
                     
                    6) In Ile MYCGIRPG I use this file as primary and use L1...L9
                     
                    it's correct this workflow ?
                     
                    Many thanks
                     
                     
                     
                     
                    -----Messaggio originale-----
                    Da: Stephen Corbett [mailto:corbett@...]
                    Inviato: giovedì 31 luglio 2003 14.14
                    A: Easy400Group@yahoogroups.com
                    Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                    As with many programming problems there are at least twice as many ways as
                    solving it as there are programmers working on it.

                    There is probably no reason why you couldn't call a CL program as the CGI
                    program.  Someone correct me if I'm wrong, but all a CGI program does is
                    read from standard input and writes to standard output.  So long as that
                    happens somewhere within your CGI program it probably doesn't matter when.
                    (After all, I'm sure there are several internal programs called before we
                    get control in any case.)

                    As to what is easier.  Possibly an ILE program to read the request
                    parameters from the browser calling a CL program that does an OPNQRYF, and
                    calls an RPG program to create the required output using level breaks.  Like
                    any tool, use the right one for the job.  Using level breaks can simplify
                    many traditional reporting requirements by using the RPG cycle, including
                    Level Breaks and Matching Record logic. (Remember that RPG does stand for
                    Report Program Generator.)  However, there are many people who don't know or
                    understand how the cycle works or the power it provides and avoid it like
                    the plauge.  I have had the "pleasure" on many occassions of debugging code
                    where the original programmer had not used the cycle and has coded level
                    breaking code manually.  Personally, I use the cycle for most simple
                    reporting .  For more unusual processing it is sometimes better to code it
                    manually.

                    One advantage of not using the cycle is that you can do your data selection
                    within the program using embedded SQL.  This gives you many options that
                    might not be available with OPNQRYF.

                    At the end of the day you have to produce a result that satisfies your
                    requirements and is robust and easily maintained in the future.

                    Steve
                    ----- Original Message -----
                    From: "eamisano" <eamisano@...>
                    To: <Easy400Group@yahoogroups.com>
                    Sent: Thursday, July 31, 2003 9:08 PM
                    Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
                    programs


                    > Hi to all
                    >
                    > I have to write some vendor reports statistics using Cgi programs.
                    >
                    > Now these reports are traditionally batch programs and results are
                    > only printed.
                    >
                    > These reports are complicated because they have differents subtotals
                    > and in this case it's easy (in non Cgi programs...)
                    > 1) use Opnqryf to order data
                    > 2) use control level indicator in Rpg to sum and print subtotals.
                    >
                    > Can I use the same technology in Cgi programs ?
                    >
                    > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
                    > and Ovrdbf share(*yes) width DOCMD ?
                    >
                    > Does anybody use Opnqryf to order data and level indicator ?
                    >
                    > Thanks to all
                    >
                    >
                    >
                    >
                    >
                    > To unsubscribe from this group, send an email to:
                    > Easy400Group-unsubscribe@yahoogroups.com
                    >
                    >
                    >
                    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                    >
                    >



                    To unsubscribe from this group, send an email to:
                    Easy400Group-unsubscribe@yahoogroups.com



                    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                    To unsubscribe from this group, send an email to:
                    Easy400Group-unsubscribe@yahoogroups.com



                    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                    To unsubscribe from this group, send an email to:
                    Easy400Group-unsubscribe@yahoogroups.com



                    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                    To unsubscribe from this group, send an email to:
                    Easy400Group-unsubscribe@yahoogroups.com



                    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                    To unsubscribe from this group, send an email to:
                    Easy400Group-unsubscribe@yahoogroups.com



                    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                    To unsubscribe from this group, send an email to:
                    Easy400Group-unsubscribe@yahoogroups.com



                    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                    To unsubscribe from this group, send an email to:
                    Easy400Group-unsubscribe@yahoogroups.com



                    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                    To unsubscribe from this group, send an email to:
                    Easy400Group-unsubscribe@yahoogroups.com



                    Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
                  • Jon Paris
                    ... database file (QTEMP) are printed in the browser with an empty line between every two written lines. For some reason that I have never fully fathomed,
                    Message 9 of 26 , Aug 1, 2003
                       >> In html I tried to use <pre>  but there is a problem: the records in the database file (QTEMP) are printed in the browser with an empty line between every two written lines.
                       
                      For some reason that I have never fully fathomed, <pre> only works "properly" when you _omit_ the ending tag </pre>
                       
                      All browsers I have tried work correctly without </pre> but only Mozilla (I think) gets it right if the end tag is included.
                       
                      Go figure!
                       

                      Jon Paris
                      Partner400
                      www.Partner400.com

                       
                    • Peter Fuller
                      I figure its Standards! The great thing about standards is there are so many to choose from! Peter Fuller
                      Message 10 of 26 , Aug 1, 2003
                        I figure its Standards! The great thing about
                        standards is there are so many to choose from!

                        Peter Fuller

                        --- Jon Paris <Jon.Paris@...> wrote:
                        > >> In html I tried to use <pre> but there is a
                        > problem: the records in the
                        > database file (QTEMP) are printed in the browser
                        > with an empty line between
                        > every two written lines.
                        >
                        > For some reason that I have never fully fathomed,
                        > <pre> only works
                        > "properly" when you _omit_ the ending tag </pre>
                        >
                        > All browsers I have tried work correctly without
                        > </pre> but only Mozilla (I
                        > think) gets it right if the end tag is included.
                        >
                        > Go figure!
                        >
                        > Jon Paris
                        > Partner400
                        > www.Partner400.com
                        >
                        >
                        >
                      • Elbert Cook
                        You can call a CLP first, which then calls a RPG to output an html stream file. If you want the result displayed on the same screen, without going to new URL
                        Message 11 of 26 , Aug 2, 2003
                          You can call a CLP first, which then calls a RPG to
                          output an html stream file.

                          If you want the result displayed on the same screen,
                          without going to new URL screen or opening a new
                          window. Things get tricky, because HTML doesn't like
                          to work that way.

                          Typically you input data, click a submit button,
                          execute a program which builds a new page or window.

                          If you want the output data on the same page as the
                          input data. Its not impossible, but its difficult to
                          accomplish.



                          --- Enrico Amisano <eamisano@...> wrote:
                          > many thanks but:
                          >
                          > if I have a form in wich users input data to have a
                          > result, do you call in
                          > Html directly the CLP program ?
                          > Or you run first a Cgi Rpg to and after run the CLP
                          > ?
                          >
                          > Thanks
                          >
                          > -----Messaggio originale-----
                          > Da: Elbert Cook [mailto:emcook@...]
                          > Inviato: gioved� 31 luglio 2003 16.09
                          > A: Easy400Group@yahoogroups.com
                          > Oggetto: Re: [Easy400Group] Using Opnqryf and
                          > control level indicator in
                          > Cgi programs
                          >
                          >
                          > I use CLP's all the time. I have created commands
                          > to
                          > extract the values from the HTML Query String into
                          > CL
                          > variables.
                          >
                          > >From there I pass the variables to RPG's, or use
                          > them
                          > in Opnqryf's, or pass them to other CLP's.
                          >
                          > I'm not sure why all the Web focus in on RPG
                          > alone.
                          > But 99% of my web app's launches CLP's as the
                          > initial
                          > program.
                          >
                          > Example.
                          >
                          > PGM
                          > DCL VAR(&USER) TYPE(*CHAR) LEN(10)
                          > DCL VAR(&RESULT) TYPE(*CHAR) LEN(1024)
                          > DCL VAR(&CST) TYPE(*CHAR) LEN(8)
                          > DCL VAR(&STY) TYPE(*CHAR) LEN(12)
                          > DCL VAR(&FAB) TYPE(*CHAR) LEN(10)
                          > DCL VAR(&FILE) TYPE(*CHAR) LEN(10)
                          >
                          > /* CGIRMTUSR - GET REMOTE USER ID */
                          > /* CGIPARSE - PARSE QUERY STRING */
                          >
                          > CGIRMTUSR USER(&USER)
                          >
                          > CGIPARSE SEARCH('CUSTOMER') RESULT(&RESULT)
                          > CHGVAR VAR(&CST) VALUE(&RESULT)
                          >
                          > CGIPARSE SEARCH('STYLE') RESULT(&RESULT)
                          > CHGVAR VAR(&STY) VALUE(&RESULT)
                          >
                          > /* call RPG to send HTML back to webuser */
                          >
                          > CHGVAR VAR(&FILE) VALUE('OP' *CAT &USER)
                          > OVRDBF ORDERFILE TOFILE(&FILE)
                          > CALL RPGPGM PARM(&CST &STY)
                          >
                          > ENDPGM
                          >
                          > --- eamisano <eamisano@...> wrote:
                          > > Hi to all
                          > >
                          > > I have to write some vendor reports statistics
                          > using
                          > > Cgi programs.
                          > >
                          > > Now these reports are traditionally batch
                          > programs
                          > > and results are
                          > > only printed.
                          > >
                          > > These reports are complicated because they have
                          > > differents subtotals
                          > > and in this case it's easy (in non Cgi
                          > programs...)
                          > > 1) use Opnqryf to order data
                          > > 2) use control level indicator in Rpg to sum and
                          > > print subtotals.
                          > >
                          > > Can I use the same technology in Cgi programs ?
                          > >
                          > > Can I run a CL program before an Ile Cgi or I
                          > have
                          > > to run Opnqryf
                          > > and Ovrdbf share(*yes) width DOCMD ?
                          > >
                          > > Does anybody use Opnqryf to order data and level
                          > > indicator ?
                          > >
                          > > Thanks to all
                          > >
                          > >
                          > >
                          > >
                          >
                          >
                          > __________________________________
                          > Do you Yahoo!?
                          > Yahoo! SiteBuilder - Free, easy-to-use web site
                          > design software
                          > http://sitebuilder.yahoo.com
                          >
                          > Yahoo! Groups Sponsor
                          > ADVERTISEMENT
                          >
                          >
                          >
                          >
                          > To unsubscribe from this group, send an email to:
                          > Easy400Group-unsubscribe@yahoogroups.com
                          >
                          >
                          >
                          > Your use of Yahoo! Groups is subject to the Yahoo!
                          > Terms of Service.
                          >


                          __________________________________
                          Do you Yahoo!?
                          Yahoo! SiteBuilder - Free, easy-to-use web site design software
                          http://sitebuilder.yahoo.com
                        • Enrico Amisano
                          Many thanks for your help. Now everything is correct. The latest problem: my users are very sophisticated. If I put a 220 Cpi spool file on a html page, they
                          Message 12 of 26 , Aug 5, 2003
                             
                            Many thanks for your help.
                             
                            Now everything is correct.
                             
                            The latest problem:
                            my users are very sophisticated.
                             
                            If I put a 220 Cpi spool file on a html page, they accuse me that the spool file isn't well visible
                            in printing format and they have to scroll the page in the right side.....
                             
                            At the end I decide to revise all my programs.
                             
                            But how I can execute an Opnqryf in this case?
                             
                            WSTV10        require parameters (cgi Ile)
                            WSTV11        retreive input user (cgi ile)
                            WSTV11C     "normal" clp that execute an Opnqryf
                            WSTV11H    display results on Html (cgi ile)
                             
                            In WSTV11H I have defined the primary file used in Opnqryf, with break level.
                             
                            But it seems to select the entire file, not only the selected record in WSTV11C.
                             
                            I make Opnqryf since 10 years, the syntax is correct...
                             
                             
                            WSTV11:
                                                                                          
                            OVRDBF     FILE(AAGE200F) TOFILE(AAGE200F) SHARE(*YES)
                             
                            OPNQRYF    FILE((AAGE200F)) OPTION(*INP) QRYSLT('ATA02 +  
                                           *EQ " " *AND CODAG *EQ "' *CAT &CDAGEV +     
                                           *CAT '"') KEYFLD((CODAG))                    
                             
                            CALL WSTV11H
                             
                             
                            Anybody can help me ?
                             
                             
                             
                             
                             
                            -----Messaggio originale-----
                            Da: Richard ECUYER [mailto:recuyer@...]
                            Inviato: venerdì 1 agosto 2003 18.01
                            A: Easy400Group@yahoogroups.com
                            Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                            To display a spool here is what i use (fichier must be more than 210 for you)
                             
                            Dspspl_html.txt is my HTML canevas.
                            hope this help                    
                            ----- Original Message -----
                            Sent: Friday, August 01, 2003 5:47 PM
                            Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                            Another question:
                             
                            1) In html I tried to use <pre>  but there is a problem:
                            the records in the database file (QTEMP) are printed in the browser with an empty line between every two written lines.
                             
                            Example:
                            ROW1
                            empty line
                            ROW2
                            empty line   
                             
                            etc
                             
                            Why ?
                            In the database file generated from Cpysplf I have no empty record.........
                             
                            My Html is:
                             
                            /$header                                                               
                            <table width="100%" border=0 cellspacing="0" cellpadding="0" border="0">
                                                                                                   
                            /$tablerow                                                             
                            <tr>                                                                   
                            <td valign=top align=left bgcolor="#ffffff">                           
                            <font face="courier" size=2>                                           
                            <pre>                                                                  
                            <b> /%datiriga%/&nbsp;                                                 
                            </pre>                                                                 
                            </font>                                                                
                            </td>                                                                  
                            </tr>                                                                  
                                                                                                   
                            /$endtable                                                             
                            </table>
                             
                             
                                                                  
                            2) many of my spool file are of 220 Cpi......
                            what is the best method to view them in the browser avoiding to move on
                            the right side ?
                            Is there an Html function that allows to adapt the table in one page, or I have to
                            modify all my printer files ?
                             
                             
                             
                             
                            3) In Cpysplf command, I tried to use *PRTCTL parameter but what I have to do
                            in Rpg ?
                            Should I read the control characters to reproduce new page or to write bold char in Html form ?
                            How should I do it ?
                             
                             
                            Thank you very much in advance for your help.
                            Enrico Amisano
                             
                             
                             
                            -----Messaggio originale-----
                            Da: Richard ECUYER [mailto:recuyer@...]
                            Inviato: venerdì 1 agosto 2003 14.39
                            A: Easy400Group@yahoogroups.com
                            Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                            i don't know how you produce your spool, but if you produce it from a CL, you'll be able to make the cpysplf inside the same CL (after the spool is made)
                            Another thing, the user that run the cgi PGM is not QTMHTTP but QTMHHTP1.
                            Try to make an OVRPRTF with HOLD(*YES) and OUTQ(yourOUTQ)
                             
                            Hope this help.
                             
                            ----- Original Message -----
                            Sent: Friday, August 01, 2003 2:10 PM
                            Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                            Richard I decide to use your suggests but I have some problems:
                             
                            when I execute the CPYSPLF an error CPF3303 issue.
                             
                             CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                                          SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
                             
                            File STV1100P was not found in Job 271683/QTMHHTTP/PROD
                             
                             
                            In fact if I use wrkactjob no spool exists for jobs:
                                    PROD        QTMHHTTP    BCI     0,0                  TIMW    
                             
                            My spool file is finished on PRT01 with different attributes:
                            Job: QPRTJOB
                            User: Amisano (me)
                            Number: 271678/4
                             
                            Why ?
                             
                            Why the spool file is finished on PRT01 ?
                             
                             
                             
                             
                             
                             
                             
                            -----Messaggio originale-----
                            Da: Richard ECUYER [mailto:recuyer@...]
                            Inviato: giovedì 31 luglio 2003 16.17
                            A: Easy400Group@yahoogroups.com
                            Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                            when the spool is made, you can read each line and send them to the browser.
                            you have many ways to do that : with API or with a simple CPYSPLF in a work file.
                             
                                in the CLP
                             
                                    opnqryf ...
                                    run your PGM
                                    CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                                    CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
                             
                                    then you have your spool in a file
                             
                            back to the CGI :
                             
                                Open Qtemp/fichier
                                Read fichier   
                                dow not %eof
                             
                                updhtmlvar ....
                                .....
                             
                             
                             
                            ----- Original Message -----
                            Sent: Thursday, July 31, 2003 4:06 PM
                            Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                            I beg your pardon but I don't understand what does it mean:
                             
                            ...........and cach the spool to send it by mail browse it.
                             
                            because I need to output the form only in the browser....
                             
                            and
                             
                            what does it mean
                            "get back spool......" you say
                             
                            thanks
                             
                             
                            -----Messaggio originale-----
                            Da: Richard ECUYER [mailto:recuyer@...]
                            Inviato: giovedì 31 luglio 2003 15.31
                            A: Easy400Group@yahoogroups.com
                            Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                            Hi,
                            MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
                             
                            your Cgi interact with the browser.
                             
                            perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
                             
                                1) send form
                                2) read values
                                        Call CLP
                                        Get back spool ....
                                        Send the spool under table
                                3) leave the Cgi
                             
                             
                            ----- Original Message -----
                            Sent: Thursday, July 31, 2003 3:13 PM
                            Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                            I prefer break level because in Sql I have a lot of problems to work if there are
                            many subtotals to do.
                             
                             
                            My case is this: (but there are much more complicated cases)
                             
                            a) in one form I request the user for a representative name or <all>
                             
                            what I have to do in this case ?
                             
                            - call a Cgi program that in this case is a CLP normal program.
                             
                            This program will execute:
                            1) Ovrdbf(xxxxx) share(*yes)
                            2) Opnqryf xxxxxxx
                            3) call MYCGIRPG
                            4) clof xxxxx
                            5) dltovr xxxxx
                             
                            6) In Ile MYCGIRPG I use this file as primary and use L1...L9
                             
                            it's correct this workflow ?
                             
                            Many thanks
                             
                             
                             
                             
                            -----Messaggio originale-----
                            Da: Stephen Corbett [mailto:corbett@...]
                            Inviato: giovedì 31 luglio 2003 14.14
                            A: Easy400Group@yahoogroups.com
                            Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                            As with many programming problems there are at least twice as many ways as
                            solving it as there are programmers working on it.

                            There is probably no reason why you couldn't call a CL program as the CGI
                            program.  Someone correct me if I'm wrong, but all a CGI program does is
                            read from standard input and writes to standard output.  So long as that
                            happens somewhere within your CGI program it probably doesn't matter when.
                            (After all, I'm sure there are several internal programs called before we
                            get control in any case.)

                            As to what is easier.  Possibly an ILE program to read the request
                            parameters from the browser calling a CL program that does an OPNQRYF, and
                            calls an RPG program to create the required output using level breaks.  Like
                            any tool, use the right one for the job.  Using level breaks can simplify
                            many traditional reporting requirements by using the RPG cycle, including
                            Level Breaks and Matching Record logic. (Remember that RPG does stand for
                            Report Program Generator.)  However, there are many people who don't know or
                            understand how the cycle works or the power it provides and avoid it like
                            the plauge.  I have had the "pleasure" on many occassions of debugging code
                            where the original programmer had not used the cycle and has coded level
                            breaking code manually.  Personally, I use the cycle for most simple
                            reporting .  For more unusual processing it is sometimes better to code it
                            manually.

                            One advantage of not using the cycle is that you can do your data selection
                            within the program using embedded SQL.  This gives you many options that
                            might not be available with OPNQRYF.

                            At the end of the day you have to produce a result that satisfies your
                            requirements and is robust and easily maintained in the future.

                            Steve
                            ----- Original Message -----
                            From: "eamisano" <eamisano@...>
                            To: <Easy400Group@yahoogroups.com>
                            Sent: Thursday, July 31, 2003 9:08 PM
                            Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
                            programs


                            > Hi to all
                            >
                            > I have to write some vendor reports statistics using Cgi programs.
                            >
                            > Now these reports are traditionally batch programs and results are
                            > only printed.
                            >
                            > These reports are complicated because they have differents subtotals
                            > and in this case it's easy (in non Cgi programs...)
                            > 1) use Opnqryf to order data
                            > 2) use control level indicator in Rpg to sum and print subtotals.
                            >
                            > Can I use the same technology in Cgi programs ?
                            >
                            > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
                            > and Ovrdbf share(*yes) width DOCMD ?
                            >
                            > Does anybody use Opnqryf to order data and level indicator ?
                            >
                            > Thanks to all
                            >
                            >
                            >
                            >
                            >
                            > To unsubscribe from this group, send an email to:
                            > Easy400Group-unsubscribe@yahoogroups.com
                            >
                            >
                            >
                            > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                            >
                            >



                            To unsubscribe from this group, send an email to:
                            Easy400Group-unsubscribe@yahoogroups.com



                            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                            To unsubscribe from this group, send an email to:
                            Easy400Group-unsubscribe@yahoogroups.com



                            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                            To unsubscribe from this group, send an email to:
                            Easy400Group-unsubscribe@yahoogroups.com



                            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                            To unsubscribe from this group, send an email to:
                            Easy400Group-unsubscribe@yahoogroups.com



                            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                            To unsubscribe from this group, send an email to:
                            Easy400Group-unsubscribe@yahoogroups.com



                            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                            To unsubscribe from this group, send an email to:
                            Easy400Group-unsubscribe@yahoogroups.com



                            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                            To unsubscribe from this group, send an email to:
                            Easy400Group-unsubscribe@yahoogroups.com



                            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                            To unsubscribe from this group, send an email to:
                            Easy400Group-unsubscribe@yahoogroups.com



                            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                            To unsubscribe from this group, send an email to:
                            Easy400Group-unsubscribe@yahoogroups.com



                            Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
                          • Richard ECUYER
                            perhaps with : DLTOVR FILE(MYFILE) LVL(*JOB) Monmsg CPF0000 OVRDBF FILE(AAAA) TOFILE(AAAA) OVRSCOPE(*JOB) ... From: Enrico Amisano To:
                            Message 13 of 26 , Aug 5, 2003
                              perhaps with :
                               
                              DLTOVR FILE(MYFILE) LVL(*JOB)
                              Monmsg CPF0000
                              OVRDBF FILE(AAAA) TOFILE(AAAA) OVRSCOPE(*JOB)
                               
                               
                              ----- Original Message -----
                              Sent: Tuesday, August 05, 2003 3:23 PM
                              Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                               
                              Many thanks for your help.
                               
                              Now everything is correct.
                               
                              The latest problem:
                              my users are very sophisticated.
                               
                              If I put a 220 Cpi spool file on a html page, they accuse me that the spool file isn't well visible
                              in printing format and they have to scroll the page in the right side.....
                               
                              At the end I decide to revise all my programs.
                               
                              But how I can execute an Opnqryf in this case?
                               
                              WSTV10        require parameters (cgi Ile)
                              WSTV11        retreive input user (cgi ile)
                              WSTV11C     "normal" clp that execute an Opnqryf
                              WSTV11H    display results on Html (cgi ile)
                               
                              In WSTV11H I have defined the primary file used in Opnqryf, with break level.
                               
                              But it seems to select the entire file, not only the selected record in WSTV11C.
                               
                              I make Opnqryf since 10 years, the syntax is correct...
                               
                               
                              WSTV11:
                                                                                            
                              OVRDBF     FILE(AAGE200F) TOFILE(AAGE200F) SHARE(*YES)
                               
                              OPNQRYF    FILE((AAGE200F)) OPTION(*INP) QRYSLT('ATA02 +  
                                             *EQ " " *AND CODAG *EQ "' *CAT &CDAGEV +     
                                             *CAT '"') KEYFLD((CODAG))                    
                               
                              CALL WSTV11H
                               
                               
                              Anybody can help me ?
                               
                               
                               
                               
                               
                              -----Messaggio originale-----
                              Da: Richard ECUYER [mailto:recuyer@...]
                              Inviato: venerdì 1 agosto 2003 18.01
                              A: Easy400Group@yahoogroups.com
                              Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                              To display a spool here is what i use (fichier must be more than 210 for you)
                               
                              Dspspl_html.txt is my HTML canevas.
                              hope this help                    
                              ----- Original Message -----
                              Sent: Friday, August 01, 2003 5:47 PM
                              Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                              Another question:
                               
                              1) In html I tried to use <pre>  but there is a problem:
                              the records in the database file (QTEMP) are printed in the browser with an empty line between every two written lines.
                               
                              Example:
                              ROW1
                              empty line
                              ROW2
                              empty line   
                               
                              etc
                               
                              Why ?
                              In the database file generated from Cpysplf I have no empty record.........
                               
                              My Html is:
                               
                              /$header                                                               
                              <table width="100%" border=0 cellspacing="0" cellpadding="0" border="0">
                                                                                                     
                              /$tablerow                                                             
                              <tr>                                                                   
                              <td valign=top align=left bgcolor="#ffffff">                           
                              <font face="courier" size=2>                                           
                              <pre>                                                                  
                              <b> /%datiriga%/&nbsp;                                                 
                              </pre>                                                                 
                              </font>                                                                
                              </td>                                                                  
                              </tr>                                                                  
                                                                                                     
                              /$endtable                                                             
                              </table>
                               
                               
                                                                    
                              2) many of my spool file are of 220 Cpi......
                              what is the best method to view them in the browser avoiding to move on
                              the right side ?
                              Is there an Html function that allows to adapt the table in one page, or I have to
                              modify all my printer files ?
                               
                               
                               
                               
                              3) In Cpysplf command, I tried to use *PRTCTL parameter but what I have to do
                              in Rpg ?
                              Should I read the control characters to reproduce new page or to write bold char in Html form ?
                              How should I do it ?
                               
                               
                              Thank you very much in advance for your help.
                              Enrico Amisano
                               
                               
                               
                              -----Messaggio originale-----
                              Da: Richard ECUYER [mailto:recuyer@...]
                              Inviato: venerdì 1 agosto 2003 14.39
                              A: Easy400Group@yahoogroups.com
                              Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                              i don't know how you produce your spool, but if you produce it from a CL, you'll be able to make the cpysplf inside the same CL (after the spool is made)
                              Another thing, the user that run the cgi PGM is not QTMHTTP but QTMHHTP1.
                              Try to make an OVRPRTF with HOLD(*YES) and OUTQ(yourOUTQ)
                               
                              Hope this help.
                               
                              ----- Original Message -----
                              Sent: Friday, August 01, 2003 2:10 PM
                              Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                              Richard I decide to use your suggests but I have some problems:
                               
                              when I execute the CPYSPLF an error CPF3303 issue.
                               
                               CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                                            SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
                               
                              File STV1100P was not found in Job 271683/QTMHHTTP/PROD
                               
                               
                              In fact if I use wrkactjob no spool exists for jobs:
                                      PROD        QTMHHTTP    BCI     0,0                  TIMW    
                               
                              My spool file is finished on PRT01 with different attributes:
                              Job: QPRTJOB
                              User: Amisano (me)
                              Number: 271678/4
                               
                              Why ?
                               
                              Why the spool file is finished on PRT01 ?
                               
                               
                               
                               
                               
                               
                               
                              -----Messaggio originale-----
                              Da: Richard ECUYER [mailto:recuyer@...]
                              Inviato: giovedì 31 luglio 2003 16.17
                              A: Easy400Group@yahoogroups.com
                              Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                              when the spool is made, you can read each line and send them to the browser.
                              you have many ways to do that : with API or with a simple CPYSPLF in a work file.
                               
                                  in the CLP
                               
                                      opnqryf ...
                                      run your PGM
                                      CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                                      CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
                               
                                      then you have your spool in a file
                               
                              back to the CGI :
                               
                                  Open Qtemp/fichier
                                  Read fichier   
                                  dow not %eof
                               
                                  updhtmlvar ....
                                  .....
                               
                               
                               
                              ----- Original Message -----
                              Sent: Thursday, July 31, 2003 4:06 PM
                              Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                              I beg your pardon but I don't understand what does it mean:
                               
                              ...........and cach the spool to send it by mail browse it.
                               
                              because I need to output the form only in the browser....
                               
                              and
                               
                              what does it mean
                              "get back spool......" you say
                               
                              thanks
                               
                               
                              -----Messaggio originale-----
                              Da: Richard ECUYER [mailto:recuyer@...]
                              Inviato: giovedì 31 luglio 2003 15.31
                              A: Easy400Group@yahoogroups.com
                              Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                              Hi,
                              MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
                               
                              your Cgi interact with the browser.
                               
                              perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
                               
                                  1) send form
                                  2) read values
                                          Call CLP
                                          Get back spool ....
                                          Send the spool under table
                                  3) leave the Cgi
                               
                               
                              ----- Original Message -----
                              Sent: Thursday, July 31, 2003 3:13 PM
                              Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                              I prefer break level because in Sql I have a lot of problems to work if there are
                              many subtotals to do.
                               
                               
                              My case is this: (but there are much more complicated cases)
                               
                              a) in one form I request the user for a representative name or <all>
                               
                              what I have to do in this case ?
                               
                              - call a Cgi program that in this case is a CLP normal program.
                               
                              This program will execute:
                              1) Ovrdbf(xxxxx) share(*yes)
                              2) Opnqryf xxxxxxx
                              3) call MYCGIRPG
                              4) clof xxxxx
                              5) dltovr xxxxx
                               
                              6) In Ile MYCGIRPG I use this file as primary and use L1...L9
                               
                              it's correct this workflow ?
                               
                              Many thanks
                               
                               
                               
                               
                              -----Messaggio originale-----
                              Da: Stephen Corbett [mailto:corbett@...]
                              Inviato: giovedì 31 luglio 2003 14.14
                              A: Easy400Group@yahoogroups.com
                              Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                              As with many programming problems there are at least twice as many ways as
                              solving it as there are programmers working on it.

                              There is probably no reason why you couldn't call a CL program as the CGI
                              program.  Someone correct me if I'm wrong, but all a CGI program does is
                              read from standard input and writes to standard output.  So long as that
                              happens somewhere within your CGI program it probably doesn't matter when.
                              (After all, I'm sure there are several internal programs called before we
                              get control in any case.)

                              As to what is easier.  Possibly an ILE program to read the request
                              parameters from the browser calling a CL program that does an OPNQRYF, and
                              calls an RPG program to create the required output using level breaks.  Like
                              any tool, use the right one for the job.  Using level breaks can simplify
                              many traditional reporting requirements by using the RPG cycle, including
                              Level Breaks and Matching Record logic. (Remember that RPG does stand for
                              Report Program Generator.)  However, there are many people who don't know or
                              understand how the cycle works or the power it provides and avoid it like
                              the plauge.  I have had the "pleasure" on many occassions of debugging code
                              where the original programmer had not used the cycle and has coded level
                              breaking code manually.  Personally, I use the cycle for most simple
                              reporting .  For more unusual processing it is sometimes better to code it
                              manually.

                              One advantage of not using the cycle is that you can do your data selection
                              within the program using embedded SQL.  This gives you many options that
                              might not be available with OPNQRYF.

                              At the end of the day you have to produce a result that satisfies your
                              requirements and is robust and easily maintained in the future.

                              Steve
                              ----- Original Message -----
                              From: "eamisano" <eamisano@...>
                              To: <Easy400Group@yahoogroups.com>
                              Sent: Thursday, July 31, 2003 9:08 PM
                              Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
                              programs


                              > Hi to all
                              >
                              > I have to write some vendor reports statistics using Cgi programs.
                              >
                              > Now these reports are traditionally batch programs and results are
                              > only printed.
                              >
                              > These reports are complicated because they have differents subtotals
                              > and in this case it's easy (in non Cgi programs...)
                              > 1) use Opnqryf to order data
                              > 2) use control level indicator in Rpg to sum and print subtotals.
                              >
                              > Can I use the same technology in Cgi programs ?
                              >
                              > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
                              > and Ovrdbf share(*yes) width DOCMD ?
                              >
                              > Does anybody use Opnqryf to order data and level indicator ?
                              >
                              > Thanks to all
                              >
                              >
                              >
                              >
                              >
                              > To unsubscribe from this group, send an email to:
                              > Easy400Group-unsubscribe@yahoogroups.com
                              >
                              >
                              >
                              > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                              >
                              >



                              To unsubscribe from this group, send an email to:
                              Easy400Group-unsubscribe@yahoogroups.com



                              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                              To unsubscribe from this group, send an email to:
                              Easy400Group-unsubscribe@yahoogroups.com



                              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                              To unsubscribe from this group, send an email to:
                              Easy400Group-unsubscribe@yahoogroups.com



                              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                              To unsubscribe from this group, send an email to:
                              Easy400Group-unsubscribe@yahoogroups.com



                              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                              To unsubscribe from this group, send an email to:
                              Easy400Group-unsubscribe@yahoogroups.com



                              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                              To unsubscribe from this group, send an email to:
                              Easy400Group-unsubscribe@yahoogroups.com



                              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                              To unsubscribe from this group, send an email to:
                              Easy400Group-unsubscribe@yahoogroups.com



                              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                              To unsubscribe from this group, send an email to:
                              Easy400Group-unsubscribe@yahoogroups.com



                              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                              To unsubscribe from this group, send an email to:
                              Easy400Group-unsubscribe@yahoogroups.com



                              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                              To unsubscribe from this group, send an email to:
                              Easy400Group-unsubscribe@yahoogroups.com



                              Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
                            • Enrico Amisano
                              I tried but it doesn t function after the Opnqryf I make a Cpyfrmqryf. The record selected from Opnqryf is correct but Cgi program WSTV11H select entire file
                              Message 14 of 26 , Aug 5, 2003
                                I tried but it doesn't function
                                 
                                after the Opnqryf I make a Cpyfrmqryf.
                                The record selected from Opnqryf is correct but Cgi program WSTV11H select entire file !!!
                                 
                                hallo
                                 
                                 
                                 
                                -----Messaggio originale-----
                                Da: Richard ECUYER [mailto:recuyer@...]
                                Inviato: martedì 5 agosto 2003 15.36
                                A: Easy400Group@yahoogroups.com
                                Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                perhaps with :
                                 
                                DLTOVR FILE(MYFILE) LVL(*JOB)
                                Monmsg CPF0000
                                OVRDBF FILE(AAAA) TOFILE(AAAA) OVRSCOPE(*JOB)
                                 
                                 
                                ----- Original Message -----
                                Sent: Tuesday, August 05, 2003 3:23 PM
                                Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                 
                                Many thanks for your help.
                                 
                                Now everything is correct.
                                 
                                The latest problem:
                                my users are very sophisticated.
                                 
                                If I put a 220 Cpi spool file on a html page, they accuse me that the spool file isn't well visible
                                in printing format and they have to scroll the page in the right side.....
                                 
                                At the end I decide to revise all my programs.
                                 
                                But how I can execute an Opnqryf in this case?
                                 
                                WSTV10        require parameters (cgi Ile)
                                WSTV11        retreive input user (cgi ile)
                                WSTV11C     "normal" clp that execute an Opnqryf
                                WSTV11H    display results on Html (cgi ile)
                                 
                                In WSTV11H I have defined the primary file used in Opnqryf, with break level.
                                 
                                But it seems to select the entire file, not only the selected record in WSTV11C.
                                 
                                I make Opnqryf since 10 years, the syntax is correct...
                                 
                                 
                                WSTV11:
                                                                                              
                                OVRDBF     FILE(AAGE200F) TOFILE(AAGE200F) SHARE(*YES)
                                 
                                OPNQRYF    FILE((AAGE200F)) OPTION(*INP) QRYSLT('ATA02 +  
                                               *EQ " " *AND CODAG *EQ "' *CAT &CDAGEV +     
                                               *CAT '"') KEYFLD((CODAG))                    
                                 
                                CALL WSTV11H
                                 
                                 
                                Anybody can help me ?
                                 
                                 
                                 
                                 
                                 
                                -----Messaggio originale-----
                                Da: Richard ECUYER [mailto:recuyer@...]
                                Inviato: venerdì 1 agosto 2003 18.01
                                A: Easy400Group@yahoogroups.com
                                Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                To display a spool here is what i use (fichier must be more than 210 for you)
                                 
                                Dspspl_html.txt is my HTML canevas.
                                hope this help                    
                                ----- Original Message -----
                                Sent: Friday, August 01, 2003 5:47 PM
                                Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                Another question:
                                 
                                1) In html I tried to use <pre>  but there is a problem:
                                the records in the database file (QTEMP) are printed in the browser with an empty line between every two written lines.
                                 
                                Example:
                                ROW1
                                empty line
                                ROW2
                                empty line   
                                 
                                etc
                                 
                                Why ?
                                In the database file generated from Cpysplf I have no empty record.........
                                 
                                My Html is:
                                 
                                /$header                                                               
                                <table width="100%" border=0 cellspacing="0" cellpadding="0" border="0">
                                                                                                       
                                /$tablerow                                                             
                                <tr>                                                                   
                                <td valign=top align=left bgcolor="#ffffff">                           
                                <font face="courier" size=2>                                           
                                <pre>                                                                  
                                <b> /%datiriga%/&nbsp;                                                 
                                </pre>                                                                 
                                </font>                                                                
                                </td>                                                                  
                                </tr>                                                                  
                                                                                                       
                                /$endtable                                                             
                                </table>
                                 
                                 
                                                                      
                                2) many of my spool file are of 220 Cpi......
                                what is the best method to view them in the browser avoiding to move on
                                the right side ?
                                Is there an Html function that allows to adapt the table in one page, or I have to
                                modify all my printer files ?
                                 
                                 
                                 
                                 
                                3) In Cpysplf command, I tried to use *PRTCTL parameter but what I have to do
                                in Rpg ?
                                Should I read the control characters to reproduce new page or to write bold char in Html form ?
                                How should I do it ?
                                 
                                 
                                Thank you very much in advance for your help.
                                Enrico Amisano
                                 
                                 
                                 
                                -----Messaggio originale-----
                                Da: Richard ECUYER [mailto:recuyer@...]
                                Inviato: venerdì 1 agosto 2003 14.39
                                A: Easy400Group@yahoogroups.com
                                Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                i don't know how you produce your spool, but if you produce it from a CL, you'll be able to make the cpysplf inside the same CL (after the spool is made)
                                Another thing, the user that run the cgi PGM is not QTMHTTP but QTMHHTP1.
                                Try to make an OVRPRTF with HOLD(*YES) and OUTQ(yourOUTQ)
                                 
                                Hope this help.
                                 
                                ----- Original Message -----
                                Sent: Friday, August 01, 2003 2:10 PM
                                Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                Richard I decide to use your suggests but I have some problems:
                                 
                                when I execute the CPYSPLF an error CPF3303 issue.
                                 
                                 CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                                              SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
                                 
                                File STV1100P was not found in Job 271683/QTMHHTTP/PROD
                                 
                                 
                                In fact if I use wrkactjob no spool exists for jobs:
                                        PROD        QTMHHTTP    BCI     0,0                  TIMW    
                                 
                                My spool file is finished on PRT01 with different attributes:
                                Job: QPRTJOB
                                User: Amisano (me)
                                Number: 271678/4
                                 
                                Why ?
                                 
                                Why the spool file is finished on PRT01 ?
                                 
                                 
                                 
                                 
                                 
                                 
                                 
                                -----Messaggio originale-----
                                Da: Richard ECUYER [mailto:recuyer@...]
                                Inviato: giovedì 31 luglio 2003 16.17
                                A: Easy400Group@yahoogroups.com
                                Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                when the spool is made, you can read each line and send them to the browser.
                                you have many ways to do that : with API or with a simple CPYSPLF in a work file.
                                 
                                    in the CLP
                                 
                                        opnqryf ...
                                        run your PGM
                                        CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                                        CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
                                 
                                        then you have your spool in a file
                                 
                                back to the CGI :
                                 
                                    Open Qtemp/fichier
                                    Read fichier   
                                    dow not %eof
                                 
                                    updhtmlvar ....
                                    .....
                                 
                                 
                                 
                                ----- Original Message -----
                                Sent: Thursday, July 31, 2003 4:06 PM
                                Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                I beg your pardon but I don't understand what does it mean:
                                 
                                ...........and cach the spool to send it by mail browse it.
                                 
                                because I need to output the form only in the browser....
                                 
                                and
                                 
                                what does it mean
                                "get back spool......" you say
                                 
                                thanks
                                 
                                 
                                -----Messaggio originale-----
                                Da: Richard ECUYER [mailto:recuyer@...]
                                Inviato: giovedì 31 luglio 2003 15.31
                                A: Easy400Group@yahoogroups.com
                                Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                Hi,
                                MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
                                 
                                your Cgi interact with the browser.
                                 
                                perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
                                 
                                    1) send form
                                    2) read values
                                            Call CLP
                                            Get back spool ....
                                            Send the spool under table
                                    3) leave the Cgi
                                 
                                 
                                ----- Original Message -----
                                Sent: Thursday, July 31, 2003 3:13 PM
                                Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                I prefer break level because in Sql I have a lot of problems to work if there are
                                many subtotals to do.
                                 
                                 
                                My case is this: (but there are much more complicated cases)
                                 
                                a) in one form I request the user for a representative name or <all>
                                 
                                what I have to do in this case ?
                                 
                                - call a Cgi program that in this case is a CLP normal program.
                                 
                                This program will execute:
                                1) Ovrdbf(xxxxx) share(*yes)
                                2) Opnqryf xxxxxxx
                                3) call MYCGIRPG
                                4) clof xxxxx
                                5) dltovr xxxxx
                                 
                                6) In Ile MYCGIRPG I use this file as primary and use L1...L9
                                 
                                it's correct this workflow ?
                                 
                                Many thanks
                                 
                                 
                                 
                                 
                                -----Messaggio originale-----
                                Da: Stephen Corbett [mailto:corbett@...]
                                Inviato: giovedì 31 luglio 2003 14.14
                                A: Easy400Group@yahoogroups.com
                                Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                As with many programming problems there are at least twice as many ways as
                                solving it as there are programmers working on it.

                                There is probably no reason why you couldn't call a CL program as the CGI
                                program.  Someone correct me if I'm wrong, but all a CGI program does is
                                read from standard input and writes to standard output.  So long as that
                                happens somewhere within your CGI program it probably doesn't matter when.
                                (After all, I'm sure there are several internal programs called before we
                                get control in any case.)

                                As to what is easier.  Possibly an ILE program to read the request
                                parameters from the browser calling a CL program that does an OPNQRYF, and
                                calls an RPG program to create the required output using level breaks.  Like
                                any tool, use the right one for the job.  Using level breaks can simplify
                                many traditional reporting requirements by using the RPG cycle, including
                                Level Breaks and Matching Record logic. (Remember that RPG does stand for
                                Report Program Generator.)  However, there are many people who don't know or
                                understand how the cycle works or the power it provides and avoid it like
                                the plauge.  I have had the "pleasure" on many occassions of debugging code
                                where the original programmer had not used the cycle and has coded level
                                breaking code manually.  Personally, I use the cycle for most simple
                                reporting .  For more unusual processing it is sometimes better to code it
                                manually.

                                One advantage of not using the cycle is that you can do your data selection
                                within the program using embedded SQL.  This gives you many options that
                                might not be available with OPNQRYF.

                                At the end of the day you have to produce a result that satisfies your
                                requirements and is robust and easily maintained in the future.

                                Steve
                                ----- Original Message -----
                                From: "eamisano" <eamisano@...>
                                To: <Easy400Group@yahoogroups.com>
                                Sent: Thursday, July 31, 2003 9:08 PM
                                Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
                                programs


                                > Hi to all
                                >
                                > I have to write some vendor reports statistics using Cgi programs.
                                >
                                > Now these reports are traditionally batch programs and results are
                                > only printed.
                                >
                                > These reports are complicated because they have differents subtotals
                                > and in this case it's easy (in non Cgi programs...)
                                > 1) use Opnqryf to order data
                                > 2) use control level indicator in Rpg to sum and print subtotals.
                                >
                                > Can I use the same technology in Cgi programs ?
                                >
                                > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
                                > and Ovrdbf share(*yes) width DOCMD ?
                                >
                                > Does anybody use Opnqryf to order data and level indicator ?
                                >
                                > Thanks to all
                                >
                                >
                                >
                                >
                                >
                                > To unsubscribe from this group, send an email to:
                                > Easy400Group-unsubscribe@yahoogroups.com
                                >
                                >
                                >
                                > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                                >
                                >



                                To unsubscribe from this group, send an email to:
                                Easy400Group-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                To unsubscribe from this group, send an email to:
                                Easy400Group-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                To unsubscribe from this group, send an email to:
                                Easy400Group-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                To unsubscribe from this group, send an email to:
                                Easy400Group-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                To unsubscribe from this group, send an email to:
                                Easy400Group-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                To unsubscribe from this group, send an email to:
                                Easy400Group-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                To unsubscribe from this group, send an email to:
                                Easy400Group-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                To unsubscribe from this group, send an email to:
                                Easy400Group-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                To unsubscribe from this group, send an email to:
                                Easy400Group-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                To unsubscribe from this group, send an email to:
                                Easy400Group-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                To unsubscribe from this group, send an email to:
                                Easy400Group-unsubscribe@yahoogroups.com



                                Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
                              • Richard ECUYER
                                can you send a piece of the source ? (both CL and RPG) ... From: Enrico Amisano To: Easy400Group@yahoogroups.com Sent: Tuesday, August 05, 2003 4:03 PM
                                Message 15 of 26 , Aug 5, 2003
                                  can you send a piece of the source ? (both CL and RPG)
                                  ----- Original Message -----
                                  Sent: Tuesday, August 05, 2003 4:03 PM
                                  Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                  I tried but it doesn't function
                                   
                                  after the Opnqryf I make a Cpyfrmqryf.
                                  The record selected from Opnqryf is correct but Cgi program WSTV11H select entire file !!!
                                   
                                  hallo
                                   
                                   
                                   
                                  -----Messaggio originale-----
                                  Da: Richard ECUYER [mailto:recuyer@...]
                                  Inviato: martedì 5 agosto 2003 15.36
                                  A: Easy400Group@yahoogroups.com
                                  Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                  perhaps with :
                                   
                                  DLTOVR FILE(MYFILE) LVL(*JOB)
                                  Monmsg CPF0000
                                  OVRDBF FILE(AAAA) TOFILE(AAAA) OVRSCOPE(*JOB)
                                   
                                   
                                  ----- Original Message -----
                                  Sent: Tuesday, August 05, 2003 3:23 PM
                                  Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                   
                                  Many thanks for your help.
                                   
                                  Now everything is correct.
                                   
                                  The latest problem:
                                  my users are very sophisticated.
                                   
                                  If I put a 220 Cpi spool file on a html page, they accuse me that the spool file isn't well visible
                                  in printing format and they have to scroll the page in the right side.....
                                   
                                  At the end I decide to revise all my programs.
                                   
                                  But how I can execute an Opnqryf in this case?
                                   
                                  WSTV10        require parameters (cgi Ile)
                                  WSTV11        retreive input user (cgi ile)
                                  WSTV11C     "normal" clp that execute an Opnqryf
                                  WSTV11H    display results on Html (cgi ile)
                                   
                                  In WSTV11H I have defined the primary file used in Opnqryf, with break level.
                                   
                                  But it seems to select the entire file, not only the selected record in WSTV11C.
                                   
                                  I make Opnqryf since 10 years, the syntax is correct...
                                   
                                   
                                  WSTV11:
                                                                                                
                                  OVRDBF     FILE(AAGE200F) TOFILE(AAGE200F) SHARE(*YES)
                                   
                                  OPNQRYF    FILE((AAGE200F)) OPTION(*INP) QRYSLT('ATA02 +  
                                                 *EQ " " *AND CODAG *EQ "' *CAT &CDAGEV +     
                                                 *CAT '"') KEYFLD((CODAG))                    
                                   
                                  CALL WSTV11H
                                   
                                   
                                  Anybody can help me ?
                                   
                                   
                                   
                                   
                                   
                                  -----Messaggio originale-----
                                  Da: Richard ECUYER [mailto:recuyer@...]
                                  Inviato: venerdì 1 agosto 2003 18.01
                                  A: Easy400Group@yahoogroups.com
                                  Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                  To display a spool here is what i use (fichier must be more than 210 for you)
                                   
                                  Dspspl_html.txt is my HTML canevas.
                                  hope this help                    
                                  ----- Original Message -----
                                  Sent: Friday, August 01, 2003 5:47 PM
                                  Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                  Another question:
                                   
                                  1) In html I tried to use <pre>  but there is a problem:
                                  the records in the database file (QTEMP) are printed in the browser with an empty line between every two written lines.
                                   
                                  Example:
                                  ROW1
                                  empty line
                                  ROW2
                                  empty line   
                                   
                                  etc
                                   
                                  Why ?
                                  In the database file generated from Cpysplf I have no empty record.........
                                   
                                  My Html is:
                                   
                                  /$header                                                               
                                  <table width="100%" border=0 cellspacing="0" cellpadding="0" border="0">
                                                                                                         
                                  /$tablerow                                                             
                                  <tr>                                                                   
                                  <td valign=top align=left bgcolor="#ffffff">                           
                                  <font face="courier" size=2>                                           
                                  <pre>                                                                  
                                  <b> /%datiriga%/&nbsp;                                                 
                                  </pre>                                                                 
                                  </font>                                                                
                                  </td>                                                                  
                                  </tr>                                                                  
                                                                                                         
                                  /$endtable                                                             
                                  </table>
                                   
                                   
                                                                        
                                  2) many of my spool file are of 220 Cpi......
                                  what is the best method to view them in the browser avoiding to move on
                                  the right side ?
                                  Is there an Html function that allows to adapt the table in one page, or I have to
                                  modify all my printer files ?
                                   
                                   
                                   
                                   
                                  3) In Cpysplf command, I tried to use *PRTCTL parameter but what I have to do
                                  in Rpg ?
                                  Should I read the control characters to reproduce new page or to write bold char in Html form ?
                                  How should I do it ?
                                   
                                   
                                  Thank you very much in advance for your help.
                                  Enrico Amisano
                                   
                                   
                                   
                                  -----Messaggio originale-----
                                  Da: Richard ECUYER [mailto:recuyer@...]
                                  Inviato: venerdì 1 agosto 2003 14.39
                                  A: Easy400Group@yahoogroups.com
                                  Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                  i don't know how you produce your spool, but if you produce it from a CL, you'll be able to make the cpysplf inside the same CL (after the spool is made)
                                  Another thing, the user that run the cgi PGM is not QTMHTTP but QTMHHTP1.
                                  Try to make an OVRPRTF with HOLD(*YES) and OUTQ(yourOUTQ)
                                   
                                  Hope this help.
                                   
                                  ----- Original Message -----
                                  Sent: Friday, August 01, 2003 2:10 PM
                                  Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                  Richard I decide to use your suggests but I have some problems:
                                   
                                  when I execute the CPYSPLF an error CPF3303 issue.
                                   
                                   CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                                                SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
                                   
                                  File STV1100P was not found in Job 271683/QTMHHTTP/PROD
                                   
                                   
                                  In fact if I use wrkactjob no spool exists for jobs:
                                          PROD        QTMHHTTP    BCI     0,0                  TIMW    
                                   
                                  My spool file is finished on PRT01 with different attributes:
                                  Job: QPRTJOB
                                  User: Amisano (me)
                                  Number: 271678/4
                                   
                                  Why ?
                                   
                                  Why the spool file is finished on PRT01 ?
                                   
                                   
                                   
                                   
                                   
                                   
                                   
                                  -----Messaggio originale-----
                                  Da: Richard ECUYER [mailto:recuyer@...]
                                  Inviato: giovedì 31 luglio 2003 16.17
                                  A: Easy400Group@yahoogroups.com
                                  Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                  when the spool is made, you can read each line and send them to the browser.
                                  you have many ways to do that : with API or with a simple CPYSPLF in a work file.
                                   
                                      in the CLP
                                   
                                          opnqryf ...
                                          run your PGM
                                          CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                                          CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
                                   
                                          then you have your spool in a file
                                   
                                  back to the CGI :
                                   
                                      Open Qtemp/fichier
                                      Read fichier   
                                      dow not %eof
                                   
                                      updhtmlvar ....
                                      .....
                                   
                                   
                                   
                                  ----- Original Message -----
                                  Sent: Thursday, July 31, 2003 4:06 PM
                                  Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                  I beg your pardon but I don't understand what does it mean:
                                   
                                  ...........and cach the spool to send it by mail browse it.
                                   
                                  because I need to output the form only in the browser....
                                   
                                  and
                                   
                                  what does it mean
                                  "get back spool......" you say
                                   
                                  thanks
                                   
                                   
                                  -----Messaggio originale-----
                                  Da: Richard ECUYER [mailto:recuyer@...]
                                  Inviato: giovedì 31 luglio 2003 15.31
                                  A: Easy400Group@yahoogroups.com
                                  Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                  Hi,
                                  MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
                                   
                                  your Cgi interact with the browser.
                                   
                                  perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
                                   
                                      1) send form
                                      2) read values
                                              Call CLP
                                              Get back spool ....
                                              Send the spool under table
                                      3) leave the Cgi
                                   
                                   
                                  ----- Original Message -----
                                  Sent: Thursday, July 31, 2003 3:13 PM
                                  Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                  I prefer break level because in Sql I have a lot of problems to work if there are
                                  many subtotals to do.
                                   
                                   
                                  My case is this: (but there are much more complicated cases)
                                   
                                  a) in one form I request the user for a representative name or <all>
                                   
                                  what I have to do in this case ?
                                   
                                  - call a Cgi program that in this case is a CLP normal program.
                                   
                                  This program will execute:
                                  1) Ovrdbf(xxxxx) share(*yes)
                                  2) Opnqryf xxxxxxx
                                  3) call MYCGIRPG
                                  4) clof xxxxx
                                  5) dltovr xxxxx
                                   
                                  6) In Ile MYCGIRPG I use this file as primary and use L1...L9
                                   
                                  it's correct this workflow ?
                                   
                                  Many thanks
                                   
                                   
                                   
                                   
                                  -----Messaggio originale-----
                                  Da: Stephen Corbett [mailto:corbett@...]
                                  Inviato: giovedì 31 luglio 2003 14.14
                                  A: Easy400Group@yahoogroups.com
                                  Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                  As with many programming problems there are at least twice as many ways as
                                  solving it as there are programmers working on it.

                                  There is probably no reason why you couldn't call a CL program as the CGI
                                  program.  Someone correct me if I'm wrong, but all a CGI program does is
                                  read from standard input and writes to standard output.  So long as that
                                  happens somewhere within your CGI program it probably doesn't matter when.
                                  (After all, I'm sure there are several internal programs called before we
                                  get control in any case.)

                                  As to what is easier.  Possibly an ILE program to read the request
                                  parameters from the browser calling a CL program that does an OPNQRYF, and
                                  calls an RPG program to create the required output using level breaks.  Like
                                  any tool, use the right one for the job.  Using level breaks can simplify
                                  many traditional reporting requirements by using the RPG cycle, including
                                  Level Breaks and Matching Record logic. (Remember that RPG does stand for
                                  Report Program Generator.)  However, there are many people who don't know or
                                  understand how the cycle works or the power it provides and avoid it like
                                  the plauge.  I have had the "pleasure" on many occassions of debugging code
                                  where the original programmer had not used the cycle and has coded level
                                  breaking code manually.  Personally, I use the cycle for most simple
                                  reporting .  For more unusual processing it is sometimes better to code it
                                  manually.

                                  One advantage of not using the cycle is that you can do your data selection
                                  within the program using embedded SQL.  This gives you many options that
                                  might not be available with OPNQRYF.

                                  At the end of the day you have to produce a result that satisfies your
                                  requirements and is robust and easily maintained in the future.

                                  Steve
                                  ----- Original Message -----
                                  From: "eamisano" <eamisano@...>
                                  To: <Easy400Group@yahoogroups.com>
                                  Sent: Thursday, July 31, 2003 9:08 PM
                                  Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
                                  programs


                                  > Hi to all
                                  >
                                  > I have to write some vendor reports statistics using Cgi programs.
                                  >
                                  > Now these reports are traditionally batch programs and results are
                                  > only printed.
                                  >
                                  > These reports are complicated because they have differents subtotals
                                  > and in this case it's easy (in non Cgi programs...)
                                  > 1) use Opnqryf to order data
                                  > 2) use control level indicator in Rpg to sum and print subtotals.
                                  >
                                  > Can I use the same technology in Cgi programs ?
                                  >
                                  > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
                                  > and Ovrdbf share(*yes) width DOCMD ?
                                  >
                                  > Does anybody use Opnqryf to order data and level indicator ?
                                  >
                                  > Thanks to all
                                  >
                                  >
                                  >
                                  >
                                  >
                                  > To unsubscribe from this group, send an email to:
                                  > Easy400Group-unsubscribe@yahoogroups.com
                                  >
                                  >
                                  >
                                  > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                                  >
                                  >



                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                  To unsubscribe from this group, send an email to:
                                  Easy400Group-unsubscribe@yahoogroups.com



                                  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
                                • Scott Mildenberger
                                  It most likely is because of the activation gourp that the CL and RPG are running in and the level of the override (default is to activation group). Scott
                                  Message 16 of 26 , Aug 5, 2003
                                    It most likely is because of the activation gourp that the CL
                                    and RPG are running in and the level of the override (default is
                                    to activation group).

                                    Scott Mildenberger

                                    --- Enrico Amisano <eamisano@...> wrote:
                                    > I tried but it doesn't function
                                    >
                                    > after the Opnqryf I make a Cpyfrmqryf.
                                    > The record selected from Opnqryf is correct but Cgi program
                                    > WSTV11H select
                                    > entire file !!!
                                    >



                                    __________________________________
                                    Do you Yahoo!?
                                    Yahoo! SiteBuilder - Free, easy-to-use web site design software
                                    http://sitebuilder.yahoo.com
                                  • Enrico Amisano
                                    I beg your pardon Richard, the OVRDBF OVRSCOPE(*JOB) IS CORRECT In this moment I m very confused, I m thinking to my holidays. ... Da: Enrico Amisano
                                    Message 17 of 26 , Aug 5, 2003
                                      I beg your pardon Richard, the OVRDBF OVRSCOPE(*JOB) IS CORRECT
                                       
                                      In this moment I'm very confused, I'm thinking to my holidays.
                                       
                                       
                                       
                                      -----Messaggio originale-----
                                      Da: Enrico Amisano [mailto:eamisano@...]
                                      Inviato: martedì 5 agosto 2003 16.04
                                      A: Easy400Group@yahoogroups.com
                                      Oggetto: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                      I tried but it doesn't function
                                       
                                      after the Opnqryf I make a Cpyfrmqryf.
                                      The record selected from Opnqryf is correct but Cgi program WSTV11H select entire file !!!
                                       
                                      hallo
                                       
                                       
                                       
                                      -----Messaggio originale-----
                                      Da: Richard ECUYER [mailto:recuyer@...]
                                      Inviato: martedì 5 agosto 2003 15.36
                                      A: Easy400Group@yahoogroups.com
                                      Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                      perhaps with :
                                       
                                      DLTOVR FILE(MYFILE) LVL(*JOB)
                                      Monmsg CPF0000
                                      OVRDBF FILE(AAAA) TOFILE(AAAA) OVRSCOPE(*JOB)
                                       
                                       
                                      ----- Original Message -----
                                      Sent: Tuesday, August 05, 2003 3:23 PM
                                      Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                       
                                      Many thanks for your help.
                                       
                                      Now everything is correct.
                                       
                                      The latest problem:
                                      my users are very sophisticated.
                                       
                                      If I put a 220 Cpi spool file on a html page, they accuse me that the spool file isn't well visible
                                      in printing format and they have to scroll the page in the right side.....
                                       
                                      At the end I decide to revise all my programs.
                                       
                                      But how I can execute an Opnqryf in this case?
                                       
                                      WSTV10        require parameters (cgi Ile)
                                      WSTV11        retreive input user (cgi ile)
                                      WSTV11C     "normal" clp that execute an Opnqryf
                                      WSTV11H    display results on Html (cgi ile)
                                       
                                      In WSTV11H I have defined the primary file used in Opnqryf, with break level.
                                       
                                      But it seems to select the entire file, not only the selected record in WSTV11C.
                                       
                                      I make Opnqryf since 10 years, the syntax is correct...
                                       
                                       
                                      WSTV11:
                                                                                                    
                                      OVRDBF     FILE(AAGE200F) TOFILE(AAGE200F) SHARE(*YES)
                                       
                                      OPNQRYF    FILE((AAGE200F)) OPTION(*INP) QRYSLT('ATA02 +  
                                                     *EQ " " *AND CODAG *EQ "' *CAT &CDAGEV +     
                                                     *CAT '"') KEYFLD((CODAG))                    
                                       
                                      CALL WSTV11H
                                       
                                       
                                      Anybody can help me ?
                                       
                                       
                                       
                                       
                                       
                                      -----Messaggio originale-----
                                      Da: Richard ECUYER [mailto:recuyer@...]
                                      Inviato: venerdì 1 agosto 2003 18.01
                                      A: Easy400Group@yahoogroups.com
                                      Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                      To display a spool here is what i use (fichier must be more than 210 for you)
                                       
                                      Dspspl_html.txt is my HTML canevas.
                                      hope this help                    
                                      ----- Original Message -----
                                      Sent: Friday, August 01, 2003 5:47 PM
                                      Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                      Another question:
                                       
                                      1) In html I tried to use <pre>  but there is a problem:
                                      the records in the database file (QTEMP) are printed in the browser with an empty line between every two written lines.
                                       
                                      Example:
                                      ROW1
                                      empty line
                                      ROW2
                                      empty line   
                                       
                                      etc
                                       
                                      Why ?
                                      In the database file generated from Cpysplf I have no empty record.........
                                       
                                      My Html is:
                                       
                                      /$header                                                               
                                      <table width="100%" border=0 cellspacing="0" cellpadding="0" border="0">
                                                                                                             
                                      /$tablerow                                                             
                                      <tr>                                                                   
                                      <td valign=top align=left bgcolor="#ffffff">                           
                                      <font face="courier" size=2>                                           
                                      <pre>                                                                  
                                      <b> /%datiriga%/&nbsp;                                                 
                                      </pre>                                                                 
                                      </font>                                                                
                                      </td>                                                                  
                                      </tr>                                                                  
                                                                                                             
                                      /$endtable                                                             
                                      </table>
                                       
                                       
                                                                            
                                      2) many of my spool file are of 220 Cpi......
                                      what is the best method to view them in the browser avoiding to move on
                                      the right side ?
                                      Is there an Html function that allows to adapt the table in one page, or I have to
                                      modify all my printer files ?
                                       
                                       
                                       
                                       
                                      3) In Cpysplf command, I tried to use *PRTCTL parameter but what I have to do
                                      in Rpg ?
                                      Should I read the control characters to reproduce new page or to write bold char in Html form ?
                                      How should I do it ?
                                       
                                       
                                      Thank you very much in advance for your help.
                                      Enrico Amisano
                                       
                                       
                                       
                                      -----Messaggio originale-----
                                      Da: Richard ECUYER [mailto:recuyer@...]
                                      Inviato: venerdì 1 agosto 2003 14.39
                                      A: Easy400Group@yahoogroups.com
                                      Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                      i don't know how you produce your spool, but if you produce it from a CL, you'll be able to make the cpysplf inside the same CL (after the spool is made)
                                      Another thing, the user that run the cgi PGM is not QTMHTTP but QTMHHTP1.
                                      Try to make an OVRPRTF with HOLD(*YES) and OUTQ(yourOUTQ)
                                       
                                      Hope this help.
                                       
                                      ----- Original Message -----
                                      Sent: Friday, August 01, 2003 2:10 PM
                                      Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                      Richard I decide to use your suggests but I have some problems:
                                       
                                      when I execute the CPYSPLF an error CPF3303 issue.
                                       
                                       CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                                                    SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
                                       
                                      File STV1100P was not found in Job 271683/QTMHHTTP/PROD
                                       
                                       
                                      In fact if I use wrkactjob no spool exists for jobs:
                                              PROD        QTMHHTTP    BCI     0,0                  TIMW    
                                       
                                      My spool file is finished on PRT01 with different attributes:
                                      Job: QPRTJOB
                                      User: Amisano (me)
                                      Number: 271678/4
                                       
                                      Why ?
                                       
                                      Why the spool file is finished on PRT01 ?
                                       
                                       
                                       
                                       
                                       
                                       
                                       
                                      -----Messaggio originale-----
                                      Da: Richard ECUYER [mailto:recuyer@...]
                                      Inviato: giovedì 31 luglio 2003 16.17
                                      A: Easy400Group@yahoogroups.com
                                      Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                      when the spool is made, you can read each line and send them to the browser.
                                      you have many ways to do that : with API or with a simple CPYSPLF in a work file.
                                       
                                          in the CLP
                                       
                                              opnqryf ...
                                              run your PGM
                                              CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                                              CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
                                       
                                              then you have your spool in a file
                                       
                                      back to the CGI :
                                       
                                          Open Qtemp/fichier
                                          Read fichier   
                                          dow not %eof
                                       
                                          updhtmlvar ....
                                          .....
                                       
                                       
                                       
                                      ----- Original Message -----
                                      Sent: Thursday, July 31, 2003 4:06 PM
                                      Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                      I beg your pardon but I don't understand what does it mean:
                                       
                                      ...........and cach the spool to send it by mail browse it.
                                       
                                      because I need to output the form only in the browser....
                                       
                                      and
                                       
                                      what does it mean
                                      "get back spool......" you say
                                       
                                      thanks
                                       
                                       
                                      -----Messaggio originale-----
                                      Da: Richard ECUYER [mailto:recuyer@...]
                                      Inviato: giovedì 31 luglio 2003 15.31
                                      A: Easy400Group@yahoogroups.com
                                      Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                      Hi,
                                      MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
                                       
                                      your Cgi interact with the browser.
                                       
                                      perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
                                       
                                          1) send form
                                          2) read values
                                                  Call CLP
                                                  Get back spool ....
                                                  Send the spool under table
                                          3) leave the Cgi
                                       
                                       
                                      ----- Original Message -----
                                      Sent: Thursday, July 31, 2003 3:13 PM
                                      Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                      I prefer break level because in Sql I have a lot of problems to work if there are
                                      many subtotals to do.
                                       
                                       
                                      My case is this: (but there are much more complicated cases)
                                       
                                      a) in one form I request the user for a representative name or <all>
                                       
                                      what I have to do in this case ?
                                       
                                      - call a Cgi program that in this case is a CLP normal program.
                                       
                                      This program will execute:
                                      1) Ovrdbf(xxxxx) share(*yes)
                                      2) Opnqryf xxxxxxx
                                      3) call MYCGIRPG
                                      4) clof xxxxx
                                      5) dltovr xxxxx
                                       
                                      6) In Ile MYCGIRPG I use this file as primary and use L1...L9
                                       
                                      it's correct this workflow ?
                                       
                                      Many thanks
                                       
                                       
                                       
                                       
                                      -----Messaggio originale-----
                                      Da: Stephen Corbett [mailto:corbett@...]
                                      Inviato: giovedì 31 luglio 2003 14.14
                                      A: Easy400Group@yahoogroups.com
                                      Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                      As with many programming problems there are at least twice as many ways as
                                      solving it as there are programmers working on it.

                                      There is probably no reason why you couldn't call a CL program as the CGI
                                      program.  Someone correct me if I'm wrong, but all a CGI program does is
                                      read from standard input and writes to standard output.  So long as that
                                      happens somewhere within your CGI program it probably doesn't matter when.
                                      (After all, I'm sure there are several internal programs called before we
                                      get control in any case.)

                                      As to what is easier.  Possibly an ILE program to read the request
                                      parameters from the browser calling a CL program that does an OPNQRYF, and
                                      calls an RPG program to create the required output using level breaks.  Like
                                      any tool, use the right one for the job.  Using level breaks can simplify
                                      many traditional reporting requirements by using the RPG cycle, including
                                      Level Breaks and Matching Record logic. (Remember that RPG does stand for
                                      Report Program Generator.)  However, there are many people who don't know or
                                      understand how the cycle works or the power it provides and avoid it like
                                      the plauge.  I have had the "pleasure" on many occassions of debugging code
                                      where the original programmer had not used the cycle and has coded level
                                      breaking code manually.  Personally, I use the cycle for most simple
                                      reporting .  For more unusual processing it is sometimes better to code it
                                      manually.

                                      One advantage of not using the cycle is that you can do your data selection
                                      within the program using embedded SQL.  This gives you many options that
                                      might not be available with OPNQRYF.

                                      At the end of the day you have to produce a result that satisfies your
                                      requirements and is robust and easily maintained in the future.

                                      Steve
                                      ----- Original Message -----
                                      From: "eamisano" <eamisano@...>
                                      To: <Easy400Group@yahoogroups.com>
                                      Sent: Thursday, July 31, 2003 9:08 PM
                                      Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
                                      programs


                                      > Hi to all
                                      >
                                      > I have to write some vendor reports statistics using Cgi programs.
                                      >
                                      > Now these reports are traditionally batch programs and results are
                                      > only printed.
                                      >
                                      > These reports are complicated because they have differents subtotals
                                      > and in this case it's easy (in non Cgi programs...)
                                      > 1) use Opnqryf to order data
                                      > 2) use control level indicator in Rpg to sum and print subtotals.
                                      >
                                      > Can I use the same technology in Cgi programs ?
                                      >
                                      > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
                                      > and Ovrdbf share(*yes) width DOCMD ?
                                      >
                                      > Does anybody use Opnqryf to order data and level indicator ?
                                      >
                                      > Thanks to all
                                      >
                                      >
                                      >
                                      >
                                      >
                                      > To unsubscribe from this group, send an email to:
                                      > Easy400Group-unsubscribe@yahoogroups.com
                                      >
                                      >
                                      >
                                      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                                      >
                                      >



                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                      To unsubscribe from this group, send an email to:
                                      Easy400Group-unsubscribe@yahoogroups.com



                                      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
                                    • Richard ECUYER
                                      lucky guy, i have just ended mine...... ... From: Enrico Amisano To: Easy400Group@yahoogroups.com Sent: Tuesday, August 05, 2003 4:22 PM Subject: R:
                                      Message 18 of 26 , Aug 5, 2003
                                        lucky guy, i have just ended mine......
                                        ----- Original Message -----
                                        Sent: Tuesday, August 05, 2003 4:22 PM
                                        Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        I beg your pardon Richard, the OVRDBF OVRSCOPE(*JOB) IS CORRECT
                                         
                                        In this moment I'm very confused, I'm thinking to my holidays.
                                         
                                         
                                         
                                        -----Messaggio originale-----
                                        Da: Enrico Amisano [mailto:eamisano@...]
                                        Inviato: martedì 5 agosto 2003 16.04
                                        A: Easy400Group@yahoogroups.com
                                        Oggetto: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        I tried but it doesn't function
                                         
                                        after the Opnqryf I make a Cpyfrmqryf.
                                        The record selected from Opnqryf is correct but Cgi program WSTV11H select entire file !!!
                                         
                                        hallo
                                         
                                         
                                         
                                        -----Messaggio originale-----
                                        Da: Richard ECUYER [mailto:recuyer@...]
                                        Inviato: martedì 5 agosto 2003 15.36
                                        A: Easy400Group@yahoogroups.com
                                        Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        perhaps with :
                                         
                                        DLTOVR FILE(MYFILE) LVL(*JOB)
                                        Monmsg CPF0000
                                        OVRDBF FILE(AAAA) TOFILE(AAAA) OVRSCOPE(*JOB)
                                         
                                         
                                        ----- Original Message -----
                                        Sent: Tuesday, August 05, 2003 3:23 PM
                                        Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                         
                                        Many thanks for your help.
                                         
                                        Now everything is correct.
                                         
                                        The latest problem:
                                        my users are very sophisticated.
                                         
                                        If I put a 220 Cpi spool file on a html page, they accuse me that the spool file isn't well visible
                                        in printing format and they have to scroll the page in the right side.....
                                         
                                        At the end I decide to revise all my programs.
                                         
                                        But how I can execute an Opnqryf in this case?
                                         
                                        WSTV10        require parameters (cgi Ile)
                                        WSTV11        retreive input user (cgi ile)
                                        WSTV11C     "normal" clp that execute an Opnqryf
                                        WSTV11H    display results on Html (cgi ile)
                                         
                                        In WSTV11H I have defined the primary file used in Opnqryf, with break level.
                                         
                                        But it seems to select the entire file, not only the selected record in WSTV11C.
                                         
                                        I make Opnqryf since 10 years, the syntax is correct...
                                         
                                         
                                        WSTV11:
                                                                                                      
                                        OVRDBF     FILE(AAGE200F) TOFILE(AAGE200F) SHARE(*YES)
                                         
                                        OPNQRYF    FILE((AAGE200F)) OPTION(*INP) QRYSLT('ATA02 +  
                                                       *EQ " " *AND CODAG *EQ "' *CAT &CDAGEV +     
                                                       *CAT '"') KEYFLD((CODAG))                    
                                         
                                        CALL WSTV11H
                                         
                                         
                                        Anybody can help me ?
                                         
                                         
                                         
                                         
                                         
                                        -----Messaggio originale-----
                                        Da: Richard ECUYER [mailto:recuyer@...]
                                        Inviato: venerdì 1 agosto 2003 18.01
                                        A: Easy400Group@yahoogroups.com
                                        Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        To display a spool here is what i use (fichier must be more than 210 for you)
                                         
                                        Dspspl_html.txt is my HTML canevas.
                                        hope this help                    
                                        ----- Original Message -----
                                        Sent: Friday, August 01, 2003 5:47 PM
                                        Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        Another question:
                                         
                                        1) In html I tried to use <pre>  but there is a problem:
                                        the records in the database file (QTEMP) are printed in the browser with an empty line between every two written lines.
                                         
                                        Example:
                                        ROW1
                                        empty line
                                        ROW2
                                        empty line   
                                         
                                        etc
                                         
                                        Why ?
                                        In the database file generated from Cpysplf I have no empty record.........
                                         
                                        My Html is:
                                         
                                        /$header                                                               
                                        <table width="100%" border=0 cellspacing="0" cellpadding="0" border="0">
                                                                                                               
                                        /$tablerow                                                             
                                        <tr>                                                                   
                                        <td valign=top align=left bgcolor="#ffffff">                           
                                        <font face="courier" size=2>                                           
                                        <pre>                                                                  
                                        <b> /%datiriga%/&nbsp;                                                 
                                        </pre>                                                                 
                                        </font>                                                                
                                        </td>                                                                  
                                        </tr>                                                                  
                                                                                                               
                                        /$endtable                                                             
                                        </table>
                                         
                                         
                                                                              
                                        2) many of my spool file are of 220 Cpi......
                                        what is the best method to view them in the browser avoiding to move on
                                        the right side ?
                                        Is there an Html function that allows to adapt the table in one page, or I have to
                                        modify all my printer files ?
                                         
                                         
                                         
                                         
                                        3) In Cpysplf command, I tried to use *PRTCTL parameter but what I have to do
                                        in Rpg ?
                                        Should I read the control characters to reproduce new page or to write bold char in Html form ?
                                        How should I do it ?
                                         
                                         
                                        Thank you very much in advance for your help.
                                        Enrico Amisano
                                         
                                         
                                         
                                        -----Messaggio originale-----
                                        Da: Richard ECUYER [mailto:recuyer@...]
                                        Inviato: venerdì 1 agosto 2003 14.39
                                        A: Easy400Group@yahoogroups.com
                                        Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        i don't know how you produce your spool, but if you produce it from a CL, you'll be able to make the cpysplf inside the same CL (after the spool is made)
                                        Another thing, the user that run the cgi PGM is not QTMHTTP but QTMHHTP1.
                                        Try to make an OVRPRTF with HOLD(*YES) and OUTQ(yourOUTQ)
                                         
                                        Hope this help.
                                         
                                        ----- Original Message -----
                                        Sent: Friday, August 01, 2003 2:10 PM
                                        Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        Richard I decide to use your suggests but I have some problems:
                                         
                                        when I execute the CPYSPLF an error CPF3303 issue.
                                         
                                         CPYSPLF    FILE(STV1100P) TOFILE(QTEMP/WSTV11) +
                                                      SPLNBR(*LAST) CTLCHAR(*PRTCTL)     
                                         
                                        File STV1100P was not found in Job 271683/QTMHHTTP/PROD
                                         
                                         
                                        In fact if I use wrkactjob no spool exists for jobs:
                                                PROD        QTMHHTTP    BCI     0,0                  TIMW    
                                         
                                        My spool file is finished on PRT01 with different attributes:
                                        Job: QPRTJOB
                                        User: Amisano (me)
                                        Number: 271678/4
                                         
                                        Why ?
                                         
                                        Why the spool file is finished on PRT01 ?
                                         
                                         
                                         
                                         
                                         
                                         
                                         
                                        -----Messaggio originale-----
                                        Da: Richard ECUYER [mailto:recuyer@...]
                                        Inviato: giovedì 31 luglio 2003 16.17
                                        A: Easy400Group@yahoogroups.com
                                        Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        when the spool is made, you can read each line and send them to the browser.
                                        you have many ways to do that : with API or with a simple CPYSPLF in a work file.
                                         
                                            in the CLP
                                         
                                                opnqryf ...
                                                run your PGM
                                                CRTPF FILE(QTEMP/FICHIER) RCDLEN(210) SIZE(*NOMAX)
                                                CPYSPLF FILE(SPL) TOFILE(QTEMP/FICHIER) SPLNBR(*LAST) CTLCHAR(*PRTCTL)
                                         
                                                then you have your spool in a file
                                         
                                        back to the CGI :
                                         
                                            Open Qtemp/fichier
                                            Read fichier   
                                            dow not %eof
                                         
                                            updhtmlvar ....
                                            .....
                                         
                                         
                                         
                                        ----- Original Message -----
                                        Sent: Thursday, July 31, 2003 4:06 PM
                                        Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        I beg your pardon but I don't understand what does it mean:
                                         
                                        ...........and cach the spool to send it by mail browse it.
                                         
                                        because I need to output the form only in the browser....
                                         
                                        and
                                         
                                        what does it mean
                                        "get back spool......" you say
                                         
                                        thanks
                                         
                                         
                                        -----Messaggio originale-----
                                        Da: Richard ECUYER [mailto:recuyer@...]
                                        Inviato: giovedì 31 luglio 2003 15.31
                                        A: Easy400Group@yahoogroups.com
                                        Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        Hi,
                                        MYCGIRPG does not need to be a CGI, it is a "normal" PGM.
                                         
                                        your Cgi interact with the browser.
                                         
                                        perhaps just send a request form, in your Cgi pgm, read the values, call the CLP, and cach the spool to send it by mail browse it.
                                         
                                            1) send form
                                            2) read values
                                                    Call CLP
                                                    Get back spool ....
                                                    Send the spool under table
                                            3) leave the Cgi
                                         
                                         
                                        ----- Original Message -----
                                        Sent: Thursday, July 31, 2003 3:13 PM
                                        Subject: R: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        I prefer break level because in Sql I have a lot of problems to work if there are
                                        many subtotals to do.
                                         
                                         
                                        My case is this: (but there are much more complicated cases)
                                         
                                        a) in one form I request the user for a representative name or <all>
                                         
                                        what I have to do in this case ?
                                         
                                        - call a Cgi program that in this case is a CLP normal program.
                                         
                                        This program will execute:
                                        1) Ovrdbf(xxxxx) share(*yes)
                                        2) Opnqryf xxxxxxx
                                        3) call MYCGIRPG
                                        4) clof xxxxx
                                        5) dltovr xxxxx
                                         
                                        6) In Ile MYCGIRPG I use this file as primary and use L1...L9
                                         
                                        it's correct this workflow ?
                                         
                                        Many thanks
                                         
                                         
                                         
                                         
                                        -----Messaggio originale-----
                                        Da: Stephen Corbett [mailto:corbett@...]
                                        Inviato: giovedì 31 luglio 2003 14.14
                                        A: Easy400Group@yahoogroups.com
                                        Oggetto: Re: [Easy400Group] Using Opnqryf and control level indicator in Cgi programs

                                        As with many programming problems there are at least twice as many ways as
                                        solving it as there are programmers working on it.

                                        There is probably no reason why you couldn't call a CL program as the CGI
                                        program.  Someone correct me if I'm wrong, but all a CGI program does is
                                        read from standard input and writes to standard output.  So long as that
                                        happens somewhere within your CGI program it probably doesn't matter when.
                                        (After all, I'm sure there are several internal programs called before we
                                        get control in any case.)

                                        As to what is easier.  Possibly an ILE program to read the request
                                        parameters from the browser calling a CL program that does an OPNQRYF, and
                                        calls an RPG program to create the required output using level breaks.  Like
                                        any tool, use the right one for the job.  Using level breaks can simplify
                                        many traditional reporting requirements by using the RPG cycle, including
                                        Level Breaks and Matching Record logic. (Remember that RPG does stand for
                                        Report Program Generator.)  However, there are many people who don't know or
                                        understand how the cycle works or the power it provides and avoid it like
                                        the plauge.  I have had the "pleasure" on many occassions of debugging code
                                        where the original programmer had not used the cycle and has coded level
                                        breaking code manually.  Personally, I use the cycle for most simple
                                        reporting .  For more unusual processing it is sometimes better to code it
                                        manually.

                                        One advantage of not using the cycle is that you can do your data selection
                                        within the program using embedded SQL.  This gives you many options that
                                        might not be available with OPNQRYF.

                                        At the end of the day you have to produce a result that satisfies your
                                        requirements and is robust and easily maintained in the future.

                                        Steve
                                        ----- Original Message -----
                                        From: "eamisano" <eamisano@...>
                                        To: <Easy400Group@yahoogroups.com>
                                        Sent: Thursday, July 31, 2003 9:08 PM
                                        Subject: [Easy400Group] Using Opnqryf and control level indicator in Cgi
                                        programs


                                        > Hi to all
                                        >
                                        > I have to write some vendor reports statistics using Cgi programs.
                                        >
                                        > Now these reports are traditionally batch programs and results are
                                        > only printed.
                                        >
                                        > These reports are complicated because they have differents subtotals
                                        > and in this case it's easy (in non Cgi programs...)
                                        > 1) use Opnqryf to order data
                                        > 2) use control level indicator in Rpg to sum and print subtotals.
                                        >
                                        > Can I use the same technology in Cgi programs ?
                                        >
                                        > Can I run a CL program before an Ile Cgi or I have to run Opnqryf
                                        > and Ovrdbf share(*yes) width DOCMD ?
                                        >
                                        > Does anybody use Opnqryf to order data and level indicator ?
                                        >
                                        > Thanks to all
                                        >
                                        >
                                        >
                                        >
                                        >
                                        > To unsubscribe from this group, send an email to:
                                        > Easy400Group-unsubscribe@yahoogroups.com
                                        >
                                        >
                                        >
                                        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
                                        >
                                        >



                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.


                                        To unsubscribe from this group, send an email to:
                                        Easy400Group-unsubscribe@yahoogroups.com



                                        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
                                      Your message has been successfully submitted and would be delivered to recipients shortly.