Posted: Tue Jan 19, 2010 8:13 am Post subject: OK It's doing my Head in - Zeroes on numeric values
Knight
Joined: 14 Jul 2004 Posts: 550
The routine is as follows
have incoming value to look up several othervalues on a db - no problem
retrive values from db - no problem (ish)
initially set everything as CHAR just so I can get a outputroot built now am slowly getting the details sorted
so i have 3 fields (FIELD A, FIELD B, FIELD C) populated from my db lookup and a forth from a calculation of the 3 fields (FIELD D = FIELD A * FIELD B* FIELDC)
so firstly have to create a formula for the calculation
so first hurdle
FIELDS A B C have to be concatenated together for the target system to insert into database
these values will therefore need to be CHAR (as an example) for the concatenation process to work
done and dusted
onto hurdle 2
FIELD D is calculated from FIELD A B and C as mentioned above. now these values have to be a numeric in order to carry out the formula
so cast the values as in FIELD A B and C as DECIMAL with a 6,3 setting
Calculation works a treat..
so now we have all population and concatenation and formulas working
woohoo
yu think end of story welllllll
NO
The concatenated results of FIELDS A B and C need to show the preceediing zeroes
So my problem is now that everything has been recast as DECIMAL etc how can I ensure that the preceedin zeroes unto a maximum number (3) appear without having to write long labiorious padding
all of this is being handled in XML environment btw no CWF / MRM involvement
Thanks guys
Broker 6.0.2 on Windows but future on RHEL _________________ Who is General Failure and why is he reading my hard drive?
Artificial Intelligence stands no chance against Natural Stupidity.
Look up the FORMAT clause for the CAST to decimal... _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum