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
 

 

finding mutual records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    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

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
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

New User


Joined: 10 Jul 2005
Posts: 58

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: 7130
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

New User


Joined: 10 Jul 2005
Posts: 58

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
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


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