Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Finding duplicate records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
hyuzen

New User


Joined: 10 Jul 2005
Posts: 58

PostPosted: Mon Aug 08, 2005 11:03 pm    Post subject: Finding duplicate records
Reply with quote

Hi all,
Nonvsam Dataset A consist of 8 ch.s' records like

AAAAAAAA
AAAAAABB
AAAAAACC
...

Nonvsam Dataset B is FB and LRECL=80 and also includes same keys of Dataset A in the particular position but has more much records.

How can I get an output dataset C which has mutual/same records of Dataset A and Dataset B ?

Thanks in advance.
hyuzen
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Aug 08, 2005 11:29 pm    Post subject:
Reply with quote

Can input fileA have duplicates? Can input fileB have duplicates? Does input fileA have RECFM=FB and LRECL=8? Is the key for "duplicates" in positions 1-8 of both files? Do you want one record for each matching key, or all of the records for each matching key? Please show an example of the input records in FileA and FileB and the records you want in the output file. If FileA can have duplicates or FileB can have duplicates, show that in your example.
Back to top
View user's profile Send private message
hyuzen

New User


Joined: 10 Jul 2005
Posts: 58

PostPosted: Wed Aug 10, 2005 2:35 am    Post subject:
Reply with quote

Thank you Frank for your quick response.

File A is RECFM=FB and LRECL=8. Pls assume all records like below

AAAAAAAA
AAAAAABB
AAAAAACC
...
AAXXAAYY
AAXXAAZZ
...

File B is RECFM=FB and LRECL=80. Pls assume all record like below
123456 SDKILO23 PARIS AAAAAAAA 0000 45
123477 SKLORI34 ANKARA AAXXAAYY 0008 56
...

In both file some records/keys like AAAAAAAA and AAXXAAYY are same and all the positions of the keys in file B are same and start at 60th position.

And output file must consist of mutual record/keys in both files and it can be like file B then I can sort/select keys.

How can I do that ?

Thank you very much.

hyuzen.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Aug 10, 2005 5:22 am    Post subject:
Reply with quote

So if I understand your example correctly, fileA does NOT have any duplicates, that is, you wouldn't find two records with the AAAAAAAA key in fileA - right? Likewise, fileB does NOT have any duplicates.

Quote:
And output file must consist of mutual record/keys in both files and it can be like file B then I can sort/select keys.


It isn't clear to me what you mean by this. Please show an example of the input file records with matching keys and non-matching keys and show what the output records should look like. I don't want to guess.
Back to top
View user's profile Send private message
hyuzen

New User


Joined: 10 Jul 2005
Posts: 58

PostPosted: Wed Aug 10, 2005 11:25 pm    Post subject:
Reply with quote

Dear Frank,
Sorry for my misinterpreting for 'duplicate' and thank you very much for your interest.

I called records what FileA have in. FileA's LRECL is only 8 ch. length.
I also called them keys according to File B b/c File B whose LRECL is 80, have some keys like AAAAAABB are exactly same in the File A and has much more records them fileA.
I'm looking for any mutual records in fileA and fileB. If there is any in the fileB then I need that record in the fileB as one of the output record.

Macthing keys (in the fileA):
AAAAAAAA
AAAAAABB
....

Scanned file (fileB):
123456 SDKILO23 PARIS AAAAAAAA 0000 45
123477 SKLORI34 ANKARA AAXXAAYY 0008 56
...


Output file (fileC):
123456 SDKILO23 PARIS AAAAAAAA 0000 45
...

What I need to find in fileB:
AAAAAAAA is what fileA has as a record and fileB has as a key.

Please assume mutual keys in the fileB like AAAAAAAA are in the same position.

Hope I become more clear now. Thank you very much once again.
hyuzen
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Aug 11, 2005 12:46 am    Post subject:
Reply with quote

I think I understand what you want, and if so, this DFSORT/ICETOOL job will do it. I'm assuming the key in input file2 is in positions 24-31.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/8)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=...  input file2 (FB/80)
//    DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
* IN1->T1:  Reformat IN1 records to put key in same place
* as in IN2 records and to pad out the records to the same
* length as the IN2 records.
 COPY FROM(IN1) TO(T1) USING(CTL1)
* CON->OUT:  Get the first record (the one from input file2)
* for each file1/file2 match.
SELECT FROM(CON) TO(OUT) ON(24,8,CH) FIRSTDUP
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(24:1,8,80:X)
/*
Back to top
View user's profile Send private message
hyuzen

New User


Joined: 10 Jul 2005
Posts: 58

PostPosted: Fri Aug 12, 2005 12:59 am    Post subject:
Reply with quote

Dear Frank,
That is really kind of you.
This is the first time I will use ICETOOL and will let you know for the result. And thank you VERY much.
Bye,
hyuzen
Back to top
View user's profile Send private message
hyuzen

New User


Joined: 10 Jul 2005
Posts: 58

PostPosted: Mon Aug 15, 2005 11:13 pm    Post subject: THANK YOU VERY MUCH FRANK
Reply with quote

Dear Frank,

So sorry for my late response b/c Icetool is so new for me. It worked perfectly. Thank you very much.

In the same sample, if fileB is a KSDS file, what changes I have to do ?

Thanks in advance,

hyuzen
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Aug 16, 2005 1:02 am    Post subject:
Reply with quote

Well, a VSAM file cannot be used in a concatenation, so you'd have to COPY the VSAM file to the T1 file rather than using it directly. Something like this (you may have to change the 80:X to the length of your VSAM input file):

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/8)
//IN2 DD DSN=...  VSAM file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
* IN2->T1:  Copy VSAM records.
COPY FROM(IN2) TO(T1) VSAMTYPE(F)
* IN1->T1:  Reformat IN1 records to put key in same place
* as in IN2 records and to pad out the records to the same
* length as the IN2 records.
COPY FROM(IN1) TO(T1) USING(CTL1)
* T1->OUT:  Get the first record (the one from input file2)
* for each file1/file2 match.
SELECT FROM(T1) TO(OUT) ON(24,8,CH) FIRSTDUP
/*
//CTL1CNTL DD *
   OUTREC FIELDS=(24:1,8,80:X)
/*
Back to top
View user's profile Send private message
hyuzen

New User


Joined: 10 Jul 2005
Posts: 58

PostPosted: Thu Aug 18, 2005 1:51 am    Post subject: Thank YOU Frank
Reply with quote

Dear Frank,

Thank you very much. That's very kind of you.

Regards,

hyuzen
Back to top
View user's profile Send private message
CHOVVA

New User


Joined: 13 May 2005
Posts: 2

PostPosted: Thu May 18, 2006 3:09 pm    Post subject: Re: Finding duplicate records
Reply with quote

It was really useful.

Jiju
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Finding IMS resource blocker after se... Hooman24 IMS DB/DC 1 Wed Aug 16, 2017 9:17 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us