How to pass column name instead of value?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 36
- Joined: Wed Feb 16, 2005 5:20 pm
- Location: IL
How to pass column name instead of value?
Hi All,
Is there any way to pass the column name instead of the vlaues comming in I dont need the values i just need the column name to pass.
Ex:
seq file -> tx -> seqfile
i want to pass 1st columnname from seqfile to transformer instead of value.
Is there any way to pass the column name instead of the vlaues comming in I dont need the values i just need the column name to pass.
Ex:
seq file -> tx -> seqfile
i want to pass 1st columnname from seqfile to transformer instead of value.
Amith Chalasani
Infosphere Solution Architect & Admin
Northern Trust
Infosphere Solution Architect & Admin
Northern Trust
-
- Participant
- Posts: 36
- Joined: Wed Feb 16, 2005 5:20 pm
- Location: IL
Is the table definiton for the file saved in the repository? In which case why dont you hardcode the column name in a Column generator and generate an additional column before sending it to the transformer?chalasaniamith wrote:yes thats true i want to pass the column name from table definition..
Since your requirement - why you need this column name - is not clear, it would be difficult to give you an optimal solution.
Last edited by thebird on Thu Dec 07, 2006 7:56 pm, edited 1 time in total.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Not possible.
You could create some logic to read it from the schema file, if you are using a schema file to describe the structure of data in the source text file. But there is no mechanism for passing metadata when DataStage expects that you are passing data.
After all, the column name is a property of the link; it should already be there in the Transformer stage.
You could create some logic to read it from the schema file, if you are using a schema file to describe the structure of data in the source text file. But there is no mechanism for passing metadata when DataStage expects that you are passing data.
After all, the column name is a property of the link; it should already be there in the Transformer stage.
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: 36
- Joined: Wed Feb 16, 2005 5:20 pm
- Location: IL
bcoz you want pass rest of values in the file except for one column i need to pass the column name.
Since your source is a single file, why not use a UNIX command (perhaps CUT) in an External Source stage to read everything except for the First column and then pass downstream. You can make this ommit any of your fields from being passed to the next stage.
Aneesh
-
- Premium Member
- Posts: 210
- Joined: Wed Feb 16, 2005 7:17 am
Or to add to the above mentioned solutions, you can get the column names from the database catalogue tables and pass them downstream just like any other data. Later another operation (like the one suggested by thebird) could be used to pass down the required set of data which you can later merge with what you had received earlier.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: How to pass column name instead of value?
chalasaniamith wrote:Hi All,
Is there any way to pass the column name instead of the vlaues comming in I dont need the values i just need the column name to pass.
Ex:
seq file -> tx -> seqfile
i want to pass 1st columnname from seqfile to transformer instead of value.
note: It would help you get better answers if we
knew _why_ you wanted to do this.
If I had to do what you're describing, I would
try to talk my clients out of it.
Failing that, how does this sound?
I'm assuming that your input file has column-headers in
the first record. If it doesn't, you'll need another
place to get them from.
Make seqfile_in and head read from the same file.
Tell seqfile_in that the file contains header-info.
Tell head the file DOES NOT contain header info (oh
yeah - also tell head to load only 1 record).
Kinda like this:
Code: Select all
seqfile_in --> lookup --> tx --> seqfile_out
/|\
|
head------------+
maybe splitting your cols-to-rows and loading the lookup
info from that would work.
Anyway, good luck.
John G.
-
- Participant
- Posts: 36
- Joined: Wed Feb 16, 2005 5:20 pm
- Location: IL
Re: How to pass column name instead of value?
thanks its worked arround..
Amith Chalasani
Infosphere Solution Architect & Admin
Northern Trust
Infosphere Solution Architect & Admin
Northern Trust