logo                                                                              logoslog

Q2C - QuikJob  (CA Advantage VISION: Report)  to COBOL

 

QuikJob Source

OPTION SEQCHK=NO,WSTSIZE=4000,STMTEND=65,STMTS=900,GENSIZE=12200
   *
OPTION LIST=NO
OPTION SEQCHK=NO
INFKSDS    0080S      LBL=PRCHEK
EQU DATE WST1-4
EQU DATE
EQU DATE-CC (2)
EQU DATE-YY (2)
EQU CKDT (9) N
EQU CKDT
EQU CKDT-FIL (1)
EQU CKDT-CY  (4)
EQU CKDT-MD  (4)
    REPORT INF11-19     (CHK#) SPACE01
           INF25-29-P   (DATE) SPACE01
           VAL56-57     ($DT)  SPACE01
           DATE         (DATE) SPACE01
           CKDT         (CKDT) SPACE01
           CKDT-CY      (CKCY) SPACE01

     MOVE VAL56-61 TO DATE-YYMMDD
     MOVE VAL56-57 TO DATE-YY
     MOVE C'20'    TO DATE-CC
     SUB C'7' FROM    DATE
100 GET INF ATEND EOJ
    MOVE INF25-29-P TO CKDT
    IF CKDT-CY > DATE
       GOTO 100.
    PRINT REPORT
    GOTO 100
999 END




COBOL Code generated



       Identification Division.

      *---------------------------------------------------------------*
      * Quikjob to Cobol conversion on 2017-01-16 at 09:50:33         *
      *---------------------------------------------------------------*

       Program-Id. Q2CDEMO.

       Environment Division.
       Input-Output Section.
       File-Control.
           Select Inf assign to Ksds-prchek
                      organization is indexed
                      access mode is sequential
                      record key is Inf-key.
           Select Prt assign to Sys006-s-syslst.

       Data Division.
       File Section.

       FD  Inf.
       01  Inf-file-rec                  Pic X(80).
       01  Inf-key-rec.
           05  Inf-key                   Pic X(05).
           05  Filler                    Pic X(75).

       FD  Prt
           recording mode is F.
       01  Prt-file-rec                  Pic X(132).

       Working-Storage Section.

      *----------------------------------------------------------------
      *    General Working-Storage fields
      *----------------------------------------------------------------

       01  Wst-area.

           05  Wst1-4                    Pic X(4).
           05  Date--r redefines Wst1-4  Pic 9(4).
           05  Filler redefines Wst1-4.
               10  Wst1-2                Pic X(2).
               10  Date-cc redefines Wst1-2
                                         Pic X(2).
               10  Wst3-4                Pic X(2).
               10  Date-yy redefines Wst3-4
                                         Pic X(2).
           05  Wst5-13                   Pic 9(9).
           05  Ckdt redefines Wst5-13    Pic 9(9).
           05  Filler redefines Wst5-13.
               10  Wst5-5                Pic X(1).
               10  Ckdt-fil redefines Wst5-5
                                         Pic X(1).
               10  Wst6-9                Pic X(4).
               10  Ckdt-cy redefines Wst6-9
                                         Pic X(4).
               10  Wst10-13              Pic X(4).
               10  Ckdt-md redefines Wst10-13
                                         Pic X(4).

      *----------------------------------------------------------------
      *    Input record descriptions
      *----------------------------------------------------------------

       01  Inf-rec                       Pic X(80).
       01  Inf1-80 redefines Inf-rec.
           05  Inf1-10-filler            Pic X(10).
           05  Inf11-19                  Pic X(9).
           05  Inf20-24-filler           Pic X(5).
           05  Inf25-29-p                Pic S9(9)       packed-decimal.
           05  Inf30-80-filler           Pic X(51).

      *----------------------------------------------------------------
      *    Printfile record descriptions
      *----------------------------------------------------------------

       01  Prt-rec                       Pic X(132)    value spaces.

      *----------------------------------------------------------------
      *    Report record descriptions
      *----------------------------------------------------------------

       01  Report-page-header.
           05  Rep-page-date             Pic X(10)   value 'DD/MM/CCYY'.
           05  Filler                    Pic X(26)   value spaces.
           05  Filler                    Pic X(05)   value 'PAGE '.
           05  Rep-page-no               Pic ZZZ9.

       01  Report-header.
           05  Header-1-01               Pic X(09)
               value '..CHK#...'.
           05  Filler                    Pic X(01)  value spaces.
           05  Header-1-02               Pic X(10)
               value '......DATE'.
           05  Filler                    Pic X(02)  value spaces.
           05  Header-1-03               Pic X(03)
               value '$DT'.
           05  Filler                    Pic X(01)  value spaces.
           05  Header-1-04               Pic X(04)
               value 'DATE'.
           05  Filler                    Pic X(01)  value spaces.
           05  Header-1-05               Pic X(09)
               value '.....CKDT'.
           05  Filler                    Pic X(01)  value spaces.
           05  Header-1-06               Pic X(04)
               value 'CKCY'.
           05  Filler                    Pic X(01)  value spaces.

       01  Report-line                   value spaces.
           05  Rep-inf11-19              Pic X(09).
           05  Filler                    Pic X(01).
           05  Rep-inf25-29-p            Pic Z(9)-.
           05  Filler                    Pic X(01).
           05  Rep-val56-57-x.
               10  Rep-val56-57          Pic X(02).
               10  Filler                Pic X(01).
           05  Filler                    Pic X(01).
           05  Rep-date--r               Pic Z(4).
           05  Filler                    Pic X(01).
           05  Rep-ckdt                  Pic Z(9).
           05  Filler                    Pic X(01).
           05  Rep-ckdt-cy               Pic X(04).

      *----------------------------------------------------------------
      *    Quikjob to Cobol conversion fields
      *----------------------------------------------------------------

           Copy Q2CVAL.

       01  Q2c-fields.
           05  Pgm--name                 Pic X(8)      value 'Q2CDEMO '.
           05  Page-count                Pic 9(4)      value zero.
           05  Lines-printed             Pic 9(3)      value 99.
           05  Lines-to-advance          Pic 9         value 1.
           05  Inf-eof                   Pic X         value space.

      *****************************************************************

       Procedure Division.

       Initial-process Section.

           Copy Q2CINIT.

           Initialize Wst-area
           Initialize Inf-rec
           Move Date--dd   to Rep-page-date (1:2)
           Move Date--mm   to Rep-page-date (4:2)
           Move Date--ccyy to Rep-page-date (7:4).
           Open I-O    Inf.
           Open output Prt.

       Main-process Section.

           Move Date--ymd to Date-yymmdd
           Move Date--yy to Date-yy
           Move  '20'    to Date-cc
           Subtract 7 from    Date--r.
       Main-100.
           Read Inf into Inf-rec
             at end
                Move 'E' to Inf-eof
                Move high-values to Inf-rec
                go to End-process
           end-read
           Move Inf25-29-p to Ckdt
           If Ckdt-cy > Date--r
              go to Main-100.
           Perform Print-report
           go to Main-100.
       End-process Section.
           Goback.

       Additional-processing Section.

      *----------------------------------------------------------------
      *    Report and printfile processing sections
      *----------------------------------------------------------------

       Print-report.

           Move Inf11-19        to Rep-inf11-19
           Move Inf25-29-p      to Rep-inf25-29-p
           Move Date--yy        to Rep-val56-57
           Move Date--r         to Rep-date--r
           Move Ckdt            to Rep-ckdt
           Move Ckdt-cy         to Rep-ckdt-cy
           Move Report-line     to Prt-rec
           Perform Print-line.

       Print-line.

           If  Lines-printed >= 64
               Perform Print-report-header
           end-if

           Write Prt-file-rec from Prt-rec
             after Lines-to-advance
           Add Lines-to-advance to Lines-printed
           Move 1 to Lines-to-advance
           Move spaces to Prt-rec.

       Print-report-header.

           Move 0 to Lines-printed
           Add 1 to Page-count
           Move Page-count to Rep-page-no
           Write Prt-file-rec from Report-page-header
             after advancing page
           Write Prt-file-rec from Report-header
           Move spaces to Prt-file-rec
           Write Prt-file-rec
           Add 3 to Lines-printed.