References to datasets (for example, allocation, creation, deletion) from conditional steps (that is, steps with COND= parameter or within an IF/THEN/ELSE block) may be considered conditional as the dataset reference may or may not occur due to return codes or abends from preceding steps.
Control-M JCL Verify can issue warning messages when a dataset reference might be invalid, depending on whether the preceding conditional reference has occurred or not.
Conditional dataset reference warnings can be optionally enabled using the CNDALC parameter in CTJPARM:
Example 1:
//MYJOB JOB
//STEP1 EXEC PGM=IEFBR14
//STEP2 EXEC PGM=IEFBR14,COND=(0,GT,STEP1)
//DD1 DD DSN=DSN1,DISP=(NEW,CATLG)
//STEP3 EXEC PGM=IEFBR14
//DD2 DD DSN=DSN1,DISP=OLD
STEP2 is a conditional step and has COND= parameter. Dataset references made by this step are considered conditional. This step allocates a new dataset DSN1 (DD1), which is later referenced (with DISP=SHR) by STEP3 (DD2).
DD2 may or may not be valid, depending on whether STEP2 was executed or not (that is, it may not be valid if STEP2 was not executed and DSN1 was not created by it). Control-M JCL Verify can optionally issue a warning message saying “DSN1 may not exist”.
CTJDC1W WARNING: DSN WITH DISP=OLD MAY NOT EXIST. DSN=DSN1
Example 2:
//MYJOB JOB
//STEP1 EXEC PGM=IEFBR14
//STEP2 EXEC PGM=IEFBR14,COND=(0,GT,STEP1)
//DD1 DD DSN=DSN1,DISP=(OLD,DELETE)
//STEP3 EXEC PGM=IEFBR14
//DD2 DD DSN=DSN1,DISP=(NEW,CATLG)
STEP2 (the conditional step) deletes dataset DSN1. A later step in the job, STEP3, re-creates DSN1, which may or may not be valid, depending on whether STEP2 was executed or not (that is, it may not be valid if STEP2 was not executed and DSN1 already exists).
Control-M JCL Verify can optionally issue a warning message saying “DSN1 may already exist”.
CTJDC0W WARNING: DSN WITH DISP=NEW MAY ALREADY EXIST. DSN=DSN1
Example 3:
//MYJOB JOB
//STEP1 EXEC PGM=IEFBR14
//STEP2 EXEC PGM=IEFBR14,COND=(0,GT,STEP1)
//DD1 DD DSN=DSN1,DISP=(NEW,CATLG)
//STEP3 EXEC PGM=IEFBR14
//DD2 DD DSN=DSN1,DISP=(NEW,CATLG)
Both STEP2 (the conditional step) and STEP3 create dataset DSN1. Dataset creation in STEP3 (DD2) may or may not be valid, depending on whether STEP2 was executed or not (that is, it may not be valid if STEP2 was executed and already created DSN1).
With CNDALC=N (the default), the following error message will be issued, indicating that the dataset already exists (as both steps are considered unconditional).
CTJD02W WARNING: DSN with DISP=NEW already exists. DSN=
With CNDALC=Y, the following warning message will be issued, indicating that dataset creation may fail as DSN1 may already exist.
CTJDC0W WARNING: DSN WITH DISP=NEW MAY ALREADY EXIST. DSN=DSN1
Note: For all disk space calculations, Control-M JCL Verify considers all steps as unconditional and assumes that the space used by all the datasets is allocated/released by all steps.
Parent Topic |