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

Eliminate Duplicate records in FOCUS


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
cool_cupid4u
Warnings : 1

New User


Joined: 31 Dec 2006
Posts: 4
Location: Hyderabad

PostPosted: Tue Feb 06, 2007 2:07 pm
Reply with quote

Hi,
Can anyone help me in eliminating duplicate records using FOCUS(Report genration language).

Or it wud b great if anyone can provide online material for FOCUS.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 06, 2007 10:23 pm
Reply with quote

Hello,

Information Builders (www.informationbuilders.com) can answer your technical questions and provide material.
Back to top
View user's profile Send private message
iknow

Active User


Joined: 22 Aug 2005
Posts: 411
Location: Colarado, US

PostPosted: Wed Feb 07, 2007 3:59 pm
Reply with quote

Hi,

In order to eliminate duplicates in FOCUS, you need to make use of WRITE statement in FOCUS.

I am attaching you some reference FOCUS manuals.

Please let me know if you need any other help.


Attachment Removed. Copyrighted Material
Back to top
View user's profile Send private message
cool_cupid4u
Warnings : 1

New User


Joined: 31 Dec 2006
Posts: 4
Location: Hyderabad

PostPosted: Wed Feb 07, 2007 9:41 pm
Reply with quote

Hi
Thanks for the manuals.

I am still facing prob regarding the duplicate elimination.
I have a PS file with 20 records. I need to eliminate duplicate recs. For this I wud b using first 10 bytes as unique field.so how can i eliminate dup recs.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Feb 07, 2007 9:46 pm
Reply with quote

iknow, the material in the FOCUS.zip file says that its copyrighted. You can't legally post or distribute copyrighted material without the written consent of the publisher.

That content needs to be removed.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 07, 2007 10:34 pm
Reply with quote

Hello,

If you cannot find what you need in focus, you could sort the file removing duplicates. Look in the DFSORT forum and you will find multiple posts on how to do this.
Back to top
View user's profile Send private message
h.dinesh

New User


Joined: 06 Dec 2006
Posts: 46
Location: Chennai

PostPosted: Mon Feb 12, 2007 2:48 pm
Reply with quote

Hi,

Can you be more clear with your requirement by giving sample i/p and o/p?


Dinesh
Back to top
View user's profile Send private message
cool_cupid4u
Warnings : 1

New User


Joined: 31 Dec 2006
Posts: 4
Location: Hyderabad

PostPosted: Tue Feb 20, 2007 5:38 pm
Reply with quote

Hi Dinesh

Below is the file wherein i need to remove the duplicates..

7176042059 77452705200702152007021520070216RRZ08
7176042059 77452705200702152007021520070216RRZ08
7176042059 77452705200702152007021520070216RRZ08

The resultant file should have only one Record. At present I am eliminating the Duplicates in JCL using the SORT FIELDS cond.

I want to know if we can accomplish the same using FOCUS.

Thanks.
Back to top
View user's profile Send private message
h.dinesh

New User


Joined: 06 Dec 2006
Posts: 46
Location: Chennai

PostPosted: Tue Feb 20, 2007 6:17 pm
Reply with quote

Hi,

As per your previous post the first 10 bytes are unique and remaining have duplicates

Quote:
I have a PS file with 20 records. I need to eliminate duplicate recs. For this I wud b using first 10 bytes as unique field.so how can i eliminate dup recs.


But your example shows all nos. same for 1st 10 bytes...

Quote:
7176042059 77452705200702152007021520070216RRZ08
7176042059 77452705200702152007021520070216RRZ08
7176042059 77452705200702152007021520070216RRZ08


Anyway, I assume that 1st 10 bytes are unique - FIELD1 and remaining as FIELD2. You may use the following TABLE command to eliminate duplicates in FIELD2.

Code:
TABLE FILE <FILE NAME>
PRINT FIELD1
BY FIELD2
ON TABLE SAVE AS <SAVE FILE NAME>
END


Please let me know if this is what you want.

Dinesh
Back to top
View user's profile Send private message
pavankumarhassaji

New User


Joined: 20 Aug 2007
Posts: 11
Location: Canada

PostPosted: Mon Apr 14, 2008 6:09 pm
Reply with quote

Hi,

In your data if the fields are alphabatic, instead of writing

Code:
PRINT FIELD1 FIELD2


write

Code:
SUM FIELD1 FIELD2


it returns the last occurance of the field, eliminating the duplicates.

If the filelds are numeric, change the fields to alphabatic by using DEFINE clause.

Thanks,
Pavan Hassaji.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top