5.11 Example coding of a job definition script file
The following shows an example coding of a job definition script file.
#!/opt/jp1as/bin/adshexec # Control of the entire job # -->1.
#-adsh_job SAMPLE_JOB
####################
# If the job step return code is 8 or greater, cancel the job
#-adsh_job_stop 8:
# Temporary file used inside the job
#-adsh_file_temp JOBTEMP
###################
# Job step 1 # -->2.
###################
#-adsh_step_start S1
# Definition of input and output files
#-adsh_file INFILE /files/infile -chk exist
#-adsh_file OUTFILE /files/outfile
#-adsh -chk no -normal keep -abnormal del
# Definition of parameter files
#-adsh_file_temp PARMFILE -id param
cat<<@@@>${PARMFILE}
-in ${INFILE}
-out ${OUTFILE}
-work /tmp
@@@
# User program execution
s1uap ${PARMFILE}
#-adsh_step_error
# Program error handling procedure
recovery_uap ${JTMP}
#-adsh_step_end
###################
# Job step 2 # -->3.
###################
if [[ $ADSH_STEPRC_S1= -eq 0 ]]; then
# Execute only if the preceding job step terminates normally
#-adsh_step_start S2 -onError cont -stepVar PATH
PATH=/s2bin:$PATH
#-adsh_rc_ignore s2uap
echo "s2uap1"
echo "s2uap2 parm1"
#-adsh_step_end
fi
###################
# Job step 3 # -->4.
###################
#-adsh_step_start Java_STEP -run normal
adshjava -grp GROUPA -java javaAP prm1
#-adsh_step_end
The numbers shown at the right in the above example correspond to the numbers in the following explanation:
Control of the entire job
Performs processing such as passing control to job steps and terminating the job.
Processing of job step 1
Definition of input and output files
Definition of parameter files
Execution of user program
Error handling procedure
Processing of job step 2
Performed only if job step 1 terminates normally.