Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to eliminate duplicates in this case using SORT or fileaid

Status
Not open for further replies.

malsarun

Programmer
Jul 12, 2002
4
US
Hi,
I have a set of records in a flat file like that given below:

L1 A1 O1 C1
L2 A1 O1 C1
L2 A1 O1 C1
L1 A1 O1 C2
L2 A1 O1 C2
L1 A2 O2 C3
L2 A2 O2 C3

I need to create a sorted file which has the records defined below

L1 A1 O1 C1
L2 A1 O1 C1
L2 A1 O1 C1
L2 A1 O1 C2
L1 A2 O2 C3
L2 A2 O2 C3

That is there should be only ONE L1/A1/O1/C1 combination. I know sum fields = none with sort fields defined on the above 4 fields eliminate duplicates but this elimination of duplicates should be only for the L1 duplicates and not for other records. How do I use SUM FIELDS to remove duplicates for a specific value of L1. Are there any other alternatives.
 
Hi,

That is there should be only ONE L1/A1/O1/C1 combination.
There IS only one L1A1O1C1 in the input recs you provide. Am I missing something?

Regards, Jack.
 
I meant that there should be no L1/A1/O1/C2. It basically looks like this - a sort on L1/A*/O* with duplicates eliminated. Fields A* & O* could repeat (A1/O1 ; A2/O2 etc) but L1 has a constant value. I would like to eliminate duplicates for records having L1/A*/O*
 
You didn't mention what sort you're using. You might want to look at ICETOOL (DFSORT) or SYNCTOOL (SYNCSORT) for an answer.

You might also consider an internal COBOL SORT using an O/P Procedure.

You can also ask your ques at the sort/utilities help board. Frank Yeager, the IBM SORT guru, is the moderator. Just a tip: make sure your ques presents the problem clearly and contains info about platform, lang, vendor, etc. They have a tendency to "flame".

Regards, Jack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top