Leading 0's

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

DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post by DS_MJ »

us1aslam1us wrote:Hi DS_MJ

The problem is with the data coming from your source.The code which DSGURU gave you is perfect. The thing is that you are not defining the scale when you are pulling the data from the source.

Just my suggestion:

Code: Select all

Source TABLE      
COL_NAME         SQLTYPE   LENGTH          SCALE                NULLABLE 
PAR_AMOUNT       Dec           17       whatever the scale is           No 


TARGET TABLE 

COL_NAME                   SQL TYPE   LENGTH SCALE NULLABLE 
out_fa003_lsmw.PAR_AMOUNT  VarChar     17           No

I tried my way just check it once.

Sam
Hello ray.wurlod and us1aslam1us:

First thank you for your replies.

ray.wurlod - I am working on getting my company to sponsor me to be a premium member of this site. Hopefully the number of my postings and my solutions will finally convince him or else just become a member myself. Hence was unable to read all you had to say. :(

us1aslam1us - There is no scale mentioned on the source side hence I kept it blank on the target side too. I agree about DSguru2B's format function works just fine on my test job that has a flat file as my source and a flat file as my target. But with Db2 API the fmt function on the column it replaces the cents to .00 I need to see the cents value ie: 12345.67

Does DB2 API change values when passing columns to a flat file....?
Thanks in advance,
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Hi DS_MJ

Just try to define the scale to 2 in the source and see what happens? Orelse ask your DBA what is the precision on that column.

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

Post by DSguru2B »

Ok, try this,

Code: Select all


(PAR_AMOUNT*100)/100
That arithmatic manipulation should get the issue resolved, then again i do not understand why you/data modeler, has set an amont field as varchar in the database.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
csrazdan
Participant
Posts: 127
Joined: Wed May 12, 2004 6:03 pm
Location: Chicago IL

Post by csrazdan »

Change Numaric datatype to Integer
Assume everything I say or do is positive
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post by DS_MJ »

Thanks Everybody:

Changed the SQL Type to LongNVChar and was able to use the FMT function given by DSguru2B successfully.

Appreciate everybodys input. You guys are the best. :D
Thanks in advance,
Post Reply