| Author | 
		  Message
		 | 
		
		  | jamesyu | 
		  
		    
			  
				 Posted: Mon Jul 06, 2009 6:26 am    Post subject: How to handle PIC '9999' in message set? | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 31 Jan 2007 Posts: 70
  
  | 
		  
		    
			  
				Hi,
 
 
An IMS transaction written by PL/I sents me an EBCDIC message that contains a field called PRODUCT_COUNT with the value of "F0F0F0F1" (ascii: 0001, meaning only one product found). 
 
 
Here is the field defination:
 
PRODUCT_COUNT    PIC '9999',                           /* NUMBER OF PRODUCTS     */ 
 
 
I tried to define this field in my message set with CWF (too late to change it back to TDS) with the following:
 
 
Logical type = xsd:short
 
 
Physical type = External Decimal:
 
Length = 4 bytes
 
 
The rest of properties are default.
 
 
But when I turned on debugger, I saw a big interger number other than 1 which is i am expecting to see...
 
 
What am I missing here?
 
 
Thanks,
 
James | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | kimbert | 
		  
		    
			  
				 Posted: Mon Jul 06, 2009 6:30 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 29 Jul 2003 Posts: 5543 Location: Southampton 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Mon Jul 06, 2009 6:35 am    Post subject: Re: How to handle PIC '9999' in message set? | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| jamesyu wrote: | 
   
  
	I tried to define this field in my message set with CWF (too late to change it back to TDS) with the following:
 
 
Logical type = xsd:short
 
 
Physical type = External Decimal:
 
Length = 4 bytes
 
 | 
   
 
 
 
Not used PL/1 for 20 years, but isn't that picture a numeric character? Certainly 'F0F0F0F1' is '0001' is EBCDIC unless I'm much mistaken (and could be). So xsd:short is going to interpret it as a really big number surely? _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jamesyu | 
		  
		    
			  
				 Posted: Mon Jul 06, 2009 6:40 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 31 Jan 2007 Posts: 70
  
  | 
		  
		    
			  
				
   
	| kimbert wrote: | 
   
  
	| endianness? | 
   
 
 
 
Normal byte order, not reversed | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jamesyu | 
		  
		    
			  
				 Posted: Mon Jul 06, 2009 6:41 am    Post subject: Re: How to handle PIC '9999' in message set? | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 31 Jan 2007 Posts: 70
  
  | 
		  
		    
			  
				I tried a number of types with logical, physical etc...
 
 
Now I am tired and I just wanted to know how to configure this in MS?
 
 
Many many thanks! | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | jamesyu | 
		  
		    
			  
				 Posted: Mon Jul 06, 2009 6:43 am    Post subject: Re: How to handle PIC '9999' in message set? | 
				     | 
			   
			 
		   | 
		
		
		   Acolyte
 
 Joined: 31 Jan 2007 Posts: 70
  
  | 
		  
		    
			  
				| Oh, by the way, only if I cahnged to xsd:string, then it shows '0001' in memory tree which is what I want...  But I hate to alter the type to string every this kind of field. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Mon Jul 06, 2009 6:45 am    Post subject: Re: How to handle PIC '9999' in message set? | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| jamesyu wrote: | 
   
  
	| Now I am tired and I just wanted to know how to configure this in MS? | 
   
 
 
 
It's a hard life, and I recommend a caffinated beverage...
 
 
Well I've offered my guess; shame you've tried that & it didn't work!    _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | zpat | 
		  
		    
			  
				 Posted: Mon Jul 06, 2009 7:19 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Jedi Council
 
 Joined: 19 May 2001 Posts: 5867 Location: UK 
  | 
		  
		    
			  
				| I learnt PL/I many years ago. PIC '9999' is just character representation of a numeric value (with leading zeros included). | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | Vitor | 
		  
		    
			  
				 Posted: Mon Jul 06, 2009 8:40 am    Post subject: Re: How to handle PIC '9999' in message set? | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA 
  | 
		  
		    
			  
				
   
	| jamesyu wrote: | 
   
  
	| Oh, by the way, only if I cahnged to xsd:string, then it shows '0001' in memory tree which is what I want...  But I hate to alter the type to string every this kind of field. | 
   
 
 
 
Which is what I'd expect - PIC 9 represents numeric character. Like I said. _________________ Honesty is the best policy.
 
Insanity is the best defence. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | mqjeff | 
		  
		    
			  
				 Posted: Mon Jul 06, 2009 8:47 am    Post subject: Re: How to handle PIC '9999' in message set? | 
				     | 
			   
			 
		   | 
		
		
		   Grand Master
 
 Joined: 25 Jun 2008 Posts: 17447
  
  | 
		  
		    
			  
				
   
	| Vitor wrote: | 
   
  
	
   
	| jamesyu wrote: | 
   
  
	| Oh, by the way, only if I cahnged to xsd:string, then it shows '0001' in memory tree which is what I want...  But I hate to alter the type to string every this kind of field. | 
   
 
 
 
Which is what I'd expect - PIC 9 represents numeric character. Like I said. | 
   
 
 
 
You should be able to tell the model to read this value as a number and interpolate the characters into an integer.  This should be straight forward.
 
 
If you are getting a high value number when you expect a low value number, then you have the wrong endianness on the message definition element. | 
			   
			 
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |