View previous topic :: View next topic |
Author |
Message |
jai79 Beginner
Joined: 22 May 2007 Posts: 8 Topics: 3
|
Posted: Wed Jul 25, 2007 7:33 am Post subject: Passing parameter to a jcl called by another job |
|
|
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 |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Wed Jul 25, 2007 7:42 am Post subject: |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Jul 25, 2007 11:50 am Post subject: |
|
|
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 |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Wed Jul 25, 2007 3:07 pm Post subject: |
|
|
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 |
|
 |
jai79 Beginner
Joined: 22 May 2007 Posts: 8 Topics: 3
|
Posted: Tue Aug 07, 2007 4:24 am Post subject: |
|
|
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 |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Aug 07, 2007 12:39 pm Post subject: |
|
|
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 |
|
 |
|
|