Adding a new column

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Munish
Participant
Posts: 89
Joined: Sun Nov 19, 2006 10:34 pm

Adding a new column

Post by Munish »

Hi Everybody,
Wishing you all a very happy new year.

My datasource is a dataset (DS1) created by previous job.
I need to add another columns and pass on the new dataset (DS2)
(DS1 + new column)

This new column is numeric.
It is like appending another column with value 1 to DS1 to all the rows.

Could any one help me with that.

Thanks and regards,
Munish
MK
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Use Column generator stage to generate the new column.
In Columns tab Right Click --> Edit Row and give appropriate generator Properties to derive constant value of 1.
Munish
Participant
Posts: 89
Joined: Sun Nov 19, 2006 10:34 pm

Post by Munish »

Yes, thats what I am using.
But my value is just one fixed number say 1 (numeric)
I am strugling to fill that column with that value (1).

Thanks
MK
BalageBaju
Participant
Posts: 34
Joined: Fri Sep 22, 2006 10:59 pm
Location: India

Post by BalageBaju »

Munish,

You can do as per the Balaji's suggesstion. Where are you getting struggled? In the column properties you can mention as follows:

Code: Select all

Type=cycle
Initial Value=1
Increment=0
Limit=1 
Hope this will help you to resolve your problem.
Regards,
Balaji.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

When you right click ---> Edit Row ,what is your generator type?

Set generator type = cycle. Set Initial value = 1 and Limit = 1.
sudeepmantri
Participant
Posts: 54
Joined: Wed Oct 25, 2006 11:07 pm
Location: Hyderabad

Re: Adding a new column

Post by sudeepmantri »

Use a column generator to generate a column of type integer. In the column tab of the column generator stage, double click the name of the column(short-cut method). Add the type as cycle. Initial value as 1 and increament by 0(Initial value and Increament are tsub-property of type)
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Munish wrote:Yes, thats what I am using.
But my value is just one fixed number say 1 (numeric)
I am strugling to fill that column with that value (1).

Thanks
Thats a confusing statement. Clarify please, else we will just be guessing.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Either of the two solutions will work for you. Initial value is 1. Either use 0 as the increment, in which case limit is irrelevant, or use limit 1, in which case increment can be any non-negative integer, but 0 or 1 is easiest.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Munish
Participant
Posts: 89
Joined: Sun Nov 19, 2006 10:34 pm

Post by Munish »

Thanks Gentlemen,
It worked in the first instance itself,
Regards,
Munish
MK
Post Reply