IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

INCLUDE Vs JCLLIB


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Wed Aug 13, 2003 7:56 am
Reply with quote

Can anyone please explain the diff b/w INCLUDE statement & JCLLIB ststement... Please...
Back to top
View user's profile Send private message
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 237
Location: USA

PostPosted: Wed Aug 13, 2003 10:20 am
Reply with quote

Hello Priya,

INCLUDE

Purpose

1) Identify the name of the member of a partitioned data set (PDS) or partitioned data set extended (PDSE) that contains a set of JCL statements (such as DD and OUTPUT JCL statements) called an INCLUDE group.

2) Imbed the INCLUDE group in the JCL stream at the position of the INCLUDE statement.

3) The INCLUDE group replaces the INCLUDE statement, and the system processes the imbedded JCL statements as part of the JCL stream. The JCL statements, which are subject to all JCL processing rules, must be complete statements; that is, you cannot use an imbedded statement to continue the statement that precedes INCLUDE.


An INCLUDE statement:
Can appear anywhere in the job after the JOB statement, with one exception: if there is a JCLLIB statement, the INCLUDE statement must follow the JCLLIB
statement.

Must follow a complete JCL statement.

Can appear within an INCLUDE group. INCLUDE groups can contain INCLUDE statements and can be nested up to a maximum of 15 levels of nesting.

Cannot appear in a CNTL/ENDCNTL group, which contains program control statements delimited by the CNTL and ENDCNTL statements.

INCLUDE groups cannot contain the following JCL statements:
JOB statements
PROC and PEND statements
JCLLIB statements
JES2 and JES3 statements and commands
DD * and DD DATA statements

Do not define procedures in an INCLUDE group. However, you can put EXEC statements that invoke procedures in an INCLUDE group.

You can use INCLUDE statements to imbed INCLUDE groups that contain DD and OUTPUT JCL statements, which allows you to use the same data set definitions for
various jobs.

When the INCLUDE statement and the INCLUDE group contain symbolic parameters, the system substitutes the values that are current at the time the symbolic parameter is encountered. Values assigned to symbolic parameters in an INCLUDE group (such as with the SET statement) are valid for use on subsequent JCL statements.


Example 1

The following INCLUDE group is defined in member SYSOUT2 of private library CAMPBELL.SYSOUT.JCL.

//@ THIS INCLUDE GROUP IS CATALOGED AS...
//@ CAMPBELL.SYSOUT.JCL(SYSOUT2)
//SYSOUT2 DD SYSOUT=A
//OUT1 OUTPUT DEST=POK,COPIES=3
//OUT2 OUTPUT DEST=KINGSTON,COPIES=3)
//OUT3 OUTPUT DEST=MCL,COPIES=1)
//@ END OF INCLUDE GROUP...
//@ CAMPBELL.SYSOUT.JCL(SYSOUT2)

The system executes the following program:
//TESTJOB JOB ...
//LIBSRCH JCLLIB ORDER=CAMPBELL.SYSOUT.JCL
//STEP1 EXEC PGM=OUTRTN
//OUTPUT1 INCLUDE MEMBER=SYSOUT2
//STEP2 EXEC PGM=IEFBR14

The JCLLIB statement specifies that the system is to search private library
CAMPBELL.SYSOUT.JCL for the INCLUDE group SYSOUT2 before it searches
any system libraries.

After the system processes the INCLUDE statement, the JCL stream appears as:

//TESTJOB JOB ...
//LIBSRCH JCLLIB ORDER=CAMPBELL.SYSOUT.JCL
//STEP1 EXEC PGM=OUTRTN
//@ THIS INCLUDE GROUP IS CATALOGED AS...
//@ CAMPBELL.SYSOUT.JCL(SYSOUT2)
//SYSOUT2 DD SYSOUT=A
//OUT1 OUTPUT DEST=POK,COPIES=3
//OUT2 OUTPUT DEST=KINGSTON,COPIES=3)
//OUT3 OUTPUT DEST=MCL,COPIES=1)
//@ END OF INCLUDE GROUP...
//@ CAMPBELL.SYSOUT.JCL(SYSOUT2)
//STEP2 EXEC PGM=IEFBR14

The system imbeds the INCLUDE group in the JCL stream (replacing the INCLUDE statement), and processes the included JCL statements with the JCL stream.

Example 2

The following example shows the use of the SET statement to assign values to symbolic parameters in an INCLUDE group.

//@ THIS INCLUDE GROUP IS CATALOGED AS...
//@ LAMAN.SYSOUT.JCL(SYSOUT2)
//SYSOUT2 DD SYSOUT=A
//OUT1 OUTPUT DEST=POK,COPIES=3
//OUT2 OUTPUT DEST=&AA,COPIES=&NC
//OUT3 OUTPUT DEST=&BB,COPIES=1)
//@ END OF INCLUDE GROUP...
//@ LAMAN.SYSOUT.JCL(SYSOUT2)

The following program is executed.

//JOBA JOB ...
//LIBS JCLLIB ORDER=LAMAN.SYSOUT.JCL
//SET1 SET AA=KINGSTON,BB=STL,NC=1)
//STEP1 EXEC PGM=OUTRTN
//OUTPUT1 INCLUDE MEMBER=SYSOUT2
//STEP2 EXEC PGM=IEFBR14

The SET statement, which is easy to change for different jobs, assigns values to the symbolic parameters in INCLUDE group SYSOUT2.

After the system processes the INCLUDE statement, it executes the JCL stream as:

//JOBA JOB ...
//LIBS JCLLIB ORDER=LAMAN.SYSOUT.JCL
//STEP1 EXEC PGM=OUTRTN
//@ THIS INCLUDE GROUP IS CATALOGED AS...
//@ LAMAN.SYSOUT.JCL(SYSOUT2)
//SYSOUT2 DD SYSOUT=A
//OUT1 OUTPUT DEST=POK,COPIES=3
//OUT2 OUTPUT DEST=KINGSTON,COPIES=1)
//OUT3 OUTPUT DEST=STL,COPIES=1)
//@ END OF INCLUDE GROUP...
//@ LAMAN.SYSOUT.JCL(SYSOUT2)
//STEP2 EXEC PGM=IEFBR14

The system imbeds the INCLUDE group in the JCL stream (replacing the INCLUDE statement), and assigns the values to the symbolic parameters in the INCLUDE
group.




JCLLIB

Purpose:

1) Identify the names of the private libraries that the system uses for the job. The system searches the libraries for:
– Procedures named on any EXEC statements
– Groups of JCL statements (called INCLUDE groups) named
on any INCLUDE statements.

2) Identify the names of the system procedure libraries and installation-defined procedure libraries that the system uses for the job.

3) Identify the order in which the libraries are to be searched. The system searches the libraries in the order in which you specify them on the JCLLIB
statement, prior to searching any unspecified default system procedure libraries.

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.


A JCLLIB statement:
1) Must appear after the JOB statement and before the first EXEC statement in the job.
2) Must appear before any INCLUDE statement.
3) Must not appear within an INCLUDE group.


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:

1) The private library must be cataloged. However, the library cannot be cataloged in a catalog specified via a JOBCAT or STEPCAT DD statement.

2) The private library must be accessible to the job. The library must be
permanently resident and online.

3) The JCLLIB data set cannot be a password-protected data set.

4) The job must have read access to any system or private libraries specified on JCLLIB.

5) 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.



Example 1

//MYJOB1 JOB ...
//MYLIBS1 JCLLIB ORDER=CAMPBEL.PROCS.JCL
//S1 EXEC PROC=MYPROC1
.
.
The system searches the libraries for procedure MYPROC1 in the following order:

1. CAMPBEL.PROCS.JCL
2. SYS1.PROCLIB

Example 2

//MYJOB2 JOB ...
//MYLIBS2 JCLLIB ORDER=(CAMPBEL.PROCS.JCL,PUCHKOF.PROCS.JCL,
// YUILL.PROCS.JCL,GARY.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:
1. CAMPBEL.PROCS.JCL
2. PUCHKOF.PROCS.JCL
3. YUILL.PROCS.JCL
4. GARY.PROCS.JCL
5. SYS1.PROCLIB

Example 3

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:

1. SYS1.PROCLIB
2. CAMPBEL.PROCS.JCL
3. SYS1.PROCLIB (the system default procedure library is searched again)


This description you would have found in any JCL manual.
If you dont have one...send me your mail id...i will forward it to you.


Hope this helps..



Regards

Mayuresh
icon_lol.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Aug 14, 2003 6:19 am
Reply with quote

Hi priya,

Simply put, an INCLUDE in JCL is analogous to a COPYBOOK in a pgming language such as COBOL. It allows you to write code (in this case, JCL) once and use it many times and in many places throughout your JCL.

JCLLIB is analogous to a JOBLIB JCL stmt. Instead of pointing to an alternative load library that remains active for the length of the JOB, a JCLLIB stmt points to a JCL library to be used for the length of the JOB. All cataloged procedures referenced in a JOB are searched for in the JOB's JCLLIB. If a JCLLIB isn't provided, the default JCL library is searched. Using a JCLLIB gives you another way to test procs before they're moved to production.

Regards, Jack.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
This topic is locked: you cannot edit posts or make replies. Sort to include records of file 2 int... Java & MQSeries 1
No new posts INCLUDE COND with WHEN=GROUP SYNCSORT 12
This topic is locked: you cannot edit posts or make replies. include and copy COBOL Programming 4
No new posts include cond ascii constant DFSORT/ICETOOL 4
Search our Forums:

Back to Top