| Author | 
		  Message
		 | 
		
		  | my_mqmb | 
		  
		    
			  
				 Posted: Tue May 08, 2012 5:01 am    Post subject: JAVA to ESQL | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 08 Jun 2011 Posts: 84
  
  | 
		  
		    
			  
				In JAVA::
 
 
encodeHex(byte[] data)
 
 
 
          Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order.
 
 
In ESQL ::
 
 
 
 ?? | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | lancelotlinc | 
		  
		    
			  
				 Posted: Tue May 08, 2012 5:05 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Tue May 08, 2012 5:06 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				| CAST AS  BLOB.  Do not specify a CCSID. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Tue May 08, 2012 5:08 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				
 
 
amazingly enough, all of those links answer a question different than the one that was asked. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | lancelotlinc | 
		  
		    
			  
				 Posted: Tue May 08, 2012 5:09 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA 
  | 
		  
		    
			  
				
   
	| mqjeff wrote: | 
   
  
	
 
 
amazingly enough, all of those links answer a question different than the one that was asked. | 
   
 
 
 
The point was to demonstrate a methodology, not necessarily give the answer. A combination of the information in the three links addresses some of the OP's question. _________________ http://leanpub.com/IIB_Tips_and_Tricks
 
Save $20: Coupon Code: MQSERIES_READER | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | my_mqmb | 
		  
		    
			  
				 Posted: Tue May 08, 2012 5:16 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 08 Jun 2011 Posts: 84
  
  | 
		  
		    
			  
				
   
	| mqjeff wrote: | 
   
  
	| CAST AS  BLOB.  Do not specify a CCSID. | 
   
 
 
 
 
 
thanks for reply , but this one says something different :
 
 
This cast can work in two ways:
 
If you specify either a CCSID or ENCODING clause, the whole string is written out in the code page or encoding that you requested. For example, the string "Cat" in CCSID 850 becomes the three-byte array in hexadecimal, 43,61,74. 
 
 
 
If you specify neither the CCSID nor ENCODING clause, the string must itself contain two-character hexadecimal digits of the form X'hhhhhh' or hhhhhh (where h can be any hexadecimal characters). In this case, the input string "436174" becomes the same three-byte binary array (43,61,74). 
 
 
 
i need "Cat" to be  43,61,74
 
 
for this the documentation says CCSID 850 must be provided.
 
 
 
Please explain .. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | my_mqmb | 
		  
		    
			  
				 Posted: Tue May 08, 2012 5:23 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 08 Jun 2011 Posts: 84
  
  | 
		  
		    
			  
				...l
  Last edited by my_mqmb on Tue May 08, 2012 5:49 am; edited 2 times in total | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | lancelotlinc | 
		  
		    
			  
				 Posted: Tue May 08, 2012 5:24 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Knight
 
 Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA 
  | 
		  
		    
			  
				
   
	| my_mqmb wrote: | 
   
  
	
   
	| lancelotlinc wrote: | 
   
  
	| Google is your friend. ... In class, you will learn many good things, grass hopper. | 
   
 
 
 
classes are too expensive 
 
 
 | 
   
 
 
 
You should take care of the burden you place on others that result from your lack of due diligence and foresight. _________________ http://leanpub.com/IIB_Tips_and_Tricks
 
Save $20: Coupon Code: MQSERIES_READER | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Tue May 08, 2012 5:35 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				| Sorry, I put it backwards.  You need to cast a BLOB into a CHAR, and not specify a ccsid. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | my_mqmb | 
		  
		    
			  
				 Posted: Tue May 08, 2012 6:03 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Voyager
 
 Joined: 08 Jun 2011 Posts: 84
  
  | 
		  
		    
			  
				
   
	| mqjeff wrote: | 
   
  
	| Sorry, I put it backwards.  You need to cast a BLOB into a CHAR, and not specify a ccsid. | 
   
 
 
 
is this enough ?
 
   
	| Code: | 
   
  
	
 
 
      SET VSDC_TRACK1  = ElcRef.ns28:Trk1 ;
 
      DECLARE Trk1Blob BLOB ASBITSTREAM(VSDC_TRACK1);
 
        SET VSDC_TRACK1  = CAST(Trk1Blob AS CHARACTER); | 
   
 
 | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |