Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

ICETOOL help

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

New User


Joined: 03 Jul 2006
Posts: 53

PostPosted: Sat Sep 19, 2009 12:10 am    Post subject: ICETOOL help
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: 53

PostPosted: Sat Sep 19, 2009 12:46 am    Post subject: Reply to: ICETOOL help
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 Moderator


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

PostPosted: Sat Sep 19, 2009 1:11 am    Post subject:
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: 53

PostPosted: Sat Sep 19, 2009 1:18 am    Post subject: Reply to: ICETOOL help
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 Moderator


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

PostPosted: Sat Sep 19, 2009 2:30 am    Post subject:
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    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 How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am
No new posts ICETOOL higher option Anshul Das DFSORT/ICETOOL 14 Thu Apr 14, 2016 8:00 am
No new posts Compare Files and extract matching re... vimalravi83 DFSORT/ICETOOL 3 Wed Jan 06, 2016 2:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us