NetBatch Management Programming Manual

Sample Programs
NetBatch Management Programming Manual522462-003
C-15
Sample COBOL Program
Sample COBOL Program
Example C-2 on page C-17 contains the source code for a sample COBOL program.
The program submits a job to a scheduler, executes a STATUS JOB command on the
submitted job, and displays some job details. The source code for the program is
available in the file NBSPIEX in the NetBatch installation subvolume.
To run the sample program, follow these steps. The prerequisite to completing the
procedure is a D21 or later scheduler named $ZBAT running on the node where the
program will run.
Step 1: Copy the Source Code
Copy the source code for the sample COBOL program from file NBSPIEX to a new
EDIT file:
> EDIT; GET $SYSGEN.ZNETBTCH.NBSPIEX 545/1093 PUT TEMP.COBSRC
TEXT EDITOR - T9601D20 - (01JUN93)
CURRENT FILE IS $DATA7.TEMP.COBSRC
Step 2: Change ISV.ZSPIDEF References
Change ISV.ZSPIDEF references in the new file to specify the volume and subvolume
containing the source-definition files ZSPICOB and ZBATCOB:
*LIST BOTH /ISV.ZSPIDEF/
589 COPY ZBAT-DDL-MSG-BUFFER OF $ISV.ZSPIDEF.ZBATCOB.
600 ?SOURCE $ISV.ZSPIDEF.ZBATCOB (ZBAT-TKN-SEL-JOB-
NUMBER,
610 ?SOURCE $ISV.ZSPIDEF.ZSPICOB
*CHANGE /ISV/SYSGEN/ ALL
589 COPY ZBAT-DDL-MSG-BUFFER OF
$SYSGEN.ZSPIDEF.ZBATCOB.
600 ?SOURCE $SYSGEN.ZSPIDEF.ZBATCOB (ZBAT-TKN-SEL-JOB-
NUMBER,
610 ?SOURCE $SYSGEN.ZSPIDEF.ZSPICOB
Step 3: Change the SYSTEM.SYSTEM References
Change SYSTEM.SYSTEM references in the new file to specify the volume and
subvolume containing the COBOL library and external-declaration files COBOLLIB and
COBOLEX0:
*LIST BOTH /SYSTEM.SYSTEM.COB/
547 ?SEARCH $SYSTEM.SYSTEM.COBOLLIB
548 ?CONSULT $SYSTEM.SYSTEM.COBOLEX0
*CHANGE /SYSTEM.SYSTEM.COB/SYSTEM.SYS00.COB/ ALL
547 ?SEARCH $SYSTEM.SYS00.COBOLLIB
548 ?CONSULT $SYSTEM.SYS00.COBOLEX0