The JCLLIB statement allows you to code and use procedures and INCLUDE groups in a private library without the need to use system procedure libraries. You can code only one JCLLIB statement per job.
//[name] JCLLIB ORDER=(library[,library]...) [comments]
The JCLLIB statement consists of the characters // in columns 1 and 2 and four fields: name, operation (JCLLIB), keyword parameter (ORDER), and comments.
If only one library is listed in the search order, the parentheses are optional. For example:
//MYLIB JCLLIB ORDER=MY.PROC1
Library names can be enclosed in apostrophes, for example:
//MYLIB JCLLIB ORDER=(’MY.PROC1’,’MY.PROC2’)
You can continue the list of libraries to the following statement by breaking the statement after a comma in the list, and continuing the list on the next statement, beginning in any column from 4 to 16. For example:
//MYLIB JCLLIB ORDER=(MY.PROC1,MY.PROC2,MY.PROC3)
You can continue a parameter enclosed in quotes by breaking the parameter in column 71 and continuing the parameter in column 16 of the next statement.
//MYLIB JCLLIB ORDER=(’MY.PROC1’,’MY.PROC2’,’MY.PROC3’,’MY.PROC4’
A name is optional on a JCLLIB statement. If used, code it as follows:
- The name must begin in column 3.
- The name is 1 through 8 alphanumeric or national ($, #, @) characters.
- The first character must be alphabetic or national ($, #, @).
- The name must be followed by at least one blank.
- The name may be preceded by up to 8 aphanumeric or national characters, and then separated by a period. Coding the name in this way should not be confused with specifying an override, as can be done when coding DD statements.
If a name is not coded, column 3 must be blank.
The operation field consists of the characters JCLLIB and must be preceded and followed by at least one blank. It can begin in any column.
The JCLLIB statement contains one keyword parameter:
Specifies the names of the libraries to be searched. The maximum number of libraries that may be specified is 15. You can specify private libraries, system procedure libraries, and installation-defined procedure libraries. The system searches the libraries in the order in which you specify them, before it searches any unspecified default system procedure libraries.
Do not specify a library that is a temporary data set (&&dsname), partitioned data set if a member name is included, or relative generation number for a GDG.
Note: GDGs are not supported.
The comments field follows the parameter field after at least one intervening blank.
6.Location in the JCL
A JCLLIB statement:
- Must appear after the JOB statement and before the first EXEC statement in the job.
- Must appear before any INCLUDE statement.
- Must not appear within an INCLUDE group.
7.Considerations for Using the JCLLIB Statement
You can specify only one JCLLIB statement in a job. The system and private libraries that you specify on the JCLLIB statement can contain both procedures and INCLUDE groups. The private libraries that you specify on the JCLLIB statement must comply with the following rules:
- The private library must be cataloged. However, the library cannot be cataloged in a catalog specified via a JOBCAT or STEPCAT DD statement.
- The private library must be accessible to the job. The library must be permanently resident and online.
- The JCLLIB data set cannot be a password-protected data set.
- The job must have read access to any system or private libraries specified on JCLLIB.
- The private library must have the same data set attributes as a system library, which are:
– Logical record length of 80 bytes (LRECL=80)
– Fixed length records (RECFM=F or RECFM=FB). If the JCLLIB data set is a PDSE, the record format can only be RECFM=FB.
– When multiple libraries are specified on the JCLLIB statement, these libraries will be concatenated.
8.Examples of the JCLLIB Statement
Note: For each example, assume that the system default procedure library includes SYS1.PROCLIB only. If you do not specify the JCLLIB statement, then the system searches only SYS1.PROCLIB.
//MYJOB1 JOB ...
//MYLIBS1 JCLLIB ORDER=CAMPBEL.PROCS.JCL
//S1 EXECP ROC=MYPROC1
The system searches the libraries for procedure MYPROC1 in the following order:
//MYJOB2 JOB ...
//MYLIBS2 JCLLIB ORDER=(CAMPBEL.PROCS.JCL,PUCHKOF.PROCS.JCL,
//S2 EXEC PROC=MYPROC2
//INC2 INCLUDE MEMBER=MYINC2
The system searches the libraries for procedure MYPROC2 and INCLUDE group MYINC2 in the following order:
You can specify a system procedure library.
//MYJOB3 JOB ...
//MYLIBS3 JCLLIB ORDER=(SYS1.PROCLIB,CAMPBEL.PROCS.JCL)
//S3 EXEC PROC=MYPROC3
The system searches the libraries for procedure MYPROC3 in the following order:
- SYS1.PROCLIB (the system default procedure library is searched again)