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
 

 

SYNCSORT Eliminating records from file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: SYNCSORT Eliminating records from file
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    Post subject:
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    Post subject: Reply to: Eliminating records from file
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    Post subject: Reply to: Eliminating records from file
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 Moderator


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

PostPosted: Sat Oct 20, 2007 8:33 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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    Post subject: Reply to: Eliminating records from file
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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