Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
finding mutual records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
Author Message
hyuzen

Active User


Joined: 10 Jul 2005
Posts: 50

PostPosted: Wed Oct 26, 2005 2:22 am    Post subject: finding mutual records
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
References
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 4621
Location: San Jose, CA

PostPosted: Wed Oct 26, 2005 2:37 am    Post subject:
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

Active User


Joined: 10 Jul 2005
Posts: 50

PostPosted: Thu Oct 27, 2005 12:48 am    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 4621
Location: San Jose, CA

PostPosted: Thu Oct 27, 2005 1:12 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 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

Active User


Joined: 10 Jul 2005
Posts: 50

PostPosted: Fri Oct 28, 2005 1:06 am    Post subject:
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1