Difference between Catalogued Procedure & Include Statement



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Difference between Catalogued Procedure & Include Statement

Postby shabukumar » Fri Jan 21, 2011 10:37 pm

Hi,

As both catalogued procedure and Include statement works in the same way, kindly let me know How include differs from a catalogued procedure?
Warm Regards
Shabukumar
Mainframe Trainer
What you learnt new in mainframe
shabukumar
 
Posts: 27
Joined: Thu Dec 18, 2008 4:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Difference between Catalogued Procedure & Include Statement

 

Re: Difference between Catalogued Procedure & Include Statem

Postby Bill Dennis » Fri Jan 21, 2011 11:06 pm

A cataloged procedure (PROC) is usually a complete job step or series of job steps and allow for supplying variable values on the call which are substituted into the inserted JCL. PROCs are called from a system-defined set of libraries.

INCLUDE is generally used for a subset of the job stream and can be found in user-specified libraries.
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Difference between Catalogued Procedure & Include Statem

Postby NicC » Sat Jan 22, 2011 12:03 am

They do NOT work in the same way. If you want an analogy with COBOL you could say the cobol program was the procedure and a copybook the included code. Of course, if you do not know COBOL that analogy is a waste of space!
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Difference between Catalogued Procedure & Include Statem

Postby dick scherrer » Sat Jan 22, 2011 2:51 am

Hello,

As both catalogued procedure and Include statement works in the same way,
Only in the most limited (oversimplified) sense. . .

Suggest you thoroughly read about Cataloged PROCedures . . . Both the creation of these as well as the execution.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Difference between Catalogued Procedure & Include Statem

Postby shabukumar » Sat Jan 22, 2011 1:36 pm

Thank you to all for your replies

Bill:
Yes, Catalogued procedures will be searched in the JCLLIBs and then in PROCLIBs by default. INCLUDE can be found in JCLLIBs only. However, using INCLUDE statement I can have a series of job steps. I can make use of symbolic parameters but not overriding parameters in INCLUDE. Kindly let me know if I am wrong and anything else left.

Nic:
I understood both not works in the same way. I mean that for both we are using JCLLIB statement for to locate the catalogued procedure and member to be included. Of Course, I know COBOL and already done with cobol program as a procedure. But the copybook you mean that the copy library. If yes, there is no relation between the INCLUDE statement of JCL and the copy lib. Because we are making use of LIB option and SYSLIB DD statement in the compiler. Kindly let me know am I clear.

Dick:

I thoroughly read about Catalogued PROCedures and done the hands on as well for both Catalogued procedure and Include statement. But I hope overriding parameter cannot be used in INCLUDE Statement. I am not sure. Kindly let me know.
Warm Regards
Shabukumar
Mainframe Trainer
What you learnt new in mainframe
shabukumar
 
Posts: 27
Joined: Thu Dec 18, 2008 4:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Difference between Catalogued Procedure & Include Statem

Postby prino » Sat Jan 22, 2011 6:21 pm

shabukumar wrote:Bill:
Yes, Catalogued procedures will be searched in the JCLLIBs and then in PROCLIBs by default. INCLUDE can be found in JCLLIBs only. However, using INCLUDE statement I can have a series of job steps. I can make use of symbolic parameters but not overriding parameters in INCLUDE. Kindly let me know if I am wrong and anything else left.
Bull! INCLUDEs will also be found in PROCLIBs.
shabukumar wrote:Nic:
I understood both not works in the same way. I mean that for both we are using JCLLIB statement for to locate the catalogued procedure and member to be included. Of Course, I know COBOL and already done with cobol program as a procedure. But the copybook you mean that the copy library. If yes, there is no relation between the INCLUDE statement of JCL and the copy lib. Because we are making use of LIB option and SYSLIB DD statement in the compiler. Kindly let me know am I clear.
About as clear as mud...
shabukumar wrote:Dick:
I thoroughly read about Catalogued PROCedures and done the hands on as well for both Catalogued procedure and Include statement. But I hope overriding parameter cannot be used in INCLUDE Statement. I am not sure. Kindly let me know.
If an INCLUDE contains symbolic parm, and it occurs in a PROC with the same, these symbolic parms will be used for the symbolics on the INCLUDE, you could very easily have tried this yourself!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

Re: Difference between Catalogued Procedure & Include Statem

Postby NicC » Sat Jan 22, 2011 8:44 pm

You did not seem to understand what I was illustrating: the INCLUDE in JCL includes other JCL, copying a COPYBOOK into a COBOL program copies other COBOL code and/or comments into a COBOL program. The idea is the same - they just work on different data in different environments.
Is what I posted before now clear to you?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Difference between Catalogued Procedure & Include Statem

Postby shabukumar » Mon Jan 31, 2011 7:32 pm

Nicc,

The same you provided now was the same I told.

Friends,

Kindly let me know how exactly include statement differ from catalogued procedure as I am now into lot more confusion. I would be grateful to you. Please help.
Warm Regards
Shabukumar
Mainframe Trainer
What you learnt new in mainframe
shabukumar
 
Posts: 27
Joined: Thu Dec 18, 2008 4:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Difference between Catalogued Procedure & Include Statem

Postby Robert Sample » Mon Jan 31, 2011 7:50 pm

INCLUDE groups and procedures are very similar. From the JCL Reference manual:
18.1.7 Considerations for Using INCLUDE Groups

System and private libraries can contain both procedures and INCLUDE groups. The order in which the system searches system and private libraries for INCLUDE groups is the same as the search order used for procedures (see "Using a Procedure" in topic 5.1.3).

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.
and
5.1.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:



From the input stream
If the called procedure is an in-stream procedure, the system retrieves it from the job input stream. You must place the in-stream procedure before the EXEC statement that calls it.


From a private library
If the called procedure is cataloged in a private library, the system retrieves it from the private library that you specify on the JCLLIB statement that appears earlier in the job stream.


From the system library (in a non-APPC scheduling environment)
If the called procedure is cataloged in a system library, the subsystem retrieves it as follows:


In JES2, from the library name on the PROCLIB= parameter on a JES2 /*JOBPARM statement. See "/*JOBPARM Statement" in topic 27.3 for more information.
In JES3, from the library name on the PROC= parameter of the JES3 //*MAIN statement. See "//*MAIN Statement" in topic 28.8 for more information.
In MSTR, the data set specified by the IEFPDSI DD statement in the currently active master JCL is searched for procedures. The default master JCL specifies SYS1.PROCLIB.
Difference 1: an INCLUDE group cannot contain PROC or PEND whereas a procedure can contain them
Difference 2: an INCLUDE group must be external whereas a procedure can be in-stream
Difference 3: procedures are allowed to include JES statements and INCLUDE groups cannot

These aren't the only differences but they're enough to clarify the issue.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Difference between Catalogued Procedure & Include Statem

Postby shabukumar » Mon Jan 31, 2011 9:09 pm

Thanks for your reply Robert.

All I know except difference 3. I think I am expecting the 3rd difference. If you dont mind, Kindly provide me the samples for JES statements so that I can be clear on it. Will be thankful to you.
Warm Regards
Shabukumar
Mainframe Trainer
What you learnt new in mainframe
shabukumar
 
Posts: 27
Joined: Thu Dec 18, 2008 4:15 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post