Page 1 of 1

Can we pass vlaue to a JCL from a file.

Posted: Sun Sep 13, 2015 10:41 am
by alpna
Hi,

Consider this:

Code: Select all

//SYSPRINT DD SYSOUT=*
In above instead of hard coding the "*" I'd like to read a file and then put that value following star. Please help me in knowing if here is way to read a file from JCL and pass the file content to JCL which will be used as a parameter in the JCL.

Thanks for any help.

Re: Can we pass vlaue to a JCL from a file.

Posted: Sun Sep 13, 2015 11:51 am
by William Collins
No.

But you can generate the JCL from a program. You can use JCL Symbols. You can use your Scheduler.

Re: Can we pass vlaue to a JCL from a file.

Posted: Sun Sep 13, 2015 3:28 pm
by nicc
Consider this (a rather simplified, and possibly inaccurate, description of what happens):
Your JCL is read and then interpreted. The interpretation is the OS taking notes of your the programs and resources required in a format that the OS understands and your JCL is then discarded - BEFORE the job is run. Once the interpretation is done the values are FIXED.

Re: Can we pass vlaue to a JCL from a file.

Posted: Sun Sep 13, 2015 3:29 pm
by Anuj Dhawan
Hello,

I think if you can get your file in the form of a JCL INCLUDE statement, you can use it to set the "file" when your job is submitted.

File:

Code: Select all

//   SET MYFILE='*'
JCL:

Code: Select all

//MYPROCS  JCLLIB ORDER=(your.PDS)            
//*                                                  
//*                                                  
//* INCLUDE STATEMENT EXAMPLE - GET VALUES FROM JCLLIB 
//*                                                  
//STEP01  EXEC PGM=IEFBR14                            
//        INCLUDE MEMBER=member		
//SYSPRINT DD SYSOUT=&MYFILE
Hope this helps.

Re: Can we pass vlaue to a JCL from a file.

Posted: Tue Sep 22, 2015 3:21 pm
by alpna
Anuj Dhawan wrote:Hello,

I think if you can get your file in the form of a JCL INCLUDE statement, you can use it to set the "file" when your job is submitted.

File:

Code: Select all

//   SET MYFILE='*'
JCL:

Code: Select all

//MYPROCS  JCLLIB ORDER=(your.PDS)            
//*                                                  
//*                                                  
//* INCLUDE STATEMENT EXAMPLE - GET VALUES FROM JCLLIB 
//*                                                  
//STEP01  EXEC PGM=IEFBR14                            
//        INCLUDE MEMBER=member		
//SYSPRINT DD SYSOUT=&MYFILE
Hope this helps.

Thanks all - the JCL helps.