View previous topic :: View next topic
|
Author |
Message |
hyuzen
New User
Joined: 10 Jul 2005 Posts: 58
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
hyuzen
New User
Joined: 10 Jul 2005 Posts: 58
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
hyuzen
New User
Joined: 10 Jul 2005 Posts: 58
|
|
|
|
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 |
|
|
|