JCL Interview Questions and Answers (21 - 30)

21. What is the difference between specifying DISP=OLD and DISP=SHR for a dataset?

  • DISP=OLD: This disposition indicates exclusive control over the dataset. Only one job or step can access the dataset at a time, preventing others from reading or writing to it simultaneously.
  • DISP=SHR: This disposition allows multiple jobs or steps to access the dataset concurrently. It permits shared read and write access, facilitating collaborative processing.

22. How do you create a dataset in a JCL with the same file organization as that of another existing dataset?

IEBGENER utility can be used to create a new dataset with the same file organization as an existing one. Specify the existing dataset in the SYSUT1 DD statement and the new dataset in the SYSUT2 DD statement. By using the DCB=*.SYSUT1 parameter for the new dataset, it inherits the Data Control Block (DCB) attributes (like record length, block size, and record format) from the existing dataset.

23. What is the difference between BLKSIZE and LRECL?

ParameterBLKSIZELRECL
Full NameBlock SizeLogical Record Length
DefinitionSpecifies the size of a block of records in bytes.Defines the length of a single record in the dataset.
ScopeA block can contain multiple records.Represents one record only.
ExampleBLKSIZE=8000 (Block holds multiple records)LRECL=80 (Each record is 80 bytes long)

A block consists of multiple records, meaning BLKSIZE ≥ LRECL.

24. How is the keyword DUMMY used in JCL?

The DUMMY keyword is used to specify that a dataset is not actually needed during the job's execution:

  • Output Files: Using DUMMY for an output file means that any data written to it will be discarded.
  • Input Files: Using DUMMY for an input file indicates that the file is empty. This can be useful for testing or when the presence of a file is required syntactically but not functionally.

25. What are three parameters you can specify on both the JOB statement and the EXEC statement?

Three parameters that can be specified on both the JOB and EXEC statements are:

  • TIME: Sets a limit on the CPU time that the job or step can consume.
  • REGION: Specifies the amount of memory allocated to the job or step.
  • COND: Determines the execution of the job or step based on the return codes of previous steps.

26. How do you restart a step in JCL?

To restart a job from a specific step after a failure or abend, you can use the RESTART parameter in the JOB statement. For example, adding RESTART=STEP2 would instruct the system to begin execution from STEP2.

27. What does the TYPRUN=HOLD do in a JCL statement?

The TYPRUN parameter in a JCL statement controls the execution of a job. Setting TYPRUN=HOLD places the job on hold after it is submitted, preventing it from executing until it is manually released by an operator.

28. For how long can a job be executed continuously in a mainframe?

A job can be executed continuously in a mainframe environment for up to 248 days. This duration is determined by system limitations and resource management policies.

29. What is the maximum number of DD statements in a job?

A single JCL job can contain up to 3,273 DD (Data Definition) statements.

30. What is the maximum number of steps in a job?

A JCL job can have a maximum of 255 steps.