Hi,
As both catalogued procedure and Include statement works in the same way, kindly let me know How include differs from a catalogued procedure?
Only in the most limited (oversimplified) sense. . .As both catalogued procedure and Include statement works in the same way,
Bull! INCLUDEs will also be found in PROCLIBs.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.
About as clear as mud...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.
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!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.
and18.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.
Difference 1: an INCLUDE group cannot contain PROC or PEND whereas a procedure can contain them5.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.