Using JCL with multiple steps

These guidelines are valid for translating existing or newly developed Easytrieve programs to COBOL/390 and later versions of COBOL.

Migration Utility JCL library (distributed with the product) contains standard procedures for running the translator. See System information for PDS names. You need to run only one of the following procedures, depending on the level of completeness you want to obtain. The procedures are:
JCEZCOB1
Translates programs to PEngiBAT format and places them into a PDS.
JCEZCOB2
Translates programs to COBOL, and places them into a PDS. It does not compile.
JCEZCOB3
Translates programs to COBOL, compiles and links the load module.
JCEZCOB4
Translates programs to COBOL, compiles, links and executes (Link and Go).
JCEZC390
Translates programs to COBOL/390, compiles and links the load module.
JCEZDB2A
Translates programs to COBOL, translates SQL, compiles and links.
JCEZDB2B
Translates programs to COBOL, translates SQL, compiles, links and binds.
JCEZDB2R
Sample Run JCL for generated COBOL with DB2®.
JCBIND00
Sample BIND JCL for DB2.
JCEZE390
Translator JCL with external PROC for translate, compile and link.
JCEZL390
Translator JCL with external PROC for translate, compile, link and execute (Link and Go).
JCEZG390
Translator JCL with external PROC for translate, compile and run (Link and Go with program LOADER).
EZTCOB
External PROC used by JCEZE390 and JCEZL390 JCL.
EZTLKG
External PROC used by JCEZG390 JCL.

To install, follow these steps:

  1. If your installation did not create standard procedures for running Migration Utility, copy the above procedures into a PDS and tailor them to run with your user ID. (Consult with System Administrator for JCL library.)

    DB2 users, refer to Activating Call Attachment Facility (CAF) for DB2 users.

  2. The Easytrieve program source code must be placed into a PDS/PDSE or equivalent library that can be accessed as a PDS.

    Change ISOURCE= symbolic in the procedure to point to the PDS where the Easytrieve program is located. The program source is read from the SYSIN, in FSCCL1 step, if SYSIN ddname is provided. If SYSIN is not coded, the program source is read from the FJCPYLB ddname.

    There must be only one program per PDS member. Migration Utility does not translate multiple programs from a single PDS member.

    Note: When translating existing programs, verify if any tailoring is needed. See Compatibility check for more information.
  3. When your program is read as a PDS member, you can leave JCL at the front of the program. You must remove any JCL at the end of the program (for example, /* or //). For instream SYSIN, you must remove the JCL and add /* and // to the bottom of the program source.

    Change FJSYSJC= symbolic, in the Proc, to an output data set name where program JCL will be created (JCEZCOB2 and JCEZCOB3 procedures only).

  4. The Easytrieve Macros used by the program must be placed into a PDS or equivalent library that can be accessed as a PDS. One or more libraries can be concatenated in the JCL.

    Change USERCPY= symbolic, in the Proc, to point to the PDS where Easytrieve macros are located.

    If there is more than one macro library, concatenate additional libraries to the FJCPYLB ddname in the first (FSCCL1) step.

  5. Member EZPARAMS in the Migration Utility library (SYS1.SFSYEZTS) contains Migration Utility default options. Make a copy of the EZPARAMS member and tailor it to your needs. It is essential to set the correct IOMODE= option in the EZPARAMS member as this parameter affects the amount of tailoring required to be made to Easytrieve Plus programs.

    Macro EASYDTAB in the Migration Utility library (SYS1.SFSYCCLM) contains the REPORT statement defaults. Make sure that EASYDTAB contains defaults compatible with your existing Easytrieve defaults, including edit masks for SYSDATE and SYSDATELONG. Refer to Installing Migration Utility for details.

    Change EZPARMS= symbolic, in the Proc, to point to the PDS where the EZPARAMS member resides.

  6. Change Proc EXEC (located at the bottom of the Migration Utility Proc), to reflect the input program name, the output program name (if any), and the JCL option, for example:
    /STEP001 EXEC PROC=FSPENGI,IMEMBER=PROGXYZ,OMEMBER=PROGXYZ,JCL=YES

    The JCL=YES option punches a procedure for running the translated program. You can omit this option until the program translates clean. After a successful run, JCL can be found on the FJSYSJC file. This generated procedure contains JCL statements located in front of your program, and sample symbolic for any internally generated files. You can retrieve the sample procedure from the flat file into your PDS and massage it.

    Migration Utility tries to identify the file usage based on the top to bottom sequence of events in the program. The first OPEN determines the file type as an output or an input file. The assumption might be wrong for files that are opened more than one time in a single program.

    The DEBUG= switch located in the JCL can be used to generate a display statement of paragraph name in each generated COBOL paragraph.
    DEBUG=Y
    Generates active displays.
    DEBUG=I
    Generates inactive displays.
    DEBUG=N
    Does not generate any display statements.

    When DEBUG=I is specified, the statement SOURCE COMPUTER.....WITH DEBUGGING OPTION is generated with a * in C C 7. Subsequently, you can remove the * to activate the embedded displays. When you specify DEBUG=Y, the statement is generated without a *.

  7. Submit the JOB. The Migration Utility translator prints the program and the diagnostics on the SYSLIST device.

    Depending on the procedure you are using, there can be up to six job steps involved:

    The first (FSCCL1) step ,common to all three procedures, is always the step that translates the Easytrieve program to the PEngiBAT format. Errors in the Easytrieve program are detected in this step. Errors and the input program source are printed on the SYSLIST device and FJSYSER file.

    The second (FSCCL2) step, common to JCEZCOB2 and JCEZCOB3, is always the step that translates the PEngiBAT program generated in the first step, to COBOL. Errors in this step indicate a flaw in the PEngiBAT translator. Some problems could probably be eliminated by rationalizing the origin of the problem back to the Easytrieve program, however. Errors and the generated PEngiBAT program source are printed on the SYSLIST device and FJSYSER file.

    The third (COB2) step, and the fourth (LKED) step, in JCEZCOB3, compile and link the generated COBOL program. Errors in COB2 step indicate a flaw in the PEngiBAT translator. These errors could be eliminated by rationalizing the origin of the problem back to the Easytrieve program. Some common errors that can be encountered are:
    • Field names that conflict with COBOL verbs
    • Undefined fields
    • Non-numeric fields used in arithmetic
    • Improper IF statement

    Programs that contain SQL statements must be translated with JCEZDB2A or JCEZDB2B jobs. The SQL translator and BIND steps are standard DB2/SQL facilities. All messages should be handled as per DB2/SQL conventions.

  8. When COB2 and LKED step run clean, test the program as per JCL as described in step number 6.

    Any file I/O errors that are detected by the program are printed on the FJSYABE and SYSOUT listings. The error report shows the file name that caused the error, status information and some suggestions as to the cause of the problem. Similar descriptions can be found in the COBOL Programmers Reference Manual.