NetBatch Management Programming Manual

NetBatch Procedure Calls
NetBatch Management Programming Manual522462-003
7-10
Sample Programs
Sample Programs
This subsection contains source code for sample C, COBOL, and TAL programs that
illustrate use of the NB^JOB^SUBMIT procedure.
Sample C Program
Example 7-1 on page 7-12 contains the source code for a sample C program that
demonstrates the use of NB^JOB^SUBMIT. The program uses NB^JOB^SUBMIT to
submit a job to a scheduler, displays some of the job’s details, and handles error
conditions. All instances of WAIT-TIME or START-TIME must be unsigned numerics.
The source code for the program is available in the file NBSPIEX in the NetBatch
installation subvolume.
To run the program, you need 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 C program from file NBSPIEX to a new EDIT file:
> EDIT; GET $SYSGEN.ZNETBTCH.NBSPIEX 1834/2121 PUT
TEMP.NBCSRC
TEXT EDITOR - T9601D20 - (01JUN93)
CURRENT FILE IS $DATA7.TEMP.NBCSRC
Step 2: Change the SYSTEM.SYSTEM References
Change SYSTEM.SYSTEM references in the new file to specify the volume and
subvolume containing the NetBatch library file BATCHLIB:
*LIST BOTH /SYSTEM.SYSTEM.BAT/
1841 #pragma SEARCH "$SYSTEM.SYSTEM.BATCHLIB"
*CHANGE /SYSTEM.SYSTEM.BAT/SYSTEM.SYS00.BAT/ ALL
1841 #pragma SEARCH "$SYSTEM.SYS00.BATCHLIB"
Step 3: Change class name
Change class name CLASS-A to that of an existing class in $ZBAT if class CLASS-A
does not exist in that scheduler. Otherwise, add class CLASS-A to $ZBAT.
*CHANGE /"CLASS-A "/"OPERATIONS
"/ ALL
2023 strncpy (submit_rec.job_details.jclass,
"OPERATIONS ",24);