IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Stop Process when file is empty


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Roland Brosio

New User


Joined: 26 Jul 2013
Posts: 7
Location: Germany

PostPosted: Thu Jun 25, 2015 1:20 pm
Reply with quote

hello,
I want to stop the process in icetool when dataset is empty and set return code 4
I am using the following code.
[/code]
SORT FROM(GESAIN) TO(ZWI1) USING(REPG)
SORT FROM(ZWI1) TO(GESAMT) USING(TOTA)

SORT FROM(KDIN) TO(ZWI1) USING(REPV)
SORT FROM(ZWI1) TO(KDREP) USING(TOTA)

SORT FROM(FITSIN) TO(ZWI1) USING(REPF)
SORT FROM(ZWI1) TO(FITSREP) USING(TOTA)

COUNT FROM(OTHIN) EMPTY
SORT FROM(OTHIN) TO(ZWI1) USING(REPO)
SORT FROM(ZWI1) TO(OTHREP) USING(TOTA)



in this example processing stops and the step ends with a return code 12
when I use count from(othin) empty rc4
I get the information that the dataset is empty but processing continues.
my question is.
how can I set return code 4 and stop further processing.

thanks for the answer.
[/quote][/list]
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10714
Location: italy

PostPosted: Thu Jun 25, 2015 1:49 pm
Reply with quote

unfortunately <sort> ( any flavour IIRC ) feels that it is it' s duty to read every record of all the input files icon_cool.gif

if the process is resource intensive
You might want to add one/more steps to check if any of the input files are empty
and skip the resource hogs
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Thu Jun 25, 2015 2:30 pm
Reply with quote

Instead of jamming everything into one step just so that you can use ICETOOL (or using ICETOOL just so you can jam everything into one step) make it separate steps. You can then set RC/CC to a (lmiited number of) values using NULLOUT and/or NULLOFL. Then you can test using a JCL IF (or COND).

This will also benefit you in restart situations.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

PostPosted: Thu Jun 25, 2015 2:49 pm
Reply with quote

As an aside, you probably have MODE STOP by default, from your description of the EMPTY giving you RC 12 and ending the step.

MODE STOP catches RC 8, 12 and 16.

If you change your EMPTY to RC8, you'll probably get what you think you want.
Back to top
View user's profile Send private message
Roland Brosio

New User


Joined: 26 Jul 2013
Posts: 7
Location: Germany

PostPosted: Thu Jun 25, 2015 4:33 pm
Reply with quote

thank you for the answer.
I solved it by splitting in 2 steps.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare the file record count percent... DFSORT/ICETOOL 2
No new posts compare two file to find position/dat... SYNCSORT 2
No new posts Converting a file from PD to display ... SYNCSORT 4
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
This topic is locked: you cannot edit posts or make replies. Write Character to Hexadecimal file w... COBOL Programming 8
Search our Forums:

Back to Top