packed decimal value, how to supress zeros

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
Gaurav.Dave
Premium Member
Premium Member
Posts: 62
Joined: Tue Sep 21, 2004 10:24 am
Location: IBM - Chicago Area

packed decimal value, how to supress zeros

Post by Gaurav.Dave »

Hello,

I have 4 set of datastage job, which is running in sequence to achieve the desire target valus....
(1) DB2 -->xfm--> Datasets,
(2) Datasets ---->join--->Datasets,
(3) Datasets ---> join-->xfm---> Sequential file
and then
(4) db2 loader to load to target db2 database.

When I check the Sequential file stage, the last one before running db2 loader, I have some decimal values (8,0) which is representing like "00000000."). This creating problem while loading to target database, I am getting error message "cannot be converted to
a PACKED DECIMAL value, but the target column is not nullable" and records are being dropped.

I am trying to convert "00000000." to "0" means supressing zeros so that I can load it to the target database.

Can anyone guide me how to achieve it?

Thanks,

Gaurav
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Probably whats happening is that you are trying to load the Null values in a Sequential file. This will not be handled, hence DS is converting the nulls to a default.
I would recommend a peek stage to be added to all the jobs and observe the data there and post your observation.
Thanks.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Zero is not valid to be represented as a packed decimal. Search the forum for "PACKED" "zero" (all terms) to find an environment variable that allows this behaviour to be overridden.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Gaurav.Dave
Premium Member
Premium Member
Posts: 62
Joined: Tue Sep 21, 2004 10:24 am
Location: IBM - Chicago Area

Post by Gaurav.Dave »

Thanks Ray

Still I am not able find the solution. Wondering if I need edit properties for the particular column (decimal one)..

Regards,
Gaurav
Abhijeet
Participant
Posts: 20
Joined: Wed Jul 27, 2005 1:00 am

Post by Abhijeet »

Gaurav.Dave wrote:Thanks Ray

Still I am not able find the solution. Wondering if I need edit properties for the perticular column (decimal one)..

Regards,
Gaurav
you need to do two things .

1> remove the "." from the string when writing it to the file.
2> by default "all zeroes" is not considered as a packed decimal value {atleast in datastage}. So you need to change some property in ur db so that it will accept it.
kommven
Charter Member
Charter Member
Posts: 125
Joined: Mon Jul 12, 2004 12:37 pm

Post by kommven »

USE Abs OR DIVIDE THE VALUE BY 1 IN TRANSFORMER
Post Reply