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

Comparing the duplicates


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

New User


Joined: 18 Apr 2007
Posts: 13
Location: Bangalore

PostPosted: Mon Sep 22, 2008 9:12 pm
Reply with quote

Hi,

I have a requirement

File A : I have 6 records out of which 4 are same.

File B: I have 8 records out of 6 records are same.

The 4 records in FILEA and 6 records in FILE B are same. If we substract we will get two records, I need these two records in output file


This is because to remove the duplicates from the database.

Through easytrieve we can compare but for that there should not duplicates, but in my file I have duplicates.

Thanks in advance!!
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: Mon Sep 22, 2008 9:26 pm
Reply with quote

Hello,

You need to post the content of both files and the output you want when those files are processed. Post the nputs and output using the "Code" tag at the top of the Reply panel. Use Preview to see how your post will appear to the forum and when you are satisfied with the appearance of your post, click Submit. Make sure you Submit or your post will be lost.

If there are more (or could be less) than exactly 6 and 8 records in each file, show this in your examples.
Back to top
View user's profile Send private message
vinay249

New User


Joined: 18 Apr 2007
Posts: 13
Location: Bangalore

PostPosted: Mon Sep 22, 2008 9:37 pm
Reply with quote

Please see the the inputs and outputs

Code:
FILE A
----------
A    B   C
--   --  --         
1    4    5
1    4    5
1    4    5
6    7    8

Code:
FILE B
------------
C    D    E
--   --   --     
1    4    5
1    4    5
1    4    5
1    4    5
1    4    5
4    7    9
6    8    6

Code:
OUTPUT :
-----------
1  4  5
1  4  5
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 Sep 23, 2008 1:58 am
Reply with quote

Hello,

Do not post the same question multiple times.

The other topic in the other forum has been deleted.

d
Back to top
View user's profile Send private message
Selva-kumar

New User


Joined: 01 Mar 2007
Posts: 52
Location: chennai

PostPosted: Tue Sep 23, 2008 2:51 pm
Reply with quote

Hi Vinay,

Need one clarification. If duplicates in a File A matches with the duplicates in File B

1. , Then you need a single occurrence of that duplicate from File A and a single occurrece of that duplicate from File B

(or)

2. You just want the number of records equal to the difference between the duplicates in file A and file B
Back to top
View user's profile Send private message
kalpana manoharan84
Currently Banned

New User


Joined: 18 Sep 2008
Posts: 4
Location: Chennai

PostPosted: Tue Sep 23, 2008 4:51 pm
Reply with quote

Hi,
I assume your requirement as FILEA minus FILEB.[i.e.]Output File should contain the records present in FILEA ,that is not available in FILEB.

Eg:

FILEA:

AAAAA
AAAAA
BBBBB
CCCCC
FILEB:

AAAAA
CCCCC
DDDDD

Output should be:

AAAAA
BBBBB

If this is the case,the following code will help you.

//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=TSOXXXX.FILEA,DISP=SHR
//SORTOUT DD DSN=TSOXXXX.FILEA.O,DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(5,1)),
// DCB=LRECL=080,BLKSIZE=800,RECFM=FB),UNIT=SYSDA,DSORG=PS
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,5,CH,A)
SUM FIELDS=NONE
OUTREC OVERLAY=(10:C'W')
/*
//*
//STEP2 EXEC PGM=SORT
//SORTIN DD DSN=TSOXXXX.FILEA.O,DISP=SHR
// DD DSN=TSOXXXX.FILEB,DISP=SHR
//SORTOUT DD DSN=TSOXXXX.OUTPUT,DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(5,1)),
// DCB=(LRECL=080,BLKSIZE=800,RECFM=FB),UNIT=SYSDA,DSORG=PS
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC OVERLAY=(07:C'001')
SORT FIELDS=(1,5,CH,A)
SUM FIELDS=(07,3,ZD)
OUTFIL FNAMES=SORTOUT,BUILD=(1,5,75X),INCLUDE=(7,4,CH,EQ,C'001W')
/*
//
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Sep 23, 2008 7:15 pm
Reply with quote

Kalpana,

Did you notice the sample input/ouput provided in the OP's last post where the unmatched records from either of the files is not seen in the output?

Vinay,

Please make your requirement more clearer with all the possible scenarios in input and the 'rules' for extracting records so that somebody here might be able to help you.
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 How to remove block of duplicates DFSORT/ICETOOL 8
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
No new posts Merging 2 files but ignore duplicate... DFSORT/ICETOOL 1
No new posts COUNT the number of duplicates DFSORT/ICETOOL 3
Search our Forums:

Back to Top