Decimal data reading using sequential file stage

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
Amit Jaiswal
Premium Member
Premium Member
Posts: 38
Joined: Fri Apr 22, 2005 6:07 am

Decimal data reading using sequential file stage

Post by Amit Jaiswal »

Hi,

We are migrating few Ab Initio graphs into Datastage jobs. We are facing some issues while reading decimal values using sequential file stage. Source and target files are ASCII plain text files. We are reading one columns as decimal(5,2). We can see actual value stored inside the source file is not having any period (.). Value stored is 12345 inside the source file without any decimal point. With decimla(10,2) datastage is reading this value as 00012345.00 whereas Abi is reading this value is 123.45 with same data type. How should I select datatype and options so as to read period properly even if it is not visible inside the source file. I know manually we can do it but I want to directly read this the way Ab Initio is reading the data.
Thanks in advance.
-Amit
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Did you specify scale = 2 in the DataStage column definition?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Amit Jaiswal
Premium Member
Premium Member
Posts: 38
Joined: Fri Apr 22, 2005 6:07 am

Post by Amit Jaiswal »

Hi Ray,

Yes I have specified. However, since period is not visible in the file. DS is reading this data with decimal(10,2) data type as 00012345.00. I think in ab initio they have a option whether to display period or not. In ab inition decimal(10,2) means do not do not read or write period

[img]
Content from help:
Explicit and implicit decimal points
If the decimal point is explicit, indicate this by a period before position. There must be a decimal point in input data, and a decimal point is inserted in output data. Examples:

decimal(4.2) decimal(";".2)If the decimal point is implicit, indicate this by a comma before position. There must be no decimal point in input data, and no decimal point is inserted in output data. Examples:

decimal(5,3) decimal(";",5) NOTE: If you omit position in the specification of a zoned decimal, the decimal position is zero and only integral values are represented. This is also true for packed and scaled binary decimals. For more information, see "Zoned decimals", "Packed decimals: Defined", and "Scaled binary decimal syntax".
[/img]

What's the similar options in DataStage? If I am taking normal decimal with precision or character with equivalent length then data is getting trucated. Equivalent lenght means for decimal(10,2) field width I have to take field width as 10 or take the data type as char(10). With this data is getting truncated. If I increase the field width then fixed width file size is more than the Ab Initio is having which is not acceptable to the downstream users.

Thanks,
-Amit
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The quick fix is to read as delivered and divide by 100. Further thought and experimentation is needed to give a technical solution, and I don't have access to Enterprise Edition just at the moment.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gbusson
Participant
Posts: 98
Joined: Fri Oct 07, 2005 2:50 am
Location: France
Contact:

Post by gbusson »

What is the decimal separator specified for the project?is it . or , or none?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I think it's clear from the original post that it's none.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply