How to skip icetool operations based on RC

IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

How to skip icetool operations based on RC

Postby Eswarbabu » Tue Dec 27, 2011 12:51 pm

Hi,

Do we have the facility to use conditional statements in ICETOOL?

(say) IF 'RC of my icetool operation is zero' then
perform a set of icetool operations
else
terminate (do not process the rest of icetool operations)
endif

My concern is, i have to check whether a dataset is empty (used: count operator) and if it is not empty, proceed with the next set of icetool operations, else, terminate the program.
You do not have the required permissions to view the files attached to this post.
Eswarbabu
 
Posts: 9
Joined: Tue Dec 27, 2011 12:29 pm

Re: How to skip icetool operations based on RC

Postby BillyBoyo » Tue Dec 27, 2011 1:45 pm

If the purpose of the COUNT is to determine that the file is empty, why don't you put it in a seperate step and the use the RC to conditionally execute the other commands in the original step without the COUNT?
BillyBoyo
Global moderator
 
Posts: 3052
Joined: Tue Jan 25, 2011 12:02 am

Re: How to skip icetool operations based on RC

Postby Eswarbabu » Tue Dec 27, 2011 2:14 pm

@BillyBoyo

Thanks for your response. The screenshot which is provided here has only one count operation But in our code, we have 4 to 5 datasets which are to be validated against the empty check.

My requirement is, can we employ a conditional statement when satisified should perform a couple of Icetool operations.
Eswarbabu
 
Posts: 9
Joined: Tue Dec 27, 2011 12:29 pm

Re: How to skip icetool operations based on RC

Postby BillyBoyo » Tue Dec 27, 2011 2:21 pm

How do you want the thing to operate? All files must have data? Put four or five steps. Some files can be empty? Explain the criteria please.
BillyBoyo
Global moderator
 
Posts: 3052
Joined: Tue Jan 25, 2011 12:02 am

Re: How to skip icetool operations based on RC

Postby Eswarbabu » Tue Dec 27, 2011 2:32 pm

@BillyBoyo

I get 5 datasets. Yes, 1 or more datasets can be empty. I have to validate each and every dataset before performing a set of icetool operations.

Even i thought about employing five different steps. But, i just want to know, if there is any way to reduce the processing by handling it in the icetool code itself.

Thanks :)
Eswarbabu
 
Posts: 9
Joined: Tue Dec 27, 2011 12:29 pm

Re: How to skip icetool operations based on RC

Postby skolusu » Tue Dec 27, 2011 11:33 pm

Eswarbabu,

You need to use the MODE operator to Stop or continue processing operators after a return code of 8 , 12 or 16. Count operator returns a returns code 12 for an empty file. So the subsequent operators will not executed.

try this example. This will bypass the last copy operation as the file is empty

Code: Select all
//STEP0100 EXEC PGM=ICETOOL     
//TOOLMSG  DD SYSOUT=*           
//DFSMSG   DD SYSOUT=*           
//IN       DD *                 
//OUT      DD SYSOUT=*           
//TOOLIN   DD *                 
  MODE STOP                     
  COUNT FROM(IN) EMPTY           
  COPY  FROM(IN) TO(OUT)         
//*


Now add a record to input file and re-run the same job and you will notice that the last copy operator gets executed.

Code: Select all
//STEP0100 EXEC PGM=ICETOOL         
//TOOLMSG  DD SYSOUT=*               
//DFSMSG   DD SYSOUT=*               
//IN       DD *                     
ABC                                 
//OUT      DD SYSOUT=*               
//TOOLIN   DD *                     
  MODE STOP                         
  COUNT FROM(IN) EMPTY               
  COPY  FROM(IN) TO(OUT)             
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
Global moderator
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post