View previous topic :: View next topic |
Author |
Message |
iknow Beginner
Joined: 09 Jan 2006 Posts: 39 Topics: 15 Location: Inside the MATRIX
|
Posted: Fri Jan 13, 2006 3:57 am Post subject: Difference between JCL and a PROC |
|
|
Hi All,
Please clarify my doubt.
1) What is the difference between JCL and a PROC?
2) Can I execute a PROC?
Correct me if I am wrong. |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Fri Jan 13, 2006 4:46 am Post subject: |
|
|
iKnow,
JCL defines how a job is executed on the mainframe. A job may perform many steps or execute many programs in order to produce the requested information or output. If a segment of JCL is used repeatedly it may be coded once as a PROC (or JCL Procedure) and then used by many different steps within the job. There are two approaches to defining and using PROC's.
The PROC may be defined within the job (this is referred to as an In-stream PROC). If the segment of JCL code being defined as a PROC is unique to a single job then this approach is a very good alternative. An instream PROC should be defined first in the JCL before the EXEC statement that will reference the PROC. An instream PROC must start with a PROC statement and be terminated with a PEND statement. The PEND is not required if the PROC is stored as a separate member in a library.
The PROC may be defined as a separate member and stored in a separate library (i.e. PDS). If the segment of JCL code being defined as a PROC will be used by different jobs then this approach should be used.
At execution time when an EXEC statement references a PROC the PROC source code will be copied into the job and executed as if it is part of the JCL.
If you store a PROC in a library (i.e. Proc Library or ProcLib) the ProcLib must be known to the system. Most systems will search a list of pre-defined ProcLibs to find a PROC. If a PROC is stored in a library that is not in the pre-defined then the PROC will not be found. To specifiy additional PROC libraries to be searched use the JCLLIB statement.
for more information, refer this manual
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B631/CCONTENTS?DT=20030423085347
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B510/CCONTENTS?DT=20010626133938
Cheers,
Phantom |
|
Back to top |
|
 |
iknow Beginner
Joined: 09 Jan 2006 Posts: 39 Topics: 15 Location: Inside the MATRIX
|
Posted: Fri Jan 13, 2006 6:46 am Post subject: |
|
|
Hi Phantom,
Thanks for your valuable information. |
|
Back to top |
|
 |
John Corbin Beginner
Joined: 23 Jan 2004 Posts: 38 Topics: 21
|
Posted: Mon Feb 11, 2008 7:14 am Post subject: |
|
|
Phantom wrote: | iKnow,
JCL defines how a job is executed on the mainframe. A job may perform many steps or execute many programs in order to produce the requested information or output. If a segment of JCL is used repeatedly it may be coded once as a PROC (or JCL Procedure) and then used by many different steps within the job. There are two approaches to defining and using PROC's.
The PROC may be defined within the job (this is referred to as an In-stream PROC). If the segment of JCL code being defined as a PROC is unique to a single job then this approach is a very good alternative. An instream PROC should be defined first in the JCL before the EXEC statement that will reference the PROC. An instream PROC must start with a PROC statement and be terminated with a PEND statement. The PEND is not required if the PROC is stored as a separate member in a library.
The PROC may be defined as a separate member and stored in a separate library (i.e. PDS). If the segment of JCL code being defined as a PROC will be used by different jobs then this approach should be used.
At execution time when an EXEC statement references a PROC the PROC source code will be copied into the job and executed as if it is part of the JCL.
If you store a PROC in a library (i.e. Proc Library or ProcLib) the ProcLib must be known to the system. Most systems will search a list of pre-defined ProcLibs to find a PROC. If a PROC is stored in a library that is not in the pre-defined then the PROC will not be found. To specifiy additional PROC libraries to be searched use the JCLLIB statement.
for more information, refer this manual
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B631/CCONTENTS?DT=20030423085347
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IEA2B510/CCONTENTS?DT=20010626133938
Cheers,
Phantom |
HI...
Intereting article but I have a further question if I may...
Can a PROC have multiple steps ? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Feb 11, 2008 11:15 am Post subject: |
|
|
John Corbin,
A Proc can contain multiple steps and the maximum no: of steps is 255 _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Thu Feb 14, 2008 9:33 am Post subject: |
|
|
To clarify kolusu's response, the 255 step maximum is for the whole job. If your PROC has 255 steps it would be the only EXEC in the JOB. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity. |
|
Back to top |
|
 |
|
|