ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » OK It's doing my Head in - Zeroes on numeric values

Post new topic  Reply to topic
 OK It's doing my Head in - Zeroes on numeric values « View previous topic :: View next topic » 
Author Message
nathanw
PostPosted: Tue Jan 19, 2010 8:13 am    Post subject: OK It's doing my Head in - Zeroes on numeric values Reply with quote

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.

Only the User Trace Speaks The Truth
Back to top
View user's profile Send private message MSN Messenger
mgk
PostPosted: Tue Jan 19, 2010 11:42 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

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.
Back to top
View user's profile Send private message
nathanw
PostPosted: Wed Jan 20, 2010 1:13 am    Post subject: Reply with quote

Knight

Joined: 14 Jul 2004
Posts: 550

mgk many thanks

thats sorted it


_________________
Who is General Failure and why is he reading my hard drive?

Artificial Intelligence stands no chance against Natural Stupidity.

Only the User Trace Speaks The Truth
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » OK It's doing my Head in - Zeroes on numeric values
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.