Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Execute JCL step based on the content of a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sprikitik

New User


Joined: 29 Jan 2007
Posts: 59
Location: Makati City, Philippines

PostPosted: Tue Oct 03, 2017 10:03 am    Post subject: Execute JCL step based on the content of a file
Reply with quote

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
View user's profile Send private message

Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 212
Location: Denmark

PostPosted: Tue Oct 03, 2017 1:32 pm    Post subject:
Reply with quote

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
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 323
Location: Maryland

PostPosted: Wed Oct 04, 2017 12:39 am    Post subject: Re: Execute JCL step based on the content of a file
Reply with quote

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:
Quote:
//CONST DD *
0000
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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts finding anydata between positions of ... ram_vizag SYNCSORT 13 Tue Jul 17, 2018 9:14 pm
No new posts KSDS file fields update by passing va... Anil Kumar Prajapati TSO/ISPF 5 Wed Jul 11, 2018 5:59 am
No new posts Comparing inside same file vickey_dw DFSORT/ICETOOL 2 Tue Jul 10, 2018 9:51 pm
No new posts LIST NODE DIRECTORY - db2 clp - tryin... elixir1986 IBM Tools 1 Sat Jul 07, 2018 6:15 pm
No new posts INCLUDE 2 conditions to copy in the o... Chiku kumar DFSORT/ICETOOL 10 Tue Jul 03, 2018 7:11 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us