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

PROC(Procedure) Usage


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

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Wed Aug 13, 2008 2:12 am
Reply with quote

I have to use the same PROC say PROC45 from 2 different JCLs say JC1 and JC2.

There is a symbolic parameter in PROC say TST,

the value in TST should be different when executed from different JCLs.

How should be the code in PROC--

PROC45 PROC

TST=TST,

OR


PROC45 PROC
TST=1,



when this is executed from different JCL, like


IN JC1--

EXEC PROC45, TST=1


IN JC2-

EXEC PROC45, TST=2.


Please let me know

I feel the first code for proc is right, please correct if iam wrong.

Thanks.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Aug 13, 2008 2:27 am
Reply with quote

You are not right nor wrong, You are just making wrong assumptions

the values to be assigned to the parameters of a procedure are to be chosen
according to the documentation

if Your procedure has been written with a formal parameter named TST,
when You invoke Your proc You should write something in the line ...

Code:

//S      EXEC  PROC=yourproc,TST=tst_value


the value to be used for the tst_value depends only on the way yourproc was written
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Wed Aug 13, 2008 2:45 am
Reply with quote

Example--

//SNDR015N PROC PROD=PROD,
// TRT=113N,
// PLR=PLR1

//step10 exec pgm=sdfg10

//INDBA6 DD DISP=SHR,
DSN=&PROD..FNG.KJGT1.SNDR&TRT..MKG

****************

********************************* Top of Data ************
//MNDR018N JOB (0000,0000),' Data valid',
// CLASS=5,PRTY=10,MSGCLASS=A
//*
// EXEC SNDR015N,TRT=113N
******************************** Bottom of Data **********

********************************* Top of Data ************
//MNDR019N JOB (0000,0000),' Data valid',
// CLASS=5,PRTY=10,MSGCLASS=A
//*
// EXEC SNDR015N,TRT=213N
******************************** Bottom of Data **********

My requirement is when both the jobs are executed then they should pass different values to PROC, so that in the file the value of TRT changes for different run.

Please check my PROC, what shall i give there for TRT?

Thanks.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Aug 13, 2008 2:58 am
Reply with quote

Hello,

In the PROC, you could specify some default value.

As you have provided a value in both EXEC statements, the value "in the PROC" will never be used, so the coded value will not matter.
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Wed Aug 13, 2008 8:29 am
Reply with quote

Thank you.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Aug 13, 2008 8:47 am
Reply with quote

You're welcome icon_smile.gif
Back to top
View user's profile Send private message
Bill Dennis

Active Member


Joined: 17 Aug 2007
Posts: 562
Location: Iowa, USA

PostPosted: Wed Aug 13, 2008 6:58 pm
Reply with quote

meenakshi,

you might want to omit the TST default value from the PROC so it never gets run with the wrong value by accident. This way it must always be in the execution JCL.
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 STEM usage in REXX CLIST & REXX 14
No new posts Invoke stored procedure via batch JCL. DB2 2
No new posts z/OS Modules Usage report using SMF 42 DFSORT/ICETOOL 2
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts Calling COBOL DB2 program from a COBO... COBOL Programming 2
Search our Forums:

Back to Top