|
View previous topic :: View next topic
|
| Author |
Message |
sprikitik
New User

Joined: 29 Jan 2007 Posts: 61 Location: Makati City, Philippines
|
|
|
|
Hello,
I have a job (job1) that creates a file which contains a 4 digit code. I also have a second job (job2) that will take the file created in job1 as input. Whether or not steps in job2 will be executed will depend on the 4 digit code in the file. Can somebody please give me an idea on how to accomplish this?
Ex. File from job1 has 0000, step1 in job2 will be executed.
Thanks! |
|
| Back to top |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 774 Location: Denmark
|
|
|
|
Use DFSORT/ICETOOL
1) filter data selecting the record containing the code, output to a temporary dataset.
2) test for the temporary dataset being empty, setting return code accordingly. ICETOOL COUNTS function as I recall.
3) submit job2 from job1 if return code indicates code was found. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2286 Location: USA
|
|
|
|
| sprikitik wrote: |
Hello,
I have a job (job1) that creates a file which contains a 4 digit code. I also have a second job (job2) that will take the file created in job1 as input. Whether or not steps in job2 will be executed will depend on the 4 digit code in the file. Can somebody please give me an idea on how to accomplish this?
Ex. File from job1 has 0000, step1 in job2 will be executed.
Thanks! |
Method 1. Use DFSORT/ICETOOL/SYNCSORT
Filter-out records with required "code" into separate file. Use parameter(s) like NULLOFL=RC4 to indicate the presence of required "code" in the input file. Use RC from SORT step in JCL "// IF (SORTSTEP.RC EQ 0) THEN " - to execute, or to skip the //STEP1, or whatever.
Method 2. Use IEBCOMPR, or SUPERC, or any other Compare utility
Compare your "code file" with constant file, like this one:
All compare utilities I know return different RC in case the compared files are equal, or not. Next, use the same "// IF " as in Method 1 above.
Other methods can be easily invented using other available tools. |
|
| Back to top |
|
 |
|
|