Populate space to the output 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

ajithaselvan
Participant
Posts: 75
Joined: Mon Jul 12, 2010 4:11 am
Location: Chennai

Populate space to the output column

Post by ajithaselvan »

Hi,

I need to populate space to the output column.The data type for the column is float(2,5). Kindly help me to resolve.

Thanks,
Ajitha S
Althaf6553
Participant
Posts: 64
Joined: Wed Sep 26, 2007 6:52 am
Location: Syracuse ,NY

Post by Althaf6553 »

Is <Column Name>:' ' in the tranformer derivation not working?
Althaf
ajithaselvan
Participant
Posts: 75
Joined: Mon Jul 12, 2010 4:11 am
Location: Chennai

Post by ajithaselvan »

No. printing zero in the output

Thanks
Ajitha S
AVISSIVA
Participant
Posts: 5
Joined: Thu Dec 03, 2009 2:37 am

Re: POPULATE SPACE TO THE OUTPUT COLUMN

Post by AVISSIVA »

Hi,

1. Float data type should not contain space.

2. Anyway, if you load data into database with space automatically it may ignore the space.

3. Still if you need space, use transformer stage and Concatenate with space but the target column should be character.


Thanks
Sivakumar
srinivas.g
Participant
Posts: 251
Joined: Mon Jun 09, 2008 5:52 am

Post by srinivas.g »

set $apt_oracle_preserves_blanks is true and try....
Srinu Gadipudi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: POPULATE SPACE TO THE OUTPUT COLUMN

Post by chulett »

ajithaselvan wrote:I need to populate space to the output column.The data type for the column is float(2,5). Kindly help me to resolve.
The answer is simple - it cannot be done. Get a new requirement... for example, is the field nullable? Can it be represented as a string?
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

srinivas.g wrote:set $apt_oracle_preserves_blanks is true and try....
Haven't seen any mention of Oracle yet...
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ajitha S - please don't post in all capital letters, it is considered SHOUTING. I corrected your post Subject for you, so more of just an FYI. Thanks.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ajithaselvan
Participant
Posts: 75
Joined: Mon Jul 12, 2010 4:11 am
Location: Chennai

Post by ajithaselvan »

chulett wrote:Ajitha S - please don't post in all capital letters, it is considered SHOUTING. I corrected your post Subject for you, so more of just an FYI. Thanks.
Sure craig. This will not be repeated.

Regarding my query,
I'm funneling 2 inputs of same columns. column(col3) from input 1 throwing a value. column(col3) from input 2 will be written as space.
I'm not storing it in table. I'm sending as fixed width file.

Eg;
col1,col2,col3
1,2,3
1,4," "

Is there anyother way to achieve this?


Thanks in advance
Ajitha S
ajithaselvan
Participant
Posts: 75
Joined: Mon Jul 12, 2010 4:11 am
Location: Chennai

Re: POPULATE SPACE TO THE OUTPUT COLUMN

Post by ajithaselvan »

chulett wrote:
ajithaselvan wrote:I need to populate space to the output column.The data type for the column is float(2,5). Kindly help me to resolve.
The answer is simple - it cannot be done. Get a new requirement... for example, is the field nullable? Can it be represented as a string?
It can be nullable. But it can not be representated as string.

Regards,
Ajitha S
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: POPULATE SPACE TO THE OUTPUT COLUMN

Post by chulett »

ajithaselvan wrote:It can be nullable. But it can not be representated as string.
Actually, everything in a file is a string so it can. Set it to NULL and then edit the column so the 'null value' property is the appropriate number of spaces.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ajithaselvan
Participant
Posts: 75
Joined: Mon Jul 12, 2010 4:11 am
Location: Chennai

Re: POPULATE SPACE TO THE OUTPUT COLUMN

Post by ajithaselvan »

chulett wrote:
ajithaselvan wrote:It can be nullable. But it can not be representated as string.
Actually, everything in a file is a string so it can. Set it to NULL and then edit the column so the 'null value' property is the appropriate number of spaces.
Hi Craig,
It didn't work. populating zero.

Regards,
Ajitha S
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then you missed something. Tell us exactly what you did to correct this - how you made sure the output field was null at the right time and what exact properties you set for that field.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ajithaselvan
Participant
Posts: 75
Joined: Mon Jul 12, 2010 4:11 am
Location: Chennai

Post by ajithaselvan »

chulett wrote:Then you missed something. Tell us exactly what you did to correct this - how you made sure the output field was null at the right time and what exact properties you set for that field.
Before funneling, in both the inputs for the particular column
1. Set the field as nullable
2. In Extended proerties, set null filed value as required space

As it is not necessary that the field should be null or not null, i have changed.

Regards,
Ajitha S
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

OK... when you set the field to NULL (not a space ) it will show up in the file as whatever you put in for the null value - in this case as your 'required space'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply