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
 

 

How to group the matched and the unmatched records in A file

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

New User


Joined: 04 Jun 2009
Posts: 30
Location: Bangalore

PostPosted: Wed Jun 10, 2009 2:22 am    Post subject: How to group the matched and the unmatched records in A file
Reply with quote

Scenario, is something like this:
I have an input file.
FILE1
-------
11111 ABCDEF
22222 CDEFDF
33333 IUIUTW
22222 SDFJFF

The ouput should come in two files as.
FILE2
-------
11111 ABCDEF
33333 IUIUTW

FILE3
-------
22222 CDEFDF
22222 SDFJFF

Matching is done on first 5 bytes(char 5) of the record and lrcl is 1000 bytes.

Thanks
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Jun 10, 2009 5:53 am    Post subject: Reply to: How to group the matched and the unmatched records
Reply with quote

Furor,

You can use a DFSORT/ICETOOL job like the following to get the unique records in one file and the duplicates in another:


Code:

//STEP0100 EXEC PGM=ICETOOL                   
//TOOLMSG   DD SYSOUT=*                       
//DFSMSG    DD SYSOUT=*                       
//IN        DD DSN=INPUT.FILE,               
//             DISP=SHR                       
//UNQ       DD DSN=OUPUT.UNQ.KEY FILE,           
//             DISP=(,NEW,CATLG,DELETE),       
//             UNIT=SYSDA                     
//             SPACE=(CYL,(X,Y),RLSE)
//DUPS      DD DSN=OUPUT.DUPS.KEY FILE,           
//             DISP=(,NEW,CATLG,DELETE),       
//             UNIT=SYSDA                     
//             SPACE=(CYL,(X,Y),RLSE)       
//TOOLIN    DD *                               
  SELECT FROM(IN) TO(UNQ) ON(1,5,CH) NODUPS DISCARD(DUPS)   
/*           
Back to top
View user's profile Send private message
Furor

New User


Joined: 04 Jun 2009
Posts: 30
Location: Bangalore

PostPosted: Wed Jun 10, 2009 6:03 pm    Post subject: Reply to: How to group the matched and the unmatched records
Reply with quote

Thanks a lot Skolusu. Knowledge has no substitute icon_smile.gif
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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