Merger two csv files as two seperate worksheet
Moderators: chulett, rschirm, roy
Merger two csv files as two seperate worksheet
All, have a question. I have two jobs for two separate CSV output. Now I need to merge them into single CSV file with two different worksheet. Can we achieve this in Datastage?? Appreciate for any other suggestions.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not enough information, though the answer is probably yes. Are the metadata of the two CSV files identical? What does the resultant CSV file have to look like in terms of its columns? What has "worksheet" got to do with anything?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Never assume.
The stated requirement is to merge two CSV files into one CSV file. That can be done easily with DataStage once the rules for merging are comprehended.
But why was "worksheet" mentioned in this case?
The stated requirement is to merge two CSV files into one CSV file. That can be done easily with DataStage once the rules for merging are comprehended.
But why was "worksheet" mentioned in this case?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Ray and Craig, thanks for the reply. Let me go through the data again. I initially thought two files have complete separate data but seems like one key column is common. Then merger would definitely work.
Craig, Initial requirement was excel output. But 11x onwards we have excel output in unstructured stage. We have 9.1. Any helpful link on ODBC excel output would be great.
Thanks.
Craig, Initial requirement was excel output. But 11x onwards we have excel output in unstructured stage. We have 9.1. Any helpful link on ODBC excel output would be great.
Thanks.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Given that you're running on Windows you should be able to use the Microsoft ODBC driver for Excel to write to an existing (even if empty) worksheet. Alternatively write to a CSV file that can be opened using Excel.
With a common key it should be a simple join. Start with a full outer join so that you can determine which rows exist in both CSV files and which in one only. Refine your design as appropriate.
With a common key it should be a simple join. Start with a full outer join so that you can determine which rows exist in both CSV files and which in one only. Refine your design as appropriate.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
<cough>
You'll never be able to approach this with a csv target if you really need the two files merged into one file with 'two different worksheets'. That doesn't mean you couldn't create two different csv files and then macro up something in Excel to bring them in. I've seen discussions on this and also where HTML stored with an XLS extension can work as well. Plenty of topics out there on reading Excel but I couldn't find anything on Excel as a target that does more than just mention ODBC as an option. You may want to contact support to see what documentation they may have... or see if anyone here has done it.
Vincent in the linked post above does mention writing to two 'tables' via ODBC to create one spreadsheet with two worksheets. You might want to just give that a shot, see what happens.
You'll never be able to approach this with a csv target if you really need the two files merged into one file with 'two different worksheets'. That doesn't mean you couldn't create two different csv files and then macro up something in Excel to bring them in. I've seen discussions on this and also where HTML stored with an XLS extension can work as well. Plenty of topics out there on reading Excel but I couldn't find anything on Excel as a target that does more than just mention ODBC as an option. You may want to contact support to see what documentation they may have... or see if anyone here has done it.
Vincent in the linked post above does mention writing to two 'tables' via ODBC to create one spreadsheet with two worksheets. You might want to just give that a shot, see what happens.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers