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 Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm


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