Packed decimal issue

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
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Packed decimal issue

Post 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
pandeeswaran
horserider
Participant
Posts: 71
Joined: Mon Jul 09, 2007 1:12 pm

Post 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.
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post 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.
pandeeswaran
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post 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,
- james wiles


All generalizations are false, including this one - Mark Twain.
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post 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
pandeeswaran
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

And you won't find them in either of those stages because they are not import or export stages.
- james wiles


All generalizations are false, including this one - Mark Twain.
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

Yes understood. Thanks
pandeeswaran
Post Reply