I have a new query, a bit different, i'll try to explain it to you.
1. I have chained three jobs Job1, Job2 and Job3
Job1 is submitted which at the end if the maxcc of Job1 = 0 will submit Job2 and so on. I have set this up and currently it is working fine.
2. Now, in job1 there is a condition as illustrated below:
-----------------------------------------------------------------------------------
=========JOB1========
job1step1
job1step2
job1step3
i am searching for a string '123456' in a dataset JOB1.OUTPUT at this step.
job1submit
If string is found submit the next job that is Job2.
(this is wrking fine currently..no issue here)
=========JOB2========
job2step1
job2step2
job2step3
i am searching for a string '123456' in a dataset JOB2.OUTPUT at this step.
job2submit
If string is found submit the next job that is Job3.
(this is also wrking fine currently..no issue here)
-------------------------------------------------------------------------------------
The Issue:
1. The string '123456' is actually a transaction number which is processed in this chain of three jobs.
2. This can be any 6 digit number. Every time while running this chain that i have made, i have to enter this string in the INCLUDE statement in ICETOOL used for searching in each job.
Like : open the job JOB1 and give the string in its include statement, open job JOB2 and give the same string in the INCLUDE statement and so on for JOB3 also.
The Question:
Is there anyway i can point the INCLUDE statemnt of next job to the INCLUDE statemnt for the first job?
Like : open the job JOB1 and give the string in its include statement, point the INCLUDE statmnt of job2 to that of job1 so that i dun have to repreatedly enter the same string for job2 and job3 ?
Bottomline: Something like the "referback technique"
Please let me know if the doubt is clear,
Thanks in Advance
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Here are two suggestions:
1) Put the INCLUDE statement in a RECFM=FB/LRECL=80 data set that all three jobs can use.
If all three sets of control statements are identical, you can put them all in the data set. For example:
Put the control statements in FileA, e.g.
Code:
OPTION COPY
INCLUDE COND=(...)
Then use FileA as the control statement data set wherever needed, e.g.
//SYSIN DD DSN=... FileA
If all three sets of control statements are not identical, you can just put the INCLUDE statement in FileA and then use it where needed with concatenation, e.g.
2) If the only thing in your control statements that changes is the INCLUDE constant, set it up as a DFSORT Symbol so you can use it wherever it's needed.
Set up FileA as a RECFM=FB/LRECL=80 data set with:
Hi Frank,
I am using the following piece of code for searching a string in the dataset. This piece of code as i previously mentioned is comon in Job2 and Job3:
Hi Frank,
As per your suggestion i have created a dataset MYTSO.MYCTL of RECFM=FB/LRECL=80.
=======MYTSO.MYCTL===========
INCLUDE COND=(1,140,SS,EQ,C'143250')
OUTFIL FNAMES=T1
===========================
I used it in the code as follows:
___________________________________
//*
//SEARCH EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=INPUT.DATA,DISP=SHR
//T1 DD DSN=&&T1,DISP=(NEW,PASS),UNIT=VIO
//TOOLIN DD DATA
COPY FROM(IN) USING(CTL1)
COUNT FROM(T1) EMPTY
/*
//CTL1CNTL DD DSN=MYTSO.MYCTL,DISP=SHR
/*
//*
_______________________________________________
But, when i ran the job, this step gave me a return code of 16.
As per my understanding, if the string is not present it shud have given 12, but the string was present in the output dataset.
What can be the reason for 16 return code. Am i missing anything here?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
The return code 16 is accompanied by an error message (ICExxxA) in //DFSMSG that tells you what you did wrong. If you can't figure out what's wrong from the //DFSMSG messages, post them and I'll help you.
Note that if you actually coded the INCLUDE and OUTFIL statements without a leading blank, then that would be the error - you need to include a leading blank for ALL DFSORT statements.