NetBatch Manual

Job Planning, Submission, and Management
NetBatch Manual522460-004
4-9
Using Completion Codes to Test Process
Termination Status
Figure 4-6 shows the input file of a job that compiles a program. The file includes
#CASE statements that test the completion code of the compilation. If the compilation
is successful, the job runs the resulting object.
Figure 4-5. Sample #CASE and #IF Constructs for Completion Code Testing
Figure 4-6. Sample Job Input File Containing #CASE Statements
[#CASE [:_COMPLETION:COMPLETIONCODE]
 |0| #OUTPUT text
 |1| #OUTPUT text
 |2| #OUTPUT text
 |OTHERWISE| #OUTPUT text
]
[#IF [#COMPUTE :_COMPLETION:COMPLETIONCODE > 0]
|THEN| non-zero-branch
 |ELSE| zero-branch
]
VST119.vsd
#SET #INFORMAT TACL
#SET #OUTFORMAT TACL
#PUSH SOURCE_FILE
#PUSH OBJECT_FILE
#SET SOURCE_FILE $NB.FILES.SRCFILE
#SET OBJECT_FILE $NB.FILES.OBJFILE
COBOL85 /IN [SOURCE_FILE], OUT $S.#LIST / [OBJECT_FILE][#CASE
[:_COMPLETION:COMPLETIONCODE]
|0| #OUTPUT No errors or warnings compiling [OBJECT_FILE]
RUN [OBJECT_FILE]
#OUTPUT [OBJECT_FILE] completion:
OUTVAR :_COMPLETION
 |1| #OUTPUT Warnings compiling [OBJECT_FILE], completion:
OUTVAR :_COMPLETION
RUN [OBJECT_FILE]
#OUTPUT [OBJECT_FILE] completion:
OUTVAR :_COMPLETION
 |2| #OUTPUT Fatal compilation errors
 |3| #OUTPUT Compilation failed
 |4| #OUTPUT Compilation never started
 |5| #OUTPUT Compilation abended
 |6| #OUTPUT External stop
 |7| #OUTPUT Compilation restarted
 |8| #OUTPUT Check your listing
 |OTHERWISE| #OUTPUT Unexpected completion:
OUTVAR :_COMPLETION
]
VST120.vsd