Can we pass vlaue to a JCL from a file.

JES2/3, JCL, utilities.
Post Reply
alpna
Registered Member
Posts: 56
Joined: Fri Jun 21, 2013 10:35 pm

Can we pass vlaue to a JCL from a file.

Post 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.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

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

Post by William Collins »

No.

But you can generate the JCL from a program. You can use JCL Symbols. You can use your Scheduler.
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

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

Post 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.
Regards
Nic
User avatar
Anuj Dhawan
Founder
Posts: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

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

Post 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.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
alpna
Registered Member
Posts: 56
Joined: Fri Jun 21, 2013 10:35 pm

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

Post 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.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “JCL - Job Control Language.”