[Urgent] Mutiple Input Files and Mutiple Tables

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
quest_ds
Participant
Posts: 8
Joined: Thu Jun 14, 2007 8:18 am
Location: India

[Urgent] Mutiple Input Files and Mutiple Tables

Post by quest_ds »

Hi,

I am very new to DataStage and Data warehousing.
I am using DataStage 7.5.1 on Windows.

I want to insert data from a single csv into database (Oracle 10g).
The CSV File looks something like this:

XXX,001,PO,06/06/2006,USER
XXX,002,PR,08/12/2006,USER
YYY,APE,1200,EUR,12/12/2005,USER
YYY,ARE,1200,USA,2/2/2005,USER

where XXX,YYY is the code to indicate the table name (DB_XXX,DB_YYY)

Initailly I have to put these data's into a filler table (FILLER_TABLE)
Something like
Name Type
-------------------------------------------------
TABLE_CODE VARCHAR2(5)
FILLER_1 VARCHAR2(250)
FILLER_2 VARCHAR2(250)
FILLER_3 VARCHAR2(250)
FILLER_4 VARCHAR2(250)
FILLER_5 VARCHAR2(250)


Then I'll be putting them into respective tables (DB_XXX,DB_YYY).

My query is:
1) How to handle files which have varying columns?
2) In the transformer how do I tel it to go into a particular table based on the TABLE_CODE?
3) Please suggest any tutorial,example materials on net

Thank You
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Welcome Aboard
If you know the maximum number of columns your csv file can have, you can create the metadata according to that. For missing columns yo can go to the column's tab and specify the 'Missing Column' option, so that the sequential file stage wont complain.
You can set constraints in the transformer stage to split your records into multiple streams going down to different tables.
If you are completely new to the product, I would advise format training. Also go through the help pdf files.

Please do not use words like urgent and ASAP. This will only delay the response. This is an all volunteer site and urgent requires big bucks.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
quest_ds
Participant
Posts: 8
Joined: Thu Jun 14, 2007 8:18 am
Location: India

Post by quest_ds »

Hi,
Thank you for the suggestion on the subject line. Will always keep in mind.

And also thanks a lot for your suggestion on the query.
quest_ds
Participant
Posts: 8
Joined: Thu Jun 14, 2007 8:18 am
Location: India

Post by quest_ds »

:roll:

How do I apply constraint in the transformer.?
I used

if TABLE_CODE = 'XXX'
then
input.Filler_1
else
log message

I want to know if there is any other approach for the same
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The constraint in the Transformer is applied in the Constraints grid. Choose the second tool from the left in the toolbar.
The constraint expression itself is a true/false for each output link, for example

Code: Select all

TABLE_CODE = "XXX"
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
quest_ds
Participant
Posts: 8
Joined: Thu Jun 14, 2007 8:18 am
Location: India

Post by quest_ds »

My question is not answer :(
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

With more DataStage knowledge you'd appreciate that your question HAS been answered. And on a weekend, what's more. How much would THAT cost from your support provider?!!

Code: Select all

                         +--->  Table XXX   (constraint TABLE_CODE = "XXX")
  ------->  Transformer  +--->  Table YYY   (constraint TABLE_CODE = "YYY")
                         +--->  Table ZZZ   (constraint TABLE_CODE = "ZZZ")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
quest_ds
Participant
Posts: 8
Joined: Thu Jun 14, 2007 8:18 am
Location: India

Post by quest_ds »

All the answers in this forum seems to be only for the paid users. I cannot view your answer...

Have to check out some other forum.

Anyways thanks for responding.
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There are only five premium posters. You can view all of everyone else's posts. Premium membership is one way to help to defray the bandwidth costs of DSXchange. It's only a few cents per day.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Nothing is stopped any of the other 17,000 members from posting answers to your questions. Problem is most of them tend to shy away from trying to conduct training sessions here, which is what looks to be needed and which is not the purpose of this site. We are a community of users, helping each other to solve problems. We're not a substitute for proper training. And as noted, your question actually has been answered, which is probably another reason you don't see anyone else popping in.

Anyway, check your duplicate thread (another frowned upon practice, please avoid doing so in the future) for more 'training like' answers.
-craig

"You can never have too many knives" -- Logan Nine Fingers
quest_ds
Participant
Posts: 8
Joined: Thu Jun 14, 2007 8:18 am
Location: India

Post by quest_ds »

I have found my answer.
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

<color=blood>Customary practice here is that you make a final post letting future searchers know what the answer is, and mark the thread as Resolved.

Only the original poster can mark the thread as resolved.
</color>
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply