Page 3 of 3

Posted: Fri Jul 21, 2006 11:01 am
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....?

Posted: Fri Jul 21, 2006 11:36 am
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

Posted: Sat Jul 22, 2006 10:07 pm
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.

Posted: Tue Jul 25, 2006 5:39 pm
by csrazdan
Change Numaric datatype to Integer

Posted: Mon Jul 31, 2006 4:29 pm
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