Need Help to extract record comparing the 2 files



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Need Help to extract record comparing the 2 files

Postby alanmdc » Thu May 17, 2012 4:22 pm

Hello,

i have an input record from file 1 below
************************
99XXXYYYZZ40270AAA...
************************
please note the column value "40270" (column 11)


and i have a file 2 below
************************
01YZ3Y40270AABBCC40274BZY
02YZ3Y40271BABBCC40271BZY
03YZ3Y40272CABBCC40272BZY
04YZ3Y40273DABBCC40273BZY
05YZ3Y40274EABBCC40274BZY
06YZ3Y40274FABBCC40270BZY
07LC0Y40027GABBCC40027BCL
08PH3K40270HABBCC40270BHP
09PH3K40274IABBCC40274BHP
10PH3K40027JABBCC40027BHP
11YZ3Y40270KABBCC40274BZY
12PH3K40027LABBCC40027BHP
13YZ3Y40274MABBCC40270BZY
14LC0Y40027NABBCC40027BCL
15PH3K40274OABBCC40270BHP
16PH3K40274PABBCC40274BHP
17PH3K40027QABBCC40027BHP
18YZ3Y40270RABBCC40274BZY
19PH3K40027SABBCC40027BHP
20LC0Y40027TABBCC40027BCL
21LC0Y40127UABBCC40127BCL
22LC0Y40227VABBCC40227BCL
23LC0Y40327WABBCC40327BCL
24LC0Y40427XABBCC40427BCL
25YZ3Y40270YABBCC40270BZY
************************
please note the column value "40270" (column 7) and "40270" (column 18)

i need to compare the column 11 of File 1 against the column 7 and column 18 of File 2; any column (col 7 or 18) of File 2 has the same value of File 1 - that record of File 2 will be extracted.

I EXPECT THE OUTPUT TO BE
************************
01YZ3Y40270AABBCC40274BZY
06YZ3Y40274FABBCC40270BZY
08PH3K40270HABBCC40270BHP
11YZ3Y40270KABBCC40274BZY
13YZ3Y40274MABBCC40270BZY
15PH3K40274OABBCC40270BHP
18YZ3Y40270RABBCC40274BZY
25YZ3Y40270YABBCC40270BZY
************************

Hope i hear from any of you soon ;p
alanmdc
 
Posts: 2
Joined: Sun Dec 07, 2008 5:27 am
Has thanked: 1 time
Been thanked: 0 time

Re: Need Help to extract record comparing the 2 files

 

Re: Need Help to extract record comparing the 2 files

Postby NicC » Thu May 17, 2012 6:01 pm

Everyone (except me) seems to have the requirement to select records from a file based on a record in another file so there are plenty of solutions in the forum. Find one that matches your requirement, modify it match your specifics (columns and lengths etc) and, hey presto!, you are probably there.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Need Help to extract record comparing the 2 files

Postby BillyBoyo » Thu May 17, 2012 6:35 pm

If you look here, at the second solution from Skolusu, it will show you how to generate a DFSORT Symbol with a value from a file http://ibmmainframes.com/about57269.html

Then you use the Symbol like so:
  INCLUDE COND=(start1,length,CH,EQ,Symbolname,
               OR,start2,length,CH,EQ,Symbolname)


You should be close to the output you want.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post