× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi,

How to join two files like :-

FLD1 of file1 is of 6 (Decimal) and FLD2 of file2 of 9 character and we are
looking a match on these fields from file1's field1 ( it has some 6 digit
numbers) to file2' field2 ( which too have these 6 digit number but it's
position keep on varying in this field ( not fixed position but could be
between 1st to 4th position as total length of this number is 6 and field's
length is 9 here)

so i tried below join but it's giving results like below:-

CREATE VIEW mylib/FILE3 ( FLD1 , fld2 ) AS ( SELECT A.FLD1 , B.FLD2) FROM
LIBa/FILE1 a JOIN LIBb/FILE2 b ON
A.FLD1 = INT(NULLIF(REGEXP_REPLACE(B.FLD2, '[^0-9]',''),'')))

fld1 fld2
1 ABCDEF1
2,567 AB002567
1 0001 F
21 ABCDE021
File1 ( have field1 let's say it's name is X - Data type Decimal length 6,
it has other fields as well but we are currently not bothered about those
fields)

file2( have fiield1 let's say it's name is Y- Data type is Character with 9
length - it too have other fields in this file but currently we are not
bothered about those fields)


Just for example some dummy Data in File1's field X:-

1) 2044
2) 32,018
3)106



Just for example some dummy Data in File2's field Y:-

*
*B
*END
001 F
001 V
*
*
ZC057882
ZD071304
ZW002711
ABCDE


So the requirement is to join these two fields ( of these two files) in
such a way that for that the number( whose max length is 6 and data type is
decimal) in this field 1 we have to find it's corresponding match in Field
2 ( of file2) provided when we search a match in Field 2 ( of file2) then
we should extract only the equivalent number part from file2's field 2.

So If I get below kind of records :-

field 1 field 2

2044 000002044
----it's fine.
2044 00space2044
---it's not fine
2044 2044ABCDE
---it's not fine




Thanks

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.