AMT JCL Script
Batch IDs
It is possible to pass a batchId from a parent job into the Job Control Language (JCL) script. Thereafter, the batchId value can be used to start the new program job. A UUID is automatically generated if no batchId was provided before starting a JCL script.
Parameters
Configuring a JCL Script for Restart
When a JCL script is configured to be restartable, a restart log file is created to store which cycle file was added when running the script. This restart log file is made unique by adding the Batch ID into the filename. This enables a user to restart a specific instance of a script that has run. The restart log files are stored in the ../<AMT_Root>/Extracts/RestartLog folder with the following filename specification: <script_name>_<batch_id>.json.
The --restartat parameter can be specified from the command line or through the Control Center Start Job
screen. For information about restarting scripts from Control Center, see Restarting Scripts.
Two parameters can be passed to create restarting conditions:
restartat
Use parameter --restartat to specify the step at which the job should restart. Use the following syntax
to restart a job at a specific step:--restartat=<JobStepName>.ProcStep.
Jobs with a step that has no step name can be restarted from the step using the following syntax:
--restartat=.ProcStep.
restartbatchid (optional)
Use the optional parameter --restartbatchid to specify the Batch ID of the restart log file to be used.
If no restartbatchid parameter is specified, the most recent restart log
file is used (the restart log file that starts with the script name).
JCL Script Example Usage
1. Initialize the Libraryimport lib
lib.initialize(__file__)from lib import amt_iceman
amt_iceman(step)from lib import amt_icetool
amt_icetool(step)from lib import amt_dsnutilb
amt_dsnutilb(step)from lib import amt_iebcopy
amt_iebcopy(input_file_name="SYSIN")from lib import amt_iebgener
amt_iebgener(input_file, output_file, definitions_file)from lib import amt_listcat
amt_listcat(catalog="MYCAT", entries="MYDATASET", out_file="output.txt")from lib import amt_print
amt_print(dataset="MYDATASET", count=100)from lib import amt_ftp
amt_ftp(input_file="ftp_commands.txt")from lib import amt_sqlload
amt_sqlload()from lib import start_dynamic_jcl
start_dynamic_jcl(name="MY_DYNAMIC_JOB")from lib import set_env_symbol, resolve_env_symbol
set_env_symbol("MYVAR", "VALUE")
value = resolve_env_symbol("MYVAR")from lib import finish_job
finish_job()