Page 1 of 1

Packed decimal issue

Posted: Mon Dec 05, 2011 3:41 am
by pandeesh
HI,

My input string contains many fields like:

1234670001234E

In this the substring input[7,8] contains decimal (overpunched).

So, in the transformer i am splitting the individual fields from the raw string.

But in this case, even though i have specified the properties in target for reading decimal, it still loads 00000.00 only.

So, can't we read the zoned/packed decimal in intermediate stages(transformers)?

In the source seq file stage, i am reading whole as varchar and i am splitting in transformer.

Please help me in this.

Thanks

Posted: Mon Dec 05, 2011 9:40 am
by horserider
When you are dealing with Packed Decimals, unload the file as complete one column (maximum length of the row) in first step. Don't do anything in this step. Just unload the file on your UNIX server. You can either unload via ftp script or use ftp plugin, use 'BINARY' as transfer mode.

Once you unload the file, use the file layout of the actual file using Complex flat file stage to read individual columns. That will give you all correct values.

Posted: Mon Dec 05, 2011 9:42 am
by pandeesh
From some of the experiments,i realize that, in the source sequential file stage, if we read the zoned/decimal with required properties, it's working fine.
But if we read as varchar and then we can't read it in intermediate stages.
In that case, we need to go with our own transformations.

Posted: Mon Dec 05, 2011 1:38 pm
by jwiles
If you're going to insist on reading the row into a single varchar then after you have broken out the columns use Column Importer to import the zoned decimal column (same options as in sequential file).

Regards,

Posted: Mon Dec 05, 2011 9:20 pm
by pandeesh
Thanks James!!

I haven't tried using column importer.
But in transformer and copy stages , i haven't seen those options for decimal.

Thanks

Posted: Mon Dec 05, 2011 9:43 pm
by jwiles
And you won't find them in either of those stages because they are not import or export stages.

Posted: Mon Dec 05, 2011 9:57 pm
by pandeesh
Yes understood. Thanks