View previous topic :: View next topic
|
Author |
Message |
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 148 Location: India
|
|
|
|
Hi All,
My requirement I have two file and i want to check if either of the file has data i want to execute the 2nd step, How i can do it in 2 step?
Step1> Need to check two files and if any of the file has data step 2 shoud run
Step2>shoudd run if above any file has data.
Kindly suggest if any way to do it in two steps i am thinking of concatinating both file and see if output file has data or not ,please suggest.
Thanks |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Use JCL IFTHEN to test for previous JCL CONDs and let step two run if conditions are met.
You will find more than one sample how to test for empty DSNs. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
And in case you don't know how to check for an empty dataset, here is one method using SORT (well ICETOOL to be precise):
Code: |
//* COUNT .. EMPTY|NOTEMPTY -> RC 12 IF CONDITION IS MET
//C1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//DD1 DD DISP=SHR,DSN=dataset
//TOOLIN DD *
COUNT FROM(DD1) EMPTY |
|
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Willy Jensen wrote: |
And in case you don't know how to check for an empty dataset, here is one method using SORT (well ICETOOL to be precise):
Code: |
//* COUNT .. EMPTY|NOTEMPTY -> RC 12 IF CONDITION IS MET
//C1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//DD1 DD DISP=SHR,DSN=dataset
//TOOLIN DD *
COUNT FROM(DD1) EMPTY |
|
Code: |
//METHOD#1 EXEC PGM=IDCAMS <* RC4 | RC0
//IDD DD DISP=OLD,DSN=..
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT IFILE(IDD) COUNT(1)
/* |
|
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Lines to code should be at a very minimal level for such a task. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Many ways to do get the same thing , 1-2 lines extra shouldn’t be a problem but at least one would know the way.
Setting up RC-12 may not be a good option as it may considered as abend in scheduling but up to RC - 4 is mostly acceptable code set up for any job but if not then TS needs to make that additional change to allow RC-4 acceptable in scheduling. |
|
Back to top |
|
|
|