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 

Passing parameter to a jcl called by another job

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


Joined: 22 May 2007
Posts: 8
Topics: 3

PostPosted: Wed Jul 25, 2007 7:33 am    Post subject: Passing parameter to a jcl called by another job Reply with quote

Hi all

I need your help.

Assume job1 is going to be a scheduler which will receive the file names from unix box and trigger this job2.Please let me know how to pass the file name to job-2 ?

Code:

//Job1 JOB (0000,0000),TEST,CLASS=O,MSGCLASS=Y,REGION=0M 
//STEP050 EXEC PGM=IEBGENER                                   
//SYSPRINT DD SYSOUT=*                                       
//SYSUT1 DD DSN=PROD.JCL(JOB2),DISP=SHR             
//SYSUT2 DD SYSOUT=(A,INTRDR)                                 
//SYSIN DD DUMMY                                             


Job2 is like this:
Code:

//Job2 JOB (0000,0000),TEST,CLASS=O,MSGCLASS=Y,REGION=0M
//*                                                         
//MYPROCS  JCLLIB ORDER=(PROD.JOBLIB)     
//*                                                         
//SQR   EXEC PROCEDURE-1                                   
//STEP1.OUTPUT1  DD SYSOUT=*                             
//STEP1.SYSUT2   DD SYSOUT=*                             
//STEP1.SYSUT1 DD DSN=Input-file-from-job1,DISP=SHR   

Regards
Jai
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Jul 25, 2007 7:42 am    Post subject: Reply with quote

I'd have JOB1 write the entire required DD statement:

//STEP1.SYSUT1 DD DSN=THE.DATASET.NAME,DISP=SHR

to a specific member of a PDS. Then, I'd have JOB2 use that member as an INCLUDE statement instead of the current DD statement.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Wed Jul 25, 2007 11:50 am    Post subject: Reply with quote

I'd prefer it if the data from Unix came as a set dataset name then you would not need any 'magic' bits. Once it has been processed delete/archive it so that the next transmission does not fail or overwrite the previous transmission.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Wed Jul 25, 2007 3:07 pm    Post subject: Reply with quote

The way that Nic has described is the way that I have always done it.

The arrival of the dataset triggers a job via the schedular, which copies the original dataset to one suffixed with the logical run date, and it is that file which is used througout the remainder of the processing, where required.

The trigger dataset is always the same, and that way nothing changes which isn't easily controllable through the schedule package.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
jai79
Beginner


Joined: 22 May 2007
Posts: 8
Topics: 3

PostPosted: Tue Aug 07, 2007 4:24 am    Post subject: Reply with quote

NIC and Expat

Thanks for your reply, can you please show me the code changes i required
to do in the given example. Will be great help.

Regards
Jai
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Aug 07, 2007 12:39 pm    Post subject: Reply with quote

1) Change your transfer job to create the file as A.FIXED.NAME

2) Change your
Code:
//SYSUT1 DD DSN=Input-file-from-job1,DISP=SHR

in the procedure to:
Code:
//SYSUT1 DD DSN=A.FIXED.NAME,DISP=SHR


3) Add an IEBGENER/ICEGENER step at the end of the procedure to copy A.FIXED.NAME to A.FIXED.NAME.BKUP(+1)

4) Add an delete step to delete A.FIXED.NAME
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
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