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
 

 

Compare Two Files with Primary Keys at Different Positions

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

New User


Joined: 27 Jul 2006
Posts: 5
Location: Torrance

PostPosted: Fri Jan 04, 2008 7:26 am    Post subject: Compare Two Files with Primary Keys at Different Positions
Reply with quote

Hi.

I have two files:

FileA:
File Length = 3680
Primary Key Start Position = 1225
Primary Key Length = 11

FileB:
File Length = 15
Primary Key Start Position = 1
Primary Key Length = 11

I want to list the records from FileA whose Primary Key matches that of FileB.

I have DFSORT/ICETOOL installed in my system.
I was trying to use ICETOOL but since the input file record-lengths are different, i am bit confused about the parameters.
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 Jan 04, 2008 9:40 pm    Post subject:
Reply with quote

You need to supply more information. Please show an example of the records in each input file (relevant fields only) and the expected output records. If you can have duplicates within input file A, show that in your example. If you can have duplicates within input file B, show that in your example.
Back to top
View user's profile Send private message
kpcroy

New User


Joined: 27 Jul 2006
Posts: 5
Location: Torrance

PostPosted: Sat Jan 05, 2008 12:24 am    Post subject:
Reply with quote

Hi,

The Files look like:

FileA
.........aaaa010262AB123bbbb.........
.........cccc010262AB234dddd.......
.........eeee010262AB345dddd.......
.........gggg010262AB567hhhh.......
.........gggg010262XX888hhhh.......
.........gggg010262YY999hhhh.......


The bold-Italic part represents the Primary Key.

There are no duplicates in File A and there will be a record in File A for every primary key present in File B

FileB
010262AB123vvvv
010262AB123www
010262AB234xxxx
010262AB345yyyy
010262AB345zzzz
010262AB567pppp

The bold-Italic part represents the Primary Key.
There may be duplicate primary keys in File B.

Sample Output File:

.........aaaa010262AB123bbbb.........
.........cccc010262AB234dddd.......
.........eeee010262AB345dddd.......
.........gggg010262AB567hhhh......
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: Sat Jan 05, 2008 12:41 am    Post subject:
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 file A (FB/3680)
//IN2 DD DSN=...  input file B (FB/15)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/3680)
//TOOLIN DD *
COPY FROM(IN1) TO(T1)
COPY FROM(IN2) TO(T1) USING(CTL1)
SELECT FROM(T1) TO(OUT) ON(1225,11,CH) FIRSTDUP
/*
//CTL1CNTL DD *
  INREC BUILD=(1225:1,11,3680:X)
/*
Back to top
View user's profile Send private message
kpcroy

New User


Joined: 27 Jul 2006
Posts: 5
Location: Torrance

PostPosted: Sat Jan 05, 2008 1:32 am    Post subject:
Reply with quote

Thanks a lot Frank. This is workig Perfectly.
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Joinkeys with duplicated keys juares castro SYNCSORT 19 Fri Sep 23, 2016 5:58 am


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