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

finding mutual records


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

New User


Joined: 10 Jul 2005
Posts: 58

PostPosted: Wed Oct 26, 2005 2:22 am
Reply with quote

Hi all,

I would like to find out mutual records in two flat files and get a new out file.

Records of Flat File A:

0000023658AA000001 18092004 5553322688
0000098431AA000032 17092005 5324268976
....
(pls care positions: P:11 & P:29)


Records of Flat File B:

5324268976
5553322688
.....
(Pls care records of 1 to 10 are same in flat file B where keys' positions are at 29)


Out file C:

5324268976 AA000032
5553322688 AA000001
....
(Pls care the keys are selected from flat file A at P:29,10 & P:11,8)

Thanks in advance.

Hyuzen
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 26, 2005 2:37 am
Reply with quote

What is the RECFM and LRECL of input file A? What is the RECFM and LRECL of input file B? Can input file A have duplicate keys within it? Can input file B have duplicate keys within it? You don't want a record in the output file if it's in A but not B, or in B but not A - right?
Back to top
View user's profile Send private message
hyuzen

New User


Joined: 10 Jul 2005
Posts: 58

PostPosted: Thu Oct 27, 2005 12:48 am
Reply with quote

Hi Frank,
Thank you for your response.

Here are the definitions:
Input File A
DCB=(RECFM=FB,DSORG=PS,LRECL=73,BLKSIZE=0)

Input File B
DCB=(LRECL=80,BLKSIZE=8160,RECFM=FB)


Output File C
DCB=(LRECL=80,BLKSIZE=8160,RECFM=FB)

None of flat files have duplicate keys. The records of output file will be selected from input file A if there are mutual records in file B & A.
(mutual records should be:
5324268976
5553322688
in both input files.)

Thank you,

hyuzen
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: Thu Oct 27, 2005 1:12 am
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/73)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//    DD DSN=...  input file2 (FB/80)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
SELECT FROM(CON) TO(OUT) ON(1,10,CH) FIRSTDUP
/*
//CTL1CNTL DD *
   OUTREC FIELDS=(29,10,X,11,8,80:X)
/*
Back to top
View user's profile Send private message
hyuzen

New User


Joined: 10 Jul 2005
Posts: 58

PostPosted: Fri Oct 28, 2005 1:06 am
Reply with quote

Dear Frank,

Thank you very very much. I will arrange my jcl based on what you supplied then I run it.

Bye,
Hyuzen
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 Finding and researching jobs All Other Mainframe Topics 0
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top