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
 
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: 10350
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: 7315

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: 7315

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 VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am

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