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

ICETOOL help


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Sat Sep 19, 2009 12:10 am
Reply with quote

I knwo how to do what i need in two steps but maybe SORT gurus can show me if it's possible in one step.

I have one input file

Code:

    ITEM                                               TYPE
----+----1----+----2----+----3----+----4----+----5----+--
111110003801049 9361COV11111FOV03611111TD     11111111 10
111110003801049 9361COV11111FOV03611111TD     11111111 20
111110003801049 9361COV11111FOV03611111TD     11111111 30
111110003801049 9361COV11111FOV03611111TD     11111111 30
222220003801049 9361COV11111FOV03611111TD     21111111 10
222220003801049 9361COV11111FOV03611111TD     21111111 20
333330003801049 9361COV11111FOV03611111TD     31111111 10
333330003801049 9361COV11111FOV03611111TD     31111111 20
333330003801049 9361COV11111FOV03611111TD     31111111 30


Key is - ITEM in pos ITEM(1:15). There is another field which i have to use - TYPE in pos (77:2).
I want to see on my output only one record with TYPE = '10' if there is no matching TYPE='30' record within group.
Basically from test data above i have to have on my output file only one record because this group doesn't have matching record TYPE='30'

Code:

    ITEM                                               TYPE
----+----1----+----2----+----3----+----4----+----5----+--
222220003801049 9361COV11111FOV03611111TD     21111111 10
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Sat Sep 19, 2009 12:46 am
Reply with quote

That's how I did it.

First step using this control:
Code:
 //TOOLIN   DD *                                               
   SELECT FROM(IN) TO(OUT) ON(1,15,CH) USING(CTL1) LAST       
 //CTL1CNTL DD *                                               
   INCLUDE COND=(77,2,CH,NE,C'20')


Second step eliminated all TYPE '30's records
Code:
  SORT  FIELDS=COPY               
  INCLUDE COND=(77,2,CH,EQ,C'10')   
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Sep 19, 2009 1:11 am
Reply with quote

Here's a DFSORT/ICETOOL job that does in one pass what you're doing in two passes. Since your input records appear to already be in sorted order, I used OPTION COPY to do a COPY for the SELECT instead of a SORT:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
  SELECT FROM(IN) TO(OUT) ON(1,15,CH) USING(CTL1) LAST
/*
//CTL1CNTL DD *
   OPTION COPY
   INCLUDE COND=(77,2,CH,NE,C'20')
   OUTFIL FNAMES=OUT,INCLUDE=(77,2,CH,EQ,C'10')
/*
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Sat Sep 19, 2009 1:18 am
Reply with quote

Frank, thanks a lot. Yes you are right, file comes presorted.
Dummy me, how I couldn't figure it out, it's so simple......
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Sep 19, 2009 2:30 am
Reply with quote

Quote:
Dummy me, how I couldn't figure it out, it's so simple......


Actually, I was impressed with the logic of your solution. Doing it in one pass was just extra credit.
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 Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts ICETOOL to Read records SMF CEF it is... DFSORT/ICETOOL 4
Search our Forums:

Back to Top