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
 
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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am

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