For jobs that you run frequently or types of jobs that use the same job control, prepare sets of job control statements, called procedures.
When you place a procedure in the job input stream, it is called an in-stream procedure. An in-stream procedure must begin with a PROC statement, end with a PEND statement, and include only the following other JCL statements: CNTL, comment, DD, ENDCNTL, EXEC, IF/THEN/ELSE/ENDIF, INCLUDE, OUTPUT JCL, and SET. You must observe the following restrictions regarding in-stream procedures:
A procedure that you catalog in a library is called a cataloged procedure. A cataloged procedure may consist of these JCL statements: CNTL, command, DD, ENDCNTL, EXEC, IF/THEN/ELSE/ENDIF, INCLUDE, OUTPUT JCL, and SET. Optionally, a cataloged procedure can begin with a PROC statement and end with a PEND statement. If coded, PROC must be the first statement in the procedure.
Cataloging a Procedure
The library containing cataloged procedures is a partitioned data set (PDS) or a partitioned data set extended (PDSE). The system procedure library is SYS1.PROCLIB. The installation can have many more procedure libraries with different names. You can also have procedures in a private library. The name of a cataloged procedure is its member name or alias in the library. When a cataloged procedure is called, the calling step receives a copy of the procedure; therefore, a cataloged procedure can be used simultaneously by more than one job. If you are modifying a cataloged procedure, do not run any jobs that use the procedure during modification. In a JES3 system, you can specify UPDATE on the JES3 //*MAIN statement to update a procedure library.
3.Using a Procedure
To execute a procedure, call it on an EXEC statement in an in-stream job. Specify the name of the procedure in the PROC parameter of the EXEC statement. The step uses the JCL statements in the procedure as if the JCL statements appeared in the input stream immediately following the EXEC statement. If necessary, you can modify the procedure for the current execution of the job step. When you call a procedure, the system retrieves it using the following search order:
4.Testing a Procedure
Before putting a procedure into a system procedure library, you should test it. There are two ways to test a procedure:
After testing a procedure, the type of environment in which you are running the job determines where you can catalog it.
Cataloged and in-stream procedures are not checked for correct syntax until an EXEC statement that calls the procedure is checked for syntax. Therefore, a procedure can be tested only if an EXEC statement calls it.
IBM-JCL Related Interview Questions
|VSAM Interview Questions||IBM - VSAM Interview Questions|
|IBM-CICS Interview Questions||JCL Interview Questions|
|IBM DB2 Interview Questions||COBOL Interview Questions|
|DB2 Using SQL Interview Questions||IBM-JCL&VSAM Interview Questions|
|IMS/DB Interview Questions||Mainframe DB2 Interview Questions|
Job Control Statements
Job Control Tasks
Format Of Statements
Syntax Of Parameters
Procedures And Symbols
Jcl Command Statement.
Special Dd Statements
If/then/else/endif Statement Construct
Output Jcl Statement
Xmit Jcl Statement
Jes2 Control Statements
Jes3 Control Statements
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.