Page 1 of 2

passing contents of Dataset as Parameter

PostPosted: Wed May 27, 2009 3:00 am
by zaino22
I have a Date as a content of the dataset within the JCL, and I want to pass this value as a parameter to another program? Is there any way I can do that?

Re: passing contents of Dataset as Parameter

PostPosted: Wed May 27, 2009 4:19 am
by dick scherrer
Hello,

Yes, create "new" jcl dynamically including the date from the dataset and submit this new jcl via the internal reader. The submitted jcl could have this date as the parm.

Re: passing contents of Dataset as Parameter

PostPosted: Fri May 29, 2009 8:48 am
by zaino22
Can you paste any samples with a bit of explanation? I'll appreciate it.

Re: passing contents of Dataset as Parameter

PostPosted: Fri May 29, 2009 9:42 am
by dick scherrer
Hello,

Think about the jcl you want to run. It will be a JOB, at least one EXEC with a parm, and some DD statements. Whatever this jcl, it should be the "sample" you generate.

I believe i also mis-read your initial post. Do you really want to use a dataset name as a parm to a program? When i read this originally, i thought you wanted to use a dataset name from a file in a dd statement (possibly using a symbolic parm.

Maybe it will help if you post the jcl you want to execute and explain where the parm comes in and how the parm would be used in the process.

Sorry for getting lost. . . :oops:

Re: passing contents of Dataset as Parameter

PostPosted: Thu Jun 04, 2009 10:50 pm
by zaino22
I want to read the contents of the dataset and pass the content as PARAMETER. Please provide an example of that sort, if it is possible to do in JCL.

thanks,

Re: passing contents of Dataset as Parameter

PostPosted: Fri Jun 05, 2009 12:02 am
by MrSpock
What is the RECFM and LRECL of the input dataset? What is the format and position of the data you need within that dataset? What is the required output dataset RECFM and LRECL?

Could you provide some examples of the input data format as well as the required output data format?

Re: passing contents of Dataset as Parameter

PostPosted: Sun Jul 26, 2009 5:41 am
by rajas.abcdefg
Hi,

I too have the similar problem.

For my issue, the Record length is 80. Date is in the format of DD/MM/YYYY.

Please advise me how can I get this..

Sample JCL's are apprcieable.

Re: passing contents of Dataset as Parameter

PostPosted: Sun Jul 26, 2009 6:41 am
by dick scherrer
Hello,

You need to show what you want - we have no idea of your requirement. How might we post "Sample JCL's" knowing nothing about your requirement. . .?

You also need to show what you "have" that is to be used getting to what you want.

Keep in mind that your request is completely clear to you, but may not be to others who read the request.

Most of the effort of the forums is getting the requirement properly defined. . . .

Re: passing contents of Dataset as Parameter

PostPosted: Sun Jul 26, 2009 11:02 pm
by rajas.abcdefg
I am trying to create a dataset with yesterday's date as the extension. So, by using sort card I have got the required date(i.e. yersterday's date) as below.

********************************* Top of Data **********************************
072509
******************************** Bottom of Data ********************************
Strictly using JCL, now I need to copy the contents of dataset(PROD.EMPLYO.FILE) of Rec Length 120 to the new dataset which as the above date in dataset name.

For e.g. My new dataset name has to looks as, DEVELOP.EMPLYO.FILE.Z072509 with the same disp parameters as that of PROD.EMPLYO.FILE

I think this information might help you.

Re: passing contents of Dataset as Parameter

PostPosted: Sun Jul 26, 2009 11:11 pm
by dick scherrer
Hello,

Strictly using JCL, now I need to copy the contents
Sorry - No, not a chance. . . . :? JCL cannot do this. JCL cannot copy - some program does.

Is there a second copy needed? Would changing the name of the original dataset accomplish what you need? If a copy is needed, which utility do you plan on using (suggest your sort product as the sort does this very well)?

You need to show all of the jcl you want executed, including the customized dataset name.