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

SYNCSORT Eliminating records from file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mvmadhavi

New User


Joined: 09 Nov 2006
Posts: 21

PostPosted: Sat Oct 20, 2007 6:09 pm
Reply with quote

I have two files one with 100 records and 2nd one with 1000 records with a name field.

File A
AAAAA
CCCC
EEEEE... till 100 records


File B

AAAAA
BBBBB
CCCCC
DDDDD
EEEEEE
FFFFFF..till 1000 records.


I need to compare File A and File B and remove all Similar records from
File B.All 100 records in file A are also in file B.

Apart from using omit condition 100 times is there any other method?

Hope my question is clear.
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Sat Oct 20, 2007 7:32 pm
Reply with quote

mvmadhavi,

Do you only have unique records in file A & in file B ?

Alain
Back to top
View user's profile Send private message
mvmadhavi

New User


Joined: 09 Nov 2006
Posts: 21

PostPosted: Sat Oct 20, 2007 7:47 pm
Reply with quote

yes we have unique records in File A and B
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sat Oct 20, 2007 8:25 pm
Reply with quote

mvmadhavi
Try this ICETOOl JCL, here assumtion is the Name(KEY) field is 10 characters. If it is not then you could change as per your requirement in ON(p,m,f), where
p=>starting position of the field
m=>length of the field
f=>format of the field
Code:

//GETMATCH EXEC PGM=ICETOOL                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//IN1      DD DSN=File1                                   
//         DD DSN=File2
//OUT      DD Output file                                                 
//TOOLIN   DD *                                                         
 SELECT FROM(IN1) TO(OUT) ON(1,10,CH) NODUPS     
/*                                                                     
//*       
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sat Oct 20, 2007 8:33 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for assuming that FileA and FileB both have RECFM=FB and the same LRECL (if not, tell me the RECFM and LRECL of each input file).

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//CON DD DSN=...  input file1 (FB/n)
//    DD DSN=...  input file2 (FB/n)
//OUT DD DSN=...  output file (FB/n)
//TOOLIN   DD    *
SELECT FROM(CON) TO(OUT) ON(1,5,CH) NODUPS
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
mvmadhavi

New User


Joined: 09 Nov 2006
Posts: 21

PostPosted: Sat Oct 20, 2007 9:13 pm
Reply with quote

Thank you very much for the answer.

Just another question is there any other way apart from using

icetool. is it possible using syncsort.


Madhavi
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sat Oct 20, 2007 9:15 pm
Reply with quote

mvmadhavi
Change ICETOOL to SYNCTOOL and try icon_wink.gif
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sat Oct 20, 2007 9:28 pm
Reply with quote

Or
Try this SORT JOB
Code:
//S1    EXEC  PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=...  input file1 (FB/LRECL=80)
//          DD DSN=...  input file2 (FB/LRECL=80)
//SORTOUT DD DSN=...  output file (FB/LRECL=80)
//SYSIN   DD    *
 SORT FIELDS=(1,10,CH,A)
 INREC OVERLAY=(81:C'1')
 SUM FIELDS=(81,1,ZD)
 OUTFIL REMOVECC,INCLUDE=(81,1,ZD,LT,2),BUILD=(1,80)
/*

Assumption is Files are of LRECL=80
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top