Removing duplicates to other file.

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
User avatar
anilanju
Member
Posts: 47
Joined: Mon Nov 10, 2008 6:59 pm

Removing duplicates to other file.

Post by anilanju » Tue Nov 10, 2009 6:05 pm

Hi

I have a file of lenght=108 anf Rec format = FB.

It has got hearder and trailer also.
The problem is it has some duplicate records, i want to copy them into a
saperate file.

The data is as :

HEAD00XYZ
A 123
ABC 123
JOGX 456
JOG1X 456
JOGX 777
JRRX 456
JRR1X 456
JRRX 777
TRAILER08XYZ

Here the first field can be of 6 char max.
Here i want to move the duplicate records starting from J and ending at X with second field 777 to other file

eg:
HEAD00XYZ
A 123
ABC 123
JOGX 456
JOG1X 456
JRRX 456
JRR1X 456
TRAILER06XYZ

and then modify the trailer record also.it counts the incoming records.

Second file:

JOGX 777
JRRX 777

Thanks

User avatar
Frank Yaeger
Moderator
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA
Contact:

Post by Frank Yaeger » Tue Nov 10, 2009 11:09 pm

Do you need the original information from the HEADER and TRAILER, or can they be rebuilt with the information shown?

The key is in positions 1-6 ... right?

The count only includes the data records ... right?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

User avatar
anilanju
Member
Posts: 47
Joined: Mon Nov 10, 2008 6:59 pm

Post by anilanju » Wed Nov 11, 2009 2:17 pm

HI Frank

Yes i need the original data from header to trailer, with count changing in
the trailer record.

Yes the key position is from 1-6 only but along with that we need to put one more check at position 7-9. as i want to copy the record with 777 at position 7-9 to other file.

The count only includes the data records only.

Thanks a lot.

skolusu
Member
Posts: 43
Joined: Sat Jul 26, 2008 12:38 am

Post by skolusu » Wed Nov 11, 2009 11:12 pm

anilanju wrote:Here i want to move the duplicate records starting from J and ending at X with second field 777 to other file
anilanju wrote:Yes the key position is from 1-6 only but along with that we need to put one more check at position 7-9. as i want to copy the record with 777 at position 7-9 to other file.
what happens if your data is like this

ABC is a duplicate and but it does not start with J and end with X.

JRR1X starts with J and ends with x but the pos 7-9 is not 777 and still is duplicate based on the first 6 characters.

Code: Select all

HEAD00XYZ                    
A     123                    
ABC   123                    
ABC   777  <<< does it go to file 2?
JOGX  456                    
JOG1X 456                    
JOGX  777                    
JRRX  456                    
JRR1X 345                    
JRR1X 456  <<< does it go to file 2?
JRRX  777                    
TRAILER08XYZ                 
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

User avatar
anilanju
Member
Posts: 47
Joined: Mon Nov 10, 2008 6:59 pm

Post by anilanju » Thu Nov 12, 2009 2:05 pm

HI

For records Starting with J and ending at X, we need a check at position 7-9 for 777,as i want to copy the record with 777 at position 7-9 to other file
only.

For rest of the duplicate records, we can move the first duplicate record to other file.For them there is no check on th second field.

Thanks a lot.

Regards

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others