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

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


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top