Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Stop Process when file is empty

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Stop Process when file is empty
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Jun 25, 2015 1:49 pm    Post subject: Reply to: Stop Process when file is empty
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Jun 25, 2015 2:30 pm    Post subject: Reply to: Stop Process when file is empty
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Jun 25, 2015 2:49 pm    Post subject: Reply to: Stop Process when file is empty
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us