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
 

 

Comare PS File1 and PS File2, eliminate duplicates

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

New User


Joined: 26 Feb 2007
Posts: 34
Location: pune

PostPosted: Thu Jul 17, 2008 3:58 pm    Post subject: Comare PS File1 and PS File2, eliminate duplicates
Reply with quote

Want to eliminates duplicates by comparing file1 and file2. the position of the key is different in these two files. The output should consists of file1 records only.

For Example

File1 : the length of PS file is 388

Cust-id( from position 1 to 4) Address( from position 50 to 100)
_________________________ ____________________________

1111 XXXXXXXXXXXXX
2222 YYYYYYYYYYYYYYY
3333 ZZZZZZZZZZZZZ

File2 : the length of PS file is 363

Cust-id( from position 25 to 29) Address( from position 200 to 250)
_________________________ ____________________________

1111 XXXXXXXXXXXXX
5555 AAAAAAAAAAAAA
6666 BBBBBBBBBBBBB

The output file should be : the Lengh and field positions should be same as file1:

Cust-id( from position 1 to 4) Address( from position 50 to 100)
_________________________ ____________________________

2222 YYYYYYYYYYYYYYY
3333 ZZZZZZZZZZZZZ


We need to eliminate the records from file-1 if the keys matches with file2 record.

Thanks & Regards,
Puru
Back to top
View user's profile Send private message

sudhakar varma

New User


Joined: 17 Jul 2008
Posts: 2
Location: pune

PostPosted: Fri Jul 18, 2008 3:47 pm    Post subject: Reply to: Comare PS File1 and PS File2, eliminate duplicates
Reply with quote

I also struck with similar type of request( i am using match logic thru program). Can some one please suggest, whether this is possible with SORT or not ???



Thanks in advance...
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: Fri Jul 18, 2008 10:28 pm    Post subject:
Reply with quote

Puru,

Here's a DFSORT/ICETOOL job that will do what you asked for. It wasn't clear if you wanted to compare on the cust-id and address fields, or just on the cust-id field. Since you mentioned both fields, I assumed you wanted to compare on both fields. If not, the job can be changed appropriately.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/388)
//IN2 DD DSN=... input file2 (FB/363)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/388)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,4,CH) ON(50,51,CH) -
  NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(389:C'1')
/*
//CTL2CNTL DD *
  INREC BUILD=(1:25,4,50:200,51,389:C'2')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(389,1,CH,EQ,C'1'),
    BUILD=(1,388)
/*
Back to top
View user's profile Send private message
sudhakar varma

New User


Joined: 17 Jul 2008
Posts: 2
Location: pune

PostPosted: Mon Jul 21, 2008 12:10 pm    Post subject: Reply to: Comare PS File1 and PS File2, eliminate duplicates
Reply with quote

Frank Yaeger,

Thanks a lot ............it is working as expected....


Thanks for your help............
Back to top
View user's profile Send private message
Anurag Singh

New User


Joined: 20 Jan 2008
Posts: 25
Location: India

PostPosted: Wed Jul 23, 2008 4:08 pm    Post subject:
Reply with quote

Hi,
Please explain the function of CTL1 , CTL2 and CTL3 mentioned here in the given JCL.

Thanks
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Wed Jul 23, 2008 5:41 pm    Post subject: Reply to: Comare PS File1 and PS File2, eliminate duplicates
Reply with quote

Anurag,

Quote:
Please explain the function of CTL1 , CTL2 and CTL3 mentioned here in the given JCL.


Explained as requested.

Code:
//CTL1CNTL DD *
  INREC OVERLAY=(389:C'1')
/*


numeral '1' is overlaid in the 389th column for all the records in file IN1

Code:
//CTL2CNTL DD *
  INREC BUILD=(1:25,4,50:200,51,389:C'2')
/*



From IN2, the records are built and written to T1

byte 1 - 4 bytes starting from 25th pos in IN2
byte 50 - 51 bytes starting from 200th byte in IN2
numeral '2' is overlaid in the 389th column

Code:
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(389,1,CH,EQ,C'1'),
    BUILD=(1,388)
/*


Only the records with '1' in 389th position is selected and then the first 388 bytes are built ignoring the data in the 389th position.

Also please refer to the manuals to understand the syntax.
Back to top
View user's profile Send private message
Anurag Singh

New User


Joined: 20 Jan 2008
Posts: 25
Location: India

PostPosted: Wed Jul 23, 2008 9:20 pm    Post subject:
Reply with quote

Thanks Aaru
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 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 how to eliminate records from operati... PUMA DFSORT/ICETOOL 5 Tue Dec 23, 2014 4:42 pm
No new posts compare two files and replace record ... faizm DFSORT/ICETOOL 9 Tue Sep 02, 2014 7:16 pm
No new posts How to eliminate duplicate records - ... Rohan saldanha DFSORT/ICETOOL 7 Tue Jul 15, 2014 7:35 pm


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