Procedures (PROCs) IQ for Experienced


What is a procedure?

A procedure is a reusable set of JCL statements defined once and called multiple times within a job or across various jobs.

How many types of PROCs available in JCL?

Procedures are of two types based on their definition and usage - Instream procedure and Cataloged procedure.

Name different JCL statements that are not permitted in the procedures?

It wont allow any statements other than CNTL, command, DD, ENDCNTL, EXEC, IF/THEN/ELSE/ENDIF, INCLUDE, OUTPUT JCL, and SET statements only.

Can you execute a PROC from another PROC?

Yes, Only Cataloged PROC.

How do you restart a PROC from a particular step?

RESTART=stepname[.proc-stepname]

Instream Procedure -

What is instream procedure?

An instream procedure is a type of procedure that is defined within the same JCL where it calls.

What is the use of instream procedure?

Reusablity within the JCL and reduces redundancy.

The maximum number of in-stream procedure you can code in any JCL is?

15

Which statement is used to end the in-stream procedure in a JCL?

PEND

Can you code instream data in a PROC?

No, you cannot code instream data (data between DD * and /*) directly within a PROC. Instead, you should pass the data using a symbolic parameter and specify the instream data in the calling JCL.

Cataloged Procedure -

What is Cataloged Procedures?

Cataloged procedures are defined outside of the JCL and maintained independently of any JCL. The library can be a personal or system library of type PDS.

What are the advantages of using a catalogue in JCL?

Reusablity of JCL statement available for all JOBs and reduces redundancy.

The maximum number of cataloged procedure you can code in any JCL?

255

How can the same PROC be re-used and called by many JOBs?

Define it as Cataloged PROC.

Nested Procedures -

What is nested procedures?

Nested procedures (PROC) are a technique to create a PROC that contains a call to another PROC.

How many levels of nested procedures can code in JCL?

15

Common Questions -

State difference between an instream and a catalogued Procs?

PROC definition is part of the JOB where it invoked. PROC defintion is outside of the JOB where it invoked.
PROC is available to the JOB where it defined. PROC is available to all JOB by using the defintion library (PROCLIB).
Its defintion should start with a PROC statement and end with a PEND statement. Its defintion should start with a PROC statement and PEND is optional.
Can code upto 15 instream procs in one JCL. Can code upto 255 procs in one JCL.

Frequently Asked Questions -

Explain what JCL Procedures?
What are the JCL procedures?
What do you mean by PROC?

What are the differences between instream and catalogue procedures?
What is the difference between CATALOGED procedure and IN-STREAM procedure?

Name some of the JCL statements that are not allowed in procs.?

What is the importance of catalogue procedures in real-time applications?