JCL Interview Questions and Answers (11 - 20)
11. When should DISP=MOD be used?
The DISP=MOD parameter is used in JCL when you want to append data to an existing sequential dataset (PS) or create a new one if it doesn't exist. If the dataset already exists, DISP=MOD adds new records to the end. If it doesn't exist, the system treats it as a new dataset, provided that the volume parameter hasn't been specified.
12. Why do you want to specify the REGION parameter in a JCL step?
The REGION parameter is used to define the maximum amount of memory a particular job step can utilize. Specifying this parameter allows you to override the default memory allocation set at the JOB level, ensuring that the step has sufficient resources without affecting other jobs.
13. What does the TIME parameter signify? What does TIME=1440 mean?
The TIME parameter sets a limit on the CPU time that a job or step can use. This helps prevent jobs from running indefinitely and consuming excessive resources.
Setting TIME=1440 indicates that there is no CPU time limit for that job or step, allowing it to run as long as necessary.
14. How do you check the syntax of a JCL without running it?
To verify the syntax of a JCL without executing it, you can use the TYPERUN=SCAN
parameter in the JOB statement.
This instructs the system to check for syntax errors without actually running the job.
Alternatively, tools like JSCAN can be utilized for this purpose.
15. What is COND=EVEN?
In JCL, the COND parameter determines whether a particular job step should be executed based on the completion status of previous steps.
Setting COND=EVEN
means that the specified step will execute even if any of the preceding steps have terminated abnormally (i.e., ended with errors).
16. What is COND=ONLY?
Conversely, setting COND=ONLY indicates that the step should execute only if one or more of the preceding steps have terminated abnormally. If all prior steps complete successfully, this step will be skipped.
17. What happens if the DISP in the JCL is MOD and the program opens the file in OUTPUT mode? What happens if the DISP in the JCL is SHR and the program opens the file in EXTEND mode?
- DISP=MOD and OUTPUT mode: When a dataset is allocated with
DISP=MOD
, it means that data will be appended to the end of the existing dataset. Opening the file in OUTPUT mode allows the program to write additional records at the end. - DISP=SHR and EXTEND mode: With
DISP=SHR
, multiple programs can access the dataset simultaneously. Opening the file in EXTEND mode permits the program to add records to the end of the dataset, similar to the append operation.
In both scenarios, records are appended to the end of the file when a WRITE operation is performed.
18. What does a disposition of (NEW,CATLG,DELETE) mean?
This disposition indicates that a new dataset is to be allocated. If the step completes successfully, the dataset will be cataloged (CATLG). If the step abends (abnormally ends), the dataset will be deleted (DELETE).
19. What does a disposition of (NEW,CATLG,KEEP) mean?
This disposition indicates that a new dataset is to be allocated. If the step completes successfully, the dataset will be cataloged (CATLG). If the step abends, the dataset will be kept (KEEP) but not cataloged. In such cases, you would need to supply the volume serial number (vol. ser) the next time you refer to it.
20. What is DISP=(NEW,PASS,DELETE)?
This disposition indicates that a new dataset is to be created. If the step completes successfully, the dataset is passed (PASS) to subsequent steps. If the step abends, the dataset is deleted (DELETE). This dataset will not exist beyond the JCL execution.