Page 1 of 1

Posted: Wed Sep 08, 2010 9:49 am
by priyadarshikunal
Eventhough you posted it in server forum, i think its related to PX.

Datastage pads non significant zeros to decimal and hence the behaviour you saw in datastage management utility. If the values are correct there is no problem at all.

If you are loading it to database decimal field, there is no problem as you won't see the padded zero from database.

If you are writing it to sequential file, you can convert it to varchar using decimaltostring() with supress_zero rtype and then write it to file.It doesn't matter what datatype you are writing to a sequential file as it won't preserve the metadata.

Posted: Wed Sep 08, 2010 10:13 am
by mcas
priyadarshikunal wrote:Eventhough you posted it in server forum, i think its related to PX.

Datastage pads non significant zeros to decimal and hence the behaviour you saw in datastage management utility. If the values are correct there is no problem at all.

If you are loading it to database decimal field, there is no problem as you won't see the padded zero from database.

If you are writing it to sequential file, you can convert it to varchar using decimaltostring() with supress_zero rtype and then write it to file.It doesn't matter what datatype you are writing to a sequential file as it won't preserve the metadata.
Thanks priyadarshikunal!

The issue when writing to Seq File is that i'm using Schema files and i can't use functions as their are no columns.

DataSet --> Transformer --> Seq_File
(RCP)

But my problems comes when handling null. On the output sequential stage, if i use the field default null_field_value='' it reports the following warning:"null_field length (0) must match field's fixed width (28 )" because it assumes that all decimal fields are fixed length. This error is shown for every decimal field.

If i don't use the null_field_value i get the following warning: "Exporting nullable field without null handling properties"

So, using the null_field_value always show a warning. In this case, when writing to a sequencial file from a Dataset, always have present that the job has no columns to set individual properties or use transformer function. You only have the Seq Stage properties pane.

This is a small look of the output:

Code: Select all

C_EMEA_GB_5_201012091120|EMEA|GB|5| 00000000000000001357525.000| 00000000000000000651612.000| 00000000000000001248923.000| 00000000000000001900535.000| 00000000000000000054301.000| 00000000000000000597311.000| 
How can i change this post to Parallel? Do i have to copy everything?

Thanks!

Posted: Wed Sep 08, 2010 1:38 pm
by chulett
mcas wrote:How can i change this post to Parallel? Do i have to copy everything?

Thanks!
You cannot but luckily I can. :wink:

Posted: Wed Sep 08, 2010 3:26 pm
by mhester
In the schema file defined for the sequential file (input/output) define the decimal column like -

Code: Select all

USD_TA: not_nullable decimal[26,3] {null_field='00000000000000000000000000'};

Posted: Thu Sep 09, 2010 2:34 am
by mcas
mhester wrote:In the schema file defined for the sequential file (input/output) define the decimal column like -

Code: Select all

USD_TA: not_nullable decimal[26,3] {null_field='00000000000000000000000000'};
My intention is to take the output to a variable-length format. This way i'll be writing fixed length.

If i have a NULL value i would like to print simply (""). Which is the expected output format.

Posted: Thu Sep 09, 2010 3:50 am
by priyadarshikunal
what about reading everything as varchar?