Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

PROC(Procedure) Usage

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: PROC(Procedure) Usage
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10231
Location: italy

PostPosted: Wed Aug 13, 2008 2:27 am    Post subject: Reply to: PROC(Procedure) Usage
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    Post subject: Reply to: PROC(Procedure) Usage
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

Site Director


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

PostPosted: Wed Aug 13, 2008 2:58 am    Post subject:
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    Post subject: Reply to: PROC(Procedure) Usage
Reply with quote

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

Site Director


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

PostPosted: Wed Aug 13, 2008 8:47 am    Post subject: Reply to: PROC(Procedure) Usage
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 6 Thu Oct 27, 2016 10:20 am
No new posts Is possible to call subprogram from c... cmsmoon COBOL Programming 3 Fri Aug 05, 2016 6:46 pm
This topic is locked: you cannot edit posts or make replies. Stored procedure on Federated thru DB2 arif677 DB2 6 Tue May 31, 2016 11:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us