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

Using ICETOOL set return code as per condition


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 2455
Location: Hampshire, UK

PostPosted: Fri Jan 24, 2020 6:15 pm
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
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: 319
Location: Inside the SPEW (Cincinnati OH USA)

PostPosted: Fri Jan 24, 2020 7:49 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 2632
Location: NYC,USA

PostPosted: Sat Jan 25, 2020 2:44 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extract 2 more lines below line that ... DFSORT/ICETOOL 2
No new posts Build two or more rows given some con... DFSORT/ICETOOL 9
This topic is locked: you cannot edit posts or make replies. ICETool reporting 2 das old dataset DFSORT/ICETOOL 13
No new posts How to convert RESP code 12 to text? CICS 9
No new posts How can we simulate JOINKEYS in ICETOOL DFSORT/ICETOOL 9
Search our Forums:

Back to Top