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: 420
Location: Inside the SPEW (Southwest Ohio, 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: 3053
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top