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 

Value in dataset passed as a PARM to the JCL steps

 
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
to_agrawals
Beginner


Joined: 12 Dec 2002
Posts: 26
Topics: 16

PostPosted: Thu Sep 01, 2005 12:09 pm    Post subject: Value in dataset passed as a PARM to the JCL steps Reply with quote

This can be best explained as an example. Suppose there is a dataset ABC.DEF.GHI.JKL has a numeric number 5000 in it.

I need to pass this value to the instream data in a JCL in more than 1 step. This insteam data is nothing but a SQL call to the Teradata. This basically means, every time we want to change this value, no code changes are required, we just EDIT the dataset.

Is there a way out for this? Sad
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Sep 01, 2005 1:07 pm    Post subject: Reply with quote

Let us assume that you have a proc named MYPROC like shown below in the pds named USERID.PDS.PROCLIB

Code:

//MYPROC  PROC                               
//*                                         
//STEP0100 EXEC PGM=IEFBR14                 
//FILEONE  DD DSN=USERID.FILE&NUM1..OUT,     
//            DISP=(NEW,CATLG,DELETE),       
//            UNIT=SYSDA,                   
//            SPACE=(CYL,(2,2),RLSE)         
//*                                         
//STEP0200 EXEC PGM=IEFBR14                 
//FILEONE  DD DSN=USERID.NEW&NUM1..OUT,     
//            DISP=(NEW,CATLG,DELETE),       
//            UNIT=SYSDA,                   
//            SPACE=(CYL,(2,2),RLSE)         


Now you want to pass the NUM1 value from a file which in this case is 5001.

So we read the file and create a SET statement which will be used to substitute the symbolic NUM1
Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
5001
//SORTOUT  DD DSN=USERID.PDS.PROCLIB(SETVAL)
//            DISP=OLD
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTREC FIELDS=(C'//  SET NUM1=',1,4,80:X)
/*


Now include the above member in your JCL

Code:

//MYPROCS JCLLIB ORDER=USERID.PDS.PROCLIB
//        INCLUDE MEMBER=SETVAL                 
//S1      EXEC  MYPROC
/*


Then your symbolic(num1) is substituted with the value 5001.

Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Sep 01, 2005 1:24 pm    Post subject: Reply with quote

kolusu, judging from the title of the original post, I would agree that you are right on the money. However, judging from the actual content of the post, it appears to me that the O/P wished to include the numeric value within some instream data. In which case, I wonder why the O/P doesn't just include the dataset into the instream concatenation:

Code:

//SYSIN DD *
instream data......
instream data......
/*
//          DD DISP=SHR,DSN=ABC.DEF.GHI.JKL
//          DD *
more instream data.....
more instream data.....
/*
Back to top
View user's profile Send private message
to_agrawals
Beginner


Joined: 12 Dec 2002
Posts: 26
Topics: 16

PostPosted: Thu Sep 01, 2005 2:03 pm    Post subject: Reply with quote

Sorry if I confused. Here is what I want:

Code:

//MWWZ013  JOB (PR,99,2,40,0),'XCXCXCXC',
//          CLASS=6,
//          MSGCLASS=X
//* *****************************************************
//* THIS JOB RUNS MULTILOAD FOR THE PRELIMINARY INVOICE L
//* *****************************************************
//DWWZ003 EXEC DWWZ003,
//* *****************************************************
//BTEQ01.SYSIN DD DSN=PM00.TERADATA.LOGON.PROD,DISP=SHR
//             DD *
EXEC LDWMETRICS.BEGIN_STATS('5000');
/*
//*******************************************************


This means that that instead of hard coding the value 5000(as I have done), what I need is to pass it as a parameter. I have an option to store it in a dataset or PDS member.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Sep 01, 2005 2:15 pm    Post subject: Reply with quote

to_agrawals,

Try this job.

Code:

//MWWZ013  JOB (PR,99,2,40,0),'XCXCXCXC',
//          CLASS=6,
//          MSGCLASS=X
//*******************************************************
//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
5000
//SORTOUT  DD DSN=DYMANIC CARD FILE,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(TRK,(1,0),RLSE)
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTREC FIELDS=(C'EXEC LDWMETRICS.BEGIN_STATS(',
                 C'''',
                 1,4,
                 C'''',
                 C');',
                 80:X)
/*
//* *****************************************************
//* THIS JOB RUNS MULTILOAD FOR THE PRELIMINARY INVOICE L
//* *****************************************************
//DWWZ003 EXEC DWWZ003,
//* *****************************************************
//BTEQ01.SYSIN DD DSN=PM00.TERADATA.LOGON.PROD,DISP=SHR
//             DD DSN=DYNAMIC CARD FILE,DISP=SHR
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Sep 02, 2005 1:28 am    Post subject: Reply with quote

Why does it need to be instream? Why not just use a dd statement that references your control card(s) or whatever it is you want to pass? If you try to do these bizzare gyrations to avoid the standard allocation technique of JCL, no one will ever be able to understand what you've done.
Back to top
View user's profile Send private message Visit poster's website
Arun Tomer
Beginner


Joined: 24 Aug 2005
Posts: 3
Topics: 0
Location: Global !!!

PostPosted: Thu Sep 08, 2005 5:21 am    Post subject: Reply with quote

From where you want to receive the value of that parameter, which you need to pass. If ,for example, it is in some date form and you are using jobtrac, you can even use directly some of the features of that utilitity to retrieve the value and hence pass it (I just gave an example). I think you do not want to manually edit the value of that parameter field at any point of time. If this is the case, how to do that will totally depend upon from where you are picking up that parameter value.
Back to top
View user's profile Send private message Yahoo Messenger
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