http://www.techtricky.
com/
//MYCOMPLEXJOB JOB (ACCT),'MY COMPLEX JCL',CLASS=A,MSGCLASS=H,NOTIFY=&SYSUID
//* This job showcases multiple JCL techniques without sorting.
//* Replace placeholders with actual values as needed.
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DSN=MY.INPUT.DATA,DISP=SHR
//DD2 DD DSN=MY.OUTPUT.DATA1,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,5),RLSE)
//DD3 DD DSN=MY.OUTPUT.DATA2,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(10,5),RLSE)
//STEP2 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MY.INPUT.DATA,DISP=SHR
//SYSUT2 DD DSN=MY.OUTPUT.DATA1,DISP=(MOD,CATLG,DELETE)
//STEP3 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE MY.OUTPUT.DATA1
SET MAXCC=0
/*
//STEP4 EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(ALL)
LISTCAT ENTRIES('MY.*') ALL
/*
//STEP5 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MY.INPUT.DATA,DISP=SHR
//SYSUT2 DD DSN=MY.OUTPUT.DATA2,DISP=(MOD,CATLG,DELETE)
//STEP6 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MY.INPUT.DATA,DISP=SHR
//SYSUT2 DD DSN=MY.OUTPUT.DATA3,DISP=(MOD,CATLG,DELETE)
//STEP7 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=MY.INPUT.DATA,DISP=SHR
//SYSUT2 DD DSN=MY.OUTPUT.DATA4,DISP=(MOD,CATLG,DELETE)
// More steps can be added here...
//STEP99 EXEC PGM=IEFBR14
//DD99 DD DSN=MY.END.FILE,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(1,1),RLSE)
// End of job
Certainly! Let’s break down the provided JCL snippet line by line:
//MYCOMPLEXJOB JOB (ACCT),'MY COMPLEX JCL',CLASS=A,MSGCLASS=H,NOTIFY=&SYSUID:
This is the job control statement (JCL) that initiates a job named MYCOMPLEXJOB.
It specifies accounting information, such as the account number (ACCT).
The job will run in class A, and its messages will be directed to the H class
message queue.
The NOTIFY=&SYSUID part ensures that the job’s completion status is sent to the
user who submitted it.
//* This job showcases multiple JCL techniques without sorting.:
This is a comment line. Anything after //* is treated as a comment and is ignored
by the system.
It provides context for the purpose of the job.
//STEP1 EXEC PGM=IEFBR14:
This defines a job step named STEP1 that will execute the program IEFBR14.
IEFBR14 is a dummy utility that does nothing but return a successful completion
code
It is often used for dataset allocation or other non-processing tasks.
//DD1 DD DSN=MY.INPUT.DATA,DISP=SHR:
This is a data definition (DD) statement within STEP1.
It allocates a dataset named MY.INPUT.DATA for input.
The DISP=SHR parameter indicates that the dataset is shared (read-only).
//DD2 DD DSN=MY.OUTPUT.DATA1,DISP=(NEW,CATLG,DELETE),:
This allocates an output dataset named MY.OUTPUT.DATA1.
The DISP=(NEW,CATLG,DELETE) specifies that the dataset is newly created, should be
cataloged, and will be deleted after the job completes.
The SPACE=(CYL,(10,5),RLSE) parameter defines the space allocation (10 cylinders
initial, 5 additional).
//DD3 DD DSN=MY.OUTPUT.DATA2,DISP=(NEW,CATLG,DELETE),:
Similar to the previous step, this allocates another output dataset named
MY.OUTPUT.DATA2.
//STEP2 EXEC PGM=IEBGENER:
This defines a new job step named STEP2 that executes the program IEBGENER.
/SYSPRINT DD SYSOUT=*:
This specifies the system output (usually a spool file) for the step.
The * means the output will be directed to the system printer.
//SYSUT1 DD DSN=MY.INPUT.DATA,DISP=SHR:
This is the input dataset for the copy operation.
It refers to the same dataset as in STEP1.
//SYSUT2 DD DSN=MY.OUTPUT.DATA1,DISP=(MOD,CATLG,DELETE):
This is the output dataset for the copy operation.
It refers to the same dataset as in STEP1.
The DISP=(MOD,CATLG,DELETE) specifies that the dataset is modified, should be
cataloged, and will be deleted after the job completes.
//STEP3 EXEC PGM=IDCAMS:
This defines another job step named STEP3 that executes the program IDCAMS.
IDCAMS is used for dataset man
//SYSPRINT DD SYSOUT=*:
Again, this specifies the system output for this step.
//SYSIN DD *:
This is the input data for the IDCAMS program.
The actual commands for dataset deletion will be specified here.
Remember that this is just a snippet, and the full JCL would likely have more steps
and additional details. If you need further clarification on any specific part,
feel free to ask! <|im_end|
select * from residents
where name