MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Difference between JCL and a PROC

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
iknow
Beginner


Joined: 09 Jan 2006
Posts: 39
Topics: 15
Location: Inside the MATRIX

PostPosted: Fri Jan 13, 2006 3:57 am    Post subject: Difference between JCL and a PROC Reply with quote

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
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Jan 13, 2006 4:46 am    Post subject: Reply with quote

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
View user's profile Send private message
iknow
Beginner


Joined: 09 Jan 2006
Posts: 39
Topics: 15
Location: Inside the MATRIX

PostPosted: Fri Jan 13, 2006 6:46 am    Post subject: Reply with quote

Hi Phantom,

Thanks for your valuable information.
Back to top
View user's profile Send private message
John Corbin
Beginner


Joined: 23 Jan 2004
Posts: 38
Topics: 21

PostPosted: Mon Feb 11, 2008 7:14 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Feb 11, 2008 11:15 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Thu Feb 14, 2008 9:33 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group