| Author | 
		  Message
		 | 
		
		  | Chuck831 | 
		  
		    
			  
				 Posted: Mon Nov 22, 2004 2:01 pm    Post subject: Convert ASCII Characters | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 23 Dec 2002 Posts: 28
  
  | 
		  
		    
			  
				hope someone can point me in the right direction. Is it possible to convert a value to an extended ASCII character. 
 
 
Example: (XML Input Message - XML Domain) 
 
 
<DataArea> 
 
<Customer>John Doe</Customer> 
 
<Address> 602 1/2 Main Street</Address> 
 
</DataArea> 
 
 
The customer would like to convert the 1/2 to ASCII code 189 (½) in the output message for display purposes. I've looked at the CAST function and the BITSTREAM function but I'm still having trouble. 
 
 
Environment: 
 
 
Control Center 2.1 
 
MQ Series: 5.2.1 
 
CSD03 
 
Windows 2000 Server 
 
 
Thanks for any assistance you can provide. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kirani | 
		  
		    
			  
				 Posted: Tue Nov 23, 2004 12:14 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Jedi Knight
 
 Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA 
  | 
		  
		    
			  
				Have you tried casting X'0189' to CHAR using CCSID option. It might give you ½ char. _________________ 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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqbee | 
		  
		    
			  
				 Posted: Tue Nov 23, 2004 1:41 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Novice
 
 Joined: 31 Jul 2003 Posts: 15
  
  | 
		  
		    
			  
				Hi,
 
If am not wrong it should be X'BD' instead of X'0189'. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Chuck831 | 
		  
		    
			  
				 Posted: Tue Nov 23, 2004 9:38 am    Post subject: Convert ASCII Characters | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 23 Dec 2002 Posts: 28
  
  | 
		  
		    
			  
				Guys, I tried using the following, but I'm still not having much luck. If you could point out any errors I'm making that would be great.
 
 
I'm using the following code:
 
 
 
   
	| Code: | 
   
  
	
 
Set OutputRoot.XML.TestData.Value2 = CAST(X'BD' as CHAR ccsid 1208);
 
 
Set OutputRoot.XML.TestData.Value3 = CAST(X'0189' as CHAR ccsid 1208);
 
 | 
   
 
 
 
Right now this throws an exception.
 
 
Thanks. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Tibor | 
		  
		    
			  
				 Posted: Tue Nov 23, 2004 4:00 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 20 May 2001 Posts: 1033 Location: Hungary 
  | 
		  
		    
			  
				Look the Unicode Latin-1 codepage. Your character code is truly 00BD but this is not a UTF-8 code.
 
 
You have to convert this value to UTF-8 (e.g. with this UTF-8 Tool) and find your code is 0xC2BD!
 
 
Tibor | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |