How can you do the following:
A file coming in through DataStage has one record coming in. The reference file has two records, which are stored in a hash file. We would like to have in the output two records. A left or right join in a query would work, but how can you do this in DataStage?
Example:
The file has:
zip_code, comp_cd, resp_cd, zipcount
00959, A, E, 1
The hash file has:
Zip_code, comp_cd, resp_cd, zipcount, RSID, ZIP_SPLIT_QTY, Perzipcount
00959, A, E, 1, 3G6D, 90, 0.9,
00959, A, E, 1, 3G6M, 10, 0.1,
Thanks!
Rodre
Output two records
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
Hi Rodre,
If you have the reference file in a sequential file rather than a hashed file. Then you can try using the 'Merge' Stage. You can perform the following joins using the 'Merge' Stage:
HTH,
Naveen.
If you have the reference file in a sequential file rather than a hashed file. Then you can try using the 'Merge' Stage. You can perform the following joins using the 'Merge' Stage:
Code: Select all
Pure Inner Join
Complete Set
Right and Left Only
Right Outer Join
Left Outer Join
Right Only
Left Only
Naveen.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
naveen is right. use the merge stage to achieve your goal. if you use a hash file, depending on your key, the duplicates will be removed. check and make sure you have those two records in the hash file which i highly doubt, as your key would be one of the first four columns, which are identical. hash file will skip the first record and store the second record only.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Hi Rodre
Another way to think is to swap your Sequential file to reference and hash file as your main file. Treat your hash file as source and convert your input Sequential file to hash file. This is just another way to do
Another way to think is to swap your Sequential file to reference and hash file as your main file. Treat your hash file as source and convert your input Sequential file to hash file. This is just another way to do
Regards
Siva
Listening to the Learned
"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar
Siva
Listening to the Learned
"The most precious wealth is the wealth acquired by the ear Indeed, of all wealth that wealth is the crown." - Thirukural By Thiruvalluvar