fmt FROM SERVER TO PARALLEL

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

suresh_dsx
Participant
Posts: 160
Joined: Tue May 02, 2006 7:49 am

Post by suresh_dsx »

I tried with a sample test the following

First i took a column name: Col1
Data type: Decimal
Data length: 15

First Stage variable name SONE: DecimalToString(DSLink4.Col1)
Second stage variavle name STWO: Length(SONE)
Third stage variable name STHREE: STR('0',9 - STWO)

The valus is passed to the target column name is FCol1
Data type: Varchar
Data lenth:30

i am getting the following output

source input:

123

target
000000000000123

It is not giving the actual result... what ever the input value ///it is reading and giving as an output...
the source column length is 15.. thats way it is giving 15 lenth...

i want only 9 lenth ....which is minus with the length of the column

i tried will all the options... this is immedeiate requirement to the client ... i am very new to parallel .... please help me on this


Thanks
Suresh
suresh_dsx
Participant
Posts: 160
Joined: Tue May 02, 2006 7:49 am

Post by suresh_dsx »

I tried with a sample test the following

First i took a column name: Col1
Data type: Decimal
Data length: 15

First Stage variable name SONE: DecimalToString(DSLink4.Col1)
Second stage variavle name STWO: Length(SONE)
Third stage variable name STHREE: STR('0',9 - STWO)

The valus is passed to the target column name is FCol1
Data type: Varchar
Data lenth:30

i am getting the following output

source input:

123

target
000000000000123

It is not giving the actual result... what ever the input value ///it is reading and giving as an output...
the source column length is 15.. thats way it is giving 15 lenth...

i want only 9 lenth ....which is minus with the length of the column

i tried will all the options... this is immedeiate requirement to the client ... i am very new to parallel .... please help me on this


Thanks
Suresh
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Suresh - I am going to give up soon; I don't understand what you are doing or saying and it seems that you haven't done what I asked, but are posting other output.

Please do one thing - if your input column DSLink4.test1 is of a number type then please do NOTHING except this derivation to a VarChar(10) column:

Code: Select all

STR('0',9 - Len(DecimalToString(DSLink4.test1))):DecimalToString(DSLink4.test1)
please note - no stage variables, no other derivations. Just this code and writing to a VarChar(10) column.
Post Reply