View previous topic :: View next topic
|
Author |
Message |
Bhuvana Narasimhan
New User
Joined: 22 Aug 2019 Posts: 4 Location: India
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Bhuvana Narasimhan
New User
Joined: 22 Aug 2019 Posts: 4 Location: India
|
|
|
|
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 |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
Looks like the count would be 2 based on your job and input; hence RC 0.
Am I missing something? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
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 |
|
|
|