QJB2CBL - Translate QuickJob Programs to COBOL or SORT

                   

Overview

The QJB2CBL Language Conversion Program (LCP) translates QuickJob (Advantage Vision:Report) source code to COBOL or SORT. QJB2CBL supports VSE and MVS JCL streams as well as QuickJob source code which is in-line or off-line. Besides translating QuickJob source code to COBOL or SORT control statements, QJB2CBL edits the JCL streams in accordance with the result of the translation.

QJB2CBL currently supports the following QuickJob verbs: ABEND, ACCEPT, ACCUM, ADD, ADDRECORD, ATEND, BREAK, CALL, CALL QUIKDATE, CALL QUIKVSAM, CHECKBREAKS, CLOSE, CONDATE, DELETE, DISPLAY, DIVD, DOHEADERS, DROP, EJECT, END, EQU, EXIT, GET, GOTO, HDR, IF, LIMITREADS, LINECOUNT, LOAD, MOVE, MULT, OPEN, OPTION, PAGETOTALS, PAGEWIDTH, PERFORM, PRINT, PRINT REPORT, PRINTCHAR, PRINTHEX, PUNCH, READ, RELEASE, REPORT, RETURN, REWRITE, SET, SKIP, SORT, SUB, TABLSORT, TABLSPEC, TITLE/TITLE2, TRACE, WHEN, WRITE. Additional verbs will be supported in the future, as needed.

Running the QJB2CBL LCP

QJB2CBL is a mass-processing tool which can process the entire content of a JCL library in a single run, ignoring the members which do not contain QuickJob programs. Member lists can be specified by the user to select or ignore certain JCL members.

//*---------------------------------------------------------------------*
//*	Run the QJB2CBL LCP					*
//*---------------------------------------------------------------------*
//QJB2CBL EXEC PGM=LCPSTART,PARM=(INJCL,QJB2CBL)
//SYSPRINT DD SYSOUT=*					RUN-TIME MESSAGES
//SYSLOG   DD SYSOUT=*					LCP MESSAGES
//INJCL    DD DSN=PAYROLL.PROD.JCLLIB,DISP=SHR 		Input JCL Streams (PDS)
//OUTJCL   DD DSN=&&NEWJCL,DISP=(,PASS) 		Output JCL Streams (IEBUPDTE)
//OUTCOBOL DD DSN=&&COBOL,DISP=(,PASS)			Output COBOL Programs (IEBUPDTE)
//SELDD    DD * 					Optional Member Selection
DAILY11
MONTH33
/* 

Conversion Examples

The following three examples demonstrate the capabilities of the QJB2CBL LCP for converting QuickJob source statements to SORT or COBOL, and modifying the run JCL accordingly.

  1. Very simple QuickJob program with no logic which is converted to a SORT FIELDS=COPY step.
  2. Simple QuickJob program with some logic which is converted to COBOL.
  3. QuickJob reporting program which is converted to COBOL.

Example 1

This is a very simple QuickJob program which does not contain any IF statement and can be replaced with a SORT step.

Original JCL and QuickJob Source Code

//STEP010 EXEC PGM=QUIKJOB
//SYSPRINT DD SYSOUT=*
//SYSIN    DD *
005 GET INF ATEND EOJ
    MOVE C'ONE-TWO' TO OFA1-10
    MOVE INF1-20    TO OFA11
    WRITE OFA
    GOTO 005
/*
//SYSUT1   DD *
11111111111111111111111111111111111
22222222222222222222222222222222222
33333333333333333333333333333333333
/*
//SYSUT2   DD DSN=PROD.TEMPFILE,DISP=(,CATLG),RECFM=FB,LRECL=80 

Example 1 - Updated JCL

//STEP010 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SYSIN    DD *
 SORT FIELDS=COPY
 RECORD TYPE=F,LENGTH=80
 OUTREC FIELDS=(C'ONE-TWO   ',1,20)
/*
//SORTIN   DD *
11111111111111111111111111111111111
22222222222222222222222222222222222
33333333333333333333333333333333333
/*
//SORTOUT  DD DSN=PROD.TEMPFILE,DISP=(,CATLG) 

Example 2

This is a very simple QuickJob program which contains an IF statement and is converted to COBOL.

Original JCL and QuickJob Source Code

//STEP020 EXEC PGM=QUIKJOB
//SYSPRINT DD SYSOUT=*
//SYSUT2   DD DSN=PROD.TEMPFILE,DISP=(,CATLG),RECFM=FB,LRECL=80

ATEND 999

005 GET  INF
    IF INF1 = C'1'
      GOTO 010.
    MOVE C'TWO'      TO OFA1-10
    GOTO 020
010 MOVE C'ONE'      TO OFA1-10
020 MOVE INF1-20     TO OFA11-30
    WRITE OFA
    GOTO 005.

999 END
/*
//SYSUT1   DD *
11111111111111111111111111111111111
22222222222222222222222222222222222
33333333333333333333333333333333333
/* 

Example 2 - Updated JCL

//STEP020 EXEC PGM=QJBCBL02			(see source code below)
//SYSOUT   DD SYSOUT=*
//SYSUT2   DD DSN=PROD.TEMPFILE,DISP=(,CATLG),RECFM=FB,LRECL=80
//SYSUT1   DD *
11111111111111111111111111111111111
22222222222222222222222222222222222
33333333333333333333333333333333333
/* 

Example 2 - Program Source Code for QJBCBL01 program generated by the QJB2CBL LCP.

    *** Program translated by QJB2CBL on 17 July 2006 17:34
       IDENTIFICATION DIVISION.
         PROGRAM-ID. QJBCBL02.
       ENVIRONMENT DIVISION.
        INPUT-OUTPUT SECTION.
         FILE-CONTROL.
           SELECT INF ASSIGN S-SYSUT1.
           SELECT OFA ASSIGN S-SYSUT2.
       DATA DIVISION.
        FILE SECTION.
         FD INF.
         01 INF-RECORD PIC X(80).
         FD OFA.
         01 OFA-RECORD PIC X(80).
       PROCEDURE DIVISION.
           OPEN INPUT INF, OUTPUT OFA.
        PROC-005.
           READ INF
             AT END GO TO PROC-999.
           IF INF-RECORD(1:1) = '1'
             GO TO PROC-010.
           MOVE 'TWO'      TO OFA-RECORD(1:10)
           GO TO PROC-020.
        PROC-010.
           MOVE 'ONE'      TO OFA-RECORD(1:10).
        PROC-020.
           MOVE INF-RECORD(1:20) TO OFA-RECORD(11:20)
           WRITE OFA-RECORD
           GO TO PROC-005.
        PROC-999.
           CLOSE INF, OFA.
           STOP RUN. 

Example 3

This is a simple program which uses QuickJob's report and control-breaking capabilities.

Original JCL and QuickJob Source Code

//STEP030 EXEC PGM=QUIKJOB
//SYSPRINT DD SYSOUT=*
OPTION SEQCHK=NO,HDRDOTS=NO,LIST=NO
EQU I-WHSE     INF1-4
EQU I-PROD     INF5-12
EQU WK-PROD-CNTR (3)-P

    TITLE1  'PROG- JB24J003Q3         PRODUCT INVENTORY OF UNITS  '
    TITLE1  'BEING  DROPPED  FROM  THE  LINE'
    TITLE2  '    TOTAL NATIONWIDE....   BY  STANDARD  PRODUCT  CODE  '
    TITLE2  'AND  WHSE         RUN DATE $IPLDAT$    PAGE $PG$'
    REPORT  SPACE10
            I-PROD    (STANDARD,PRODUCT)
            I-WHSE    (WHSE,LOCATION)
         WK-PROD-CNTR (TOTAL,UNITS)
    BREAK 1 I-WHSE SB 0 SA 1
    BREAK 2 I-PROD SB 0 SA 1

010 GET  INF  ATEND  EOJ
    CHECKBREAKS
    MOVE C'1'  TO  WK-PROD-CNTR
    ACCUM WK-PROD-CNTR
300 PRINT REPORT SUMMARY
    GO TO  010
/*
//SYSUT1   DD *
WH01PRODUCT1
WH02PRODUCT1
WH03PRODUCT2
/* 

Example 3 - Updated JCL

//STEP030 EXEC PGM=QJBCBL03			(COBOL source code provided upon request)
//SYSOUT   DD SYSOUT=*
//SYSUT1   DD *
WH01PRODUCT1
WH02PRODUCT1
WH03PRODUCT2
/* 

Search key-words: ibm legacy mainframe mainframes main-frame mvs/esa os/390 z/os os390 zos vse dos/vs dos/vse vse/esa z/vse zvse Sterling QuickJob reserved words quikjob verbs qukbjob picnsave Vision:report Answer:report Quik-Job Quick-Job convert conversion translate translation unix linux HP windows server source code statements programming language needed