Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Using ICETOOL set return code as per condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Bhuvana Narasimhan

New User


Joined: 22 Aug 2019
Posts: 4
Location: India

PostPosted: Fri Jan 24, 2020 12:58 pm    Post subject: Using ICETOOL set return code as per condition
Reply with quote

Hi,

I am trying to set the return code using ICETOOL. If the dataset contains only header, trailer and no detail record then return 00 , other case is if the dataset has header, trailer and detail record return 04.

Input dataset:
Code:
 ****** ***************************** Top of
 000001 H-MTU TRIAL UNIQUE   20200108001
 000002 XXXX1234
 000003 BBBB1234
 000004 T-MTU 0003 


I ran the below code:
Code:
//*************************************************************/
 //S2      EXEC PGM=ICETOOL                                     
 //INDD    DD DSN=TPAR.M26.TAS.TRIAL.ADJS.UPLOADS.TEST,DISP=SHR 
 //TOOLIN  DD *                                                 
   COUNT FROM(INDD) EMPTY USING(HDTL) RC4                       
 /*                                                             
 //HDTLCNTL DD *                                                 
   OMIT COND=(1,5,CH,EQ,C'H-MTU',OR,1,5,CH,EQ,C'T-MTU')         
 /*                                                             
 //TOOLMSG DD DSN=M424865.OUTPUT.TEST,DISP=SHR                   
 //DFSMSG  DD SYSOUT=*                                           


Though the details records are present it should return me 04 but am getting max cc 00.
Output:

Code:
             COUNT FROM(INDD) EMPTY USING(HDTL) RC4           
 ICE606I 0 DFSORT CALL 0001 FOR COPY  FROM INDD     TO E35 EXIT
 ICE647I 0 RECORD COUNT DOES NOT MEET CRITERIA - RC=0 SET     
 ICE602I 0 OPERATION RETURN CODE:  00                         
                                                               


Am not sure whats going wrong in this.

Please suggest !
Code tags applied for you. Do it yourself next time
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2351
Location: Hampshire, UK

PostPosted: Fri Jan 24, 2020 6:15 pm    Post subject: Reply to: Using ICETOOL set return code as per condition
Reply with quote

If your dataset only has one header and one trailer then you do not need to OMIT them - simply check for COUNT HIGHER(2) and set RC accordingly.
Back to top
View user's profile Send private message
Bhuvana Narasimhan

New User


Joined: 22 Aug 2019
Posts: 4
Location: India

PostPosted: Fri Jan 24, 2020 6:46 pm    Post subject: Reply to: Using ICETOOL set return code as per condition
Reply with quote

The dataset may have a header and some detail records.Sometimes the inbound file received is not complete. For that purpose i wanted to use header and trailer in omit . Cant go with Higher in icetool.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 311
Location: Inside the SPEW (Cincinnati OH USA)

PostPosted: Fri Jan 24, 2020 7:49 pm    Post subject:
Reply with quote

Looks like the count would be 2 based on your job and input; hence RC 0.

Am I missing something?
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2383
Location: NY,USA

PostPosted: Sat Jan 25, 2020 2:44 am    Post subject:
Reply with quote

Dave is right.

It is working as you coded. You should pass if RC-00 else fail. But if you specifically care about having header and trailer included then split the file into two, one with header and trailer and other with details and code COUNT accordingly on each and decide what to do.
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 Print next line strings when a condit... tgmuntor DFSORT/ICETOOL 9 Wed May 20, 2020 9:08 pm
No new posts trying to set return code in PROC tanvi110788 JCL & VSAM 16 Wed May 20, 2020 2:02 pm
No new posts Splice multiple records into single r... sarankriya DFSORT/ICETOOL 4 Wed Apr 15, 2020 10:55 pm
No new posts Need help in REXX code to list the af... chavinash2004 CLIST & REXX 3 Wed Apr 01, 2020 12:53 pm
No new posts Error Creating KSDS file, REASON CODE... sandeep prajapati JCL & VSAM 8 Tue Mar 24, 2020 12:05 pm

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