| Author | 
		  Message
		 | 
		
		  | rahulk01 | 
		  
		    
			  
				 Posted: Tue May 12, 2020 5:46 am    Post subject: Setting a Hex value in esql | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 26 Dec 2019 Posts: 35
  
  | 
		  
		    
			  
				Hi,
 
I have a requirement where I need to create a header and a trailer record for a mainframe application.
 
The header record starts with Hex(00) and trailer starts with hex(FF).
 
I tried the below code:
 
SET rHead.StartField = CAST(x'00' AS CHAR CCSID OutputRoot.Properties.CodedCharSetId);
 
And
 
SET rTrail.StartField = CAST(x'FF' AS CHAR CCSID OutputRoot.Properties.CodedCharSetId);
 
OutputRoot.Properties.CodedCharSetId is coming out to be 1208.
 
The output is being validated using a DFDL parser where this field is defined as a String with length 1 and length units as bytes.
 
The first statement is working fine, but while setting x'FF' it throws an error as below:
 
ImbConverterCPP::internalToUnicode
 
BIPmsgs 3 2135
 
Unconvertable character
 
Type 5
 
Text FF
 
Type 2
 
Text 1208
 
 
Please help. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Tue May 12, 2020 6:13 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 Location: LI,NY 
  | 
		  
		    
			  
				That's to be expected: FF as a hex value is not associated with any character in CCSID 1208.   _________________ MQ & Broker admin | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | rahulk01 | 
		  
		    
			  
				 Posted: Tue May 12, 2020 6:25 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 26 Dec 2019 Posts: 35
  
  | 
		  
		    
			  
				| so what could be a possible solution to it? Mainframe app still wants x'FF' as the first character in the trailer record | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | timber | 
		  
		    
			  
				 Posted: Tue May 12, 2020 6:37 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 25 Aug 2015 Posts: 1292
  
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | rahulk01 | 
		  
		    
			  
				 Posted: Tue May 12, 2020 6:47 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Apprentice
 
 Joined: 26 Dec 2019 Posts: 35
  
  | 
		  
		    
			  
				Thanks for the link, I am reading it now. I am a bit newbie in this area though.
 
Other IIB integration with Cobol app uses 1208 CCSID, so I thought of using the same.
 
Other interfaces don't need to use x'FF' so they work fine, my interface needs it so failed. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | timber | 
		  
		    
			  
				 Posted: Tue May 12, 2020 10:23 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand Master
 
 Joined: 25 Aug 2015 Posts: 1292
  
  | 
		  
		    
			  
				
   
	| Quote: | 
   
  
	Other IIB integration with Cobol app uses 1208 CCSID, so I thought of using the same.
 
Other interfaces don't need to use x'FF' so they work fine | 
   
 
You just got lucky. You should always pay attention to the CCSID when working with character data. You have just found out why  
 
   
	| Quote: | 
   
  
	| my interface needs it so failed | 
   
 
Technically, the other interfaces need it too. They just haven't failed yet. If you work in this business you need to be just a little bit paraniod! | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |