How to Override Procedures in JCL

Here are prime ideas on overriding cataloged procedure values in the mainstream JCL.

1.Instream Procedures

  • Instream procedures are identical to cataloged procedures except that you place them right along with the job in the input stream, immediately following the JOB statement, rather than as members of partitioned data sets.
  • You might use instream procedures to test JCL before placing it in a cataloged procedure.
  • You might also use them as your own procedure library without the bother of placing them in a partitioned data set.

2. Cataloged Procedures

  • You can change procedures in two ways: by overriding them (EXEC, DD, and OUTPUT statements only) or by assigning values to symbolic parameters on either the EXEC or SET statement.
  • For example, a procedure to copy a disk dataset onto tape might use a symbolic parameter for the disk data set name and the tape volume serial number. These values would likely change each time you invoke the procedure, and it would be nice to make it easy to change the JCL.
  • The best example to override DD name //PROCSTEPNAME.DDNAME=[DATASET NAME],DISP=SHR
  • Symbolic parameters do this. You give a value a symbolic name, you can set default values within the procedure, and you can supply a different value when you code the EXEC statement invoking the procedure.
  • Symbolic parameters provide a means of generalizing JCL; another reason for creating procedures.
  • The INCLUDE statement provides further generality when placed in a cataloged procedure by naming a member of a partitioned data set containing statements to copy in where the INCLUDE statement is placed.

Statements That are Allowed in Procedures

  • EXEC statement
  • IF/THEN/ELSE/ENDIF statement construct
  • DD statement. (But not DD * or DD DATA)
  • OUTPUT statement
  • SET statement
  • INCLUDE statement
  • Comments statements (//*)

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.