| Author | Message | 
		
		  | shogan2003 | 
			  
				|  Posted: Mon Jan 26, 2004 11:49 am    Post subject: DECIMAL places |   |  | 
		
		  | Centurion
 
 
 Joined: 03 Jul 2003Posts: 133
 Location: London
 
 | 
			  
				| I'm not getting 2 decimal places when mapping to a message set element declared to be of type DECIMAL. the output is XML 
 
 The msgset was generated using the XSD import support pac
 
 I am using WMQI 2.1
 
 Is this a known bug or is some further adjustment required to the msg set ?
 
 Thanks in advance
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | kirani | 
			  
				|  Posted: Mon Jan 26, 2004 11:54 am    Post subject: |   |  | 
		
		  | Jedi Knight
 
 
 Joined: 05 Sep 2001Posts: 3779
 Location: Torrance, CA, USA
 
 | 
			  
				| It would be helpful if you could provide more information on this, like your current input data and expected output data, properties of MRM elements in question. _________________
 Kiran
 
 
 IBM Cert. Solution Designer & System Administrator - WBIMB V5
 IBM Cert. Solutions Expert - WMQI
 IBM Cert. Specialist - WMQI, MQSeries
 IBM Cert. Developer - MQSeries
 
 
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | shogan2003 | 
			  
				|  Posted: Tue Jan 27, 2004 3:17 am    Post subject: |   |  | 
		
		  | Centurion
 
 
 Joined: 03 Jul 2003Posts: 133
 Location: London
 
 | 
			  
				| Well the field is DECIMAL and I haven't added a CWF layer. 
 If a field is DECIMAL I might expect its default to be 2 decimal places.
 Otherwise, can I use CWF to configure it for 2 decimal places ?
 
 Thanks in advance
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | kimbert | 
			  
				|  Posted: Tue Jan 27, 2004 4:59 am    Post subject: |   |  | 
		
		  |  Jedi Council
 
 
 Joined: 29 Jul 2003Posts: 5543
 Location: Southampton
 
 | 
			  
				| So you want to output 2 decimal places in XML? If the value of 'decimalElement' in the tree is 123, you still want to output 
 
   
	| Code: |  
	| <decimalElement>123.00</decimalElement> |  
 Why do you ask about CWF? Is your input message being parsed as CWF?
 
 Please answer the questions - we need to know the input format, the output format and any relevant settings on the element in question. Otherwise we're  just guessing.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | wooda | 
			  
				|  Posted: Wed Jan 28, 2004 2:41 am    Post subject: |   |  | 
		
		  |  Master
 
 
 Joined: 21 Nov 2003Posts: 265
 Location: UK
 
 | 
			  
				| If you are inputing and outputing in MRMXML and you have modelled the field as a DECIMAL then you will not get insignificant decimal places. ie. 123 will always be output as 123 and not 123.00 
 Although in CWF and TDS you can control how many decimal places you get you cannot in XML it will output significant digits only.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | fschofer | 
			  
				|  Posted: Wed Jan 28, 2004 5:43 am    Post subject: |   |  | 
		
		  |  Knight
 
 
 Joined: 02 Jul 2001Posts: 524
 Location: Mainz, Germany
 
 | 
			  
				| One possible solution for your problem: 
 Define your XML elements as string and do your CASTs on your own.
 Decimal elements seems always to be cut like zanda mentioned.
 
 Code sample:
 
 
 
   
	| Code: |  
	| DECLARE TEST_DEC    DECIMAL; 
 SET TEST_DEC = 123.4;
 
 SET "OutputRoot"."MRM"."test_string" = CAST(  (CAST( TEST_DEC AS DECIMAL(7,4) )) AS CHAR);
 SET "OutputRoot"."MRM"."test_decimal" = CAST( TEST_DEC AS DECIMAL(7,4) );
 |  
 
 
   
	| Code: |  
	| <?xml version="1.0"?><!DOCTYPE MRM PUBLIC "DPQP2300C0001" "www.mrmnames.net/DPQP2300C0001"> <MRM xmlns="www.mrmnames.net/DPQP2300C0001">
 <TEST_MSG>
 <test_string>123.4000</test_string>
 <test_decimal>123.4</test_decimal>
 </TEST_MSG>
 </MRM>
 |  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |