I have a data file like :
name|age
drew|23
moore|45
I have another query returning a max value of some column,say max_value be column name and its max value be 1000.
Now i want a output file like
name|age|max_value
drew|23|1000
moore|45|1000
How can this be done with best efficient way in Datastage.
Amit
Adding a Column to a Table
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It's easy enough in DataStage - if the target table has the extra column, simply use the new metadata (table definition) an assign the constant 1000 to that column for all rows. Probably easiest is a Column Generator stage with a cycle beginning at 1000 with an increment of 0.
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.
Adding a Column to the Table
ray.wurlod wrote:It's easy enough in DataStage - if the target table has the extra column, simply use the new metadata (table definition) an assign the constant 1000 to that column for all rows. Probably easiest is a ...
The constant value of max_value column is determined at the time of job execution and is not pre defined.
So i cant declare tht in meta data definition of the table.
Have to figure out some other way around.
Amit
Hi,
Simply replcae the constant with a lookup to get runtime value.
The max value gained from the lookup should be loaded to memory so you should have no problem.
IHTH,
Simply replcae the constant with a lookup to get runtime value.
The max value gained from the lookup should be loaded to memory so you should have no problem.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
![Image](http://www.worldcommunitygrid.org/images/logo.gif)
If i use lookup then there is no key values on which i can specify the lookup.roy wrote:Hi,
Simply replcae the constant with a lookup to get runtime value.
The max value gained from the lookup should be loaded to memory so you should have no problem.
IHTH,
So i will get Nulls returned for 1 table in Lookup stage.
Can u explain me the exact flow which ur talking about.
Thanks
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: