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

Getting duplicate records after file comparison


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
venugopala

New User


Joined: 19 Oct 2006
Posts: 4

PostPosted: Wed Oct 29, 2008 7:11 pm
Reply with quote

Hi,

could you please help me in solving the below stated issue

Inputfile1 (lrecl=159) contains some duplicate records, inputfile2 (lrecl=7) contain unique records,
My requirement like as follows

file2 (UNIQUE record)need to be compared with file1(Duplicates) all matched records are need to be written
in to output file


Ex

File 1

Code:

                  AAA1111
                  AAA1111
                  BBB2222
                  CCC3333
                  CCC3333


File 2

Code:

AAA1111
CCC3333


Expected output

Code:

                  AAA1111
                  AAA1111
                  CCC3333
                  CCC3333


many thanks in advance
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Oct 29, 2008 9:17 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/159)
//IN2 DD DSN=...  input file2 (FB/7)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/159)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(19,7,CH) WITHALL -
 WITH(1,160) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(19:1,7,160:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(160:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(160,2,CH,EQ,C'VB'),
    BUILD=(1,159)
/*
Back to top
View user's profile Send private message
venugopala

New User


Joined: 19 Oct 2006
Posts: 4

PostPosted: Thu Oct 30, 2008 5:15 pm
Reply with quote

Dear Frank Yaeger,

Its working fine,
Thanks ,Thanks a lot
icon_biggrin.gif
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top