JCL Interview Questions and Answers (31 - 40)

31. What is the difference between a temporary and a permanent dataset in JCL?

FeatureTemporary DatasetPermanent Dataset
Naming ConventionUses &&TEMPDS (double ampersand).Uses a fully qualified dataset name (e.g., MY.DATASET.NAME).
ScopeExists only during job execution.Remains after job completion.
StorageAutomatically deleted at job end unless explicitly cataloged.Stored in DASD or tape, retained based on DISP settings.
UsageUsed for intermediate processing between steps in the same job.Used for long-term storage and retrieval.
Example
//TEMPFILE DD DSN=&&MYTEMP,..
//PERMFILE DD DSN=MY.DATASET.NAME,..

32. What are the ways of passing data to a COBOL program from JCL?

Data can be passed to a COBOL program from JCL through:

  • Files: Defining datasets in the JCL that the COBOL program reads as input or writes as output.
  • PARM Parameter: Using the PARM parameter in the EXEC statement to pass a string of data directly to the COBOL program.
  • SYSIN DD Statement: Providing instream data within the JCL using the SYSIN DD statement, which the COBOL program can read during execution.

33. What is the purpose of the PARM keyword in the EXEC statement?

The PARM keyword in the EXEC statement is used to pass input data from JCL to a program during execution.

//STEP01 EXEC PGM=MYPROG,PARM="TEXT"

Purpose:

  • Provides input values to a program at runtime.
  • Used to control program behavior without modifying the code.
  • Passes parameters as a single string (max 100 characters).

Example in COBOL:

...
LINKAGE SECTION.
01 LK-DATA.
   05 LK-LENGTH    PIC S9(04) COMP.
   05 LK-VAR1      PIC X(10).
...
PROCEDURE DIVISION USING LK-DATA.
    ...
	DISPLAY "LK-VAR1:  " LK-VAR1.

34. What is an 'S0C7' abend?

An S0C7 abend in JCL occurs due to a data exception error, usually when a program attempts to perform arithmetic operations on invalid numeric data. This often happens when:

  • A numeric field contains non-numeric data (e.g., uninitialized variables or corrupted records).
  • An operation is performed on a packed decimal (COMP-3) or binary (COMP) field that contains invalid data.

How to Fix:

  • Use debugging tools like ABEND-AID or IBM Fault Analyzer to locate the error.
  • Check input data for invalid characters in numeric fields.
  • Add data validation logic in COBOL before arithmetic operations.
  • Use dumps (CEEDUMP, SYSUDUMP, or SYSABEND) to analyze the register contents at the time of failure.

35. What is a S0C4 error?

An S0C4 abend in JCL occurs due to a storage violation or protection exception, meaning a program is trying to access memory it is not authorized to use. Common causes are:

  • Array index out of bounds in COBOL or assembler programs.
  • Attempting to read/write beyond allocated storage.

How to Fix:

  • Use debugging tools like ABEND-AID or IBM Fault Analyzer to locate the error.
  • Verify array index limits to prevent out-of-bounds access.
  • Use system dumps (SYSUDUMP, SYSABEND) to analyze the error.

36. What are SD37, SB37, SE37 abends?

The SD37, SB37, and SE37 abends in JCL are related to dataset space issues when using DASD storage.

  • SD37 (No Secondary Space): Occurs when a dataset runs out of space and no secondary space is specified in the SPACE parameter.
    Fix: Allocate secondary space (SPACE=(CYL,(primary,secondary))).
  • SB37 (End of Volume) Happens when a dataset runs out of space on a volume, and no additional volume is available.
    Fix: Allow multi-volume allocation (VOL=SER=(,,,n) where n is the number of volumes).
  • SE37 (Max Extents Reached) Occurs when a dataset reaches the maximum extents (16 per volume for non-VSAM).
    Fix: Use larger primary allocation, enable multi-volume, or use VSAM datasets.

37. What is S322 abend?

An S322 abend in JCL occurs when a job or step exceeds the CPU time limit specified in the TIME parameter. Common Causes:

  • An infinite loop in the program.
  • The job requires more CPU time than allocated.
  • Missing or insufficient TIME parameter in JCL or JES settings.

How to Fix:

  • Optimize the program to avoid infinite loops.
  • Increase the TIME parameter in the JOB or STEP.
  • Use TIME=NOLIMIT if allowed, for long-running batch jobs.

38. How can the same PROC be reused and called by many JOBs?

A PROC (procedure) can be reused and called by many JOBs by storing it in a PROCLIB (procedure library) and referring to it in different JCL JOBs using the EXEC PROC statement.

Steps:

  • Store the PROC in a PROCLIB dataset (e.g., SYS1.PROCLIB or a user-defined library).
    //PROCNAME  PROC ...
    //FILE01  DD DSN=...
  • Reference the PROC in JOBs using:
    //JOBNAME  JOB ...
    //STEP01   EXEC PROC=PROCNAME

39. What is the maximum number of in-stream procedures you can code in any JCL?

In a single JCL job, you can code up to 15 in-stream procedures.

40. Name some of the JCL statements that are not allowed in procedures (procs).

In JCL procedures, certain statements are not allowed, including:

  • JOB statements: Since a procedure is part of a job, including a JOB statement within a procedure is not allowed.
  • Delimiter (/*) or Null statements: These are used to mark the end of in-stream data and are not permitted within procedures.
  • JOBLIB DD statements: These are used to specify libraries for the entire job and should not be included within procedures.
  • DD * or DATA statements: Used for in-stream data, these are not allowed within procedures.
  • Any JES2 or JES3 control statements: Job Entry Subsystem control statements are not permitted within procedures.