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
 

 

Comparing the duplicates

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Comparing the duplicates
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

Site Director


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

PostPosted: Mon Sep 22, 2008 9:26 pm    Post subject:
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    Post subject: Reply to: Comparing the duplicates
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

Site Director


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

PostPosted: Tue Sep 23, 2008 1:58 am    Post subject: Reply to: Comparing the duplicates
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    Post subject: Reply to: Comparing the duplicates
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    Post subject: Reply to: Comparing the duplicates
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: 2284
Location: @my desk

PostPosted: Tue Sep 23, 2008 7:15 pm    Post subject:
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts comparing comp-3 and unpacked numbers juares castro COBOL Programming 3 Mon May 30, 2016 6:46 pm
No new posts Need help on comparing hexadecimal va... ashok_uddaraju DFSORT/ICETOOL 4 Thu Apr 28, 2016 2:08 am


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