Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us