| Author | Message | 
		
		  | CuriCAT | 
			  
				|  Posted: Wed May 20, 2009 6:49 pm    Post subject: PIC -9(11).99.  COBOL COPY FIELD gets created as string type |   |  | 
		
		  |  Voyager
 
 
 Joined: 26 Sep 2006Posts: 82
 
 
 | 
			  
				| We are importing COBOL copy book to generate message definition in fixed length MRM domain. While doing that we face an issue for following Cobol copy book field. 
 15 DISCOUNT-RATE PIC -9(11).99.
 
 This field supposed to get converted to 11 digit and 2 decimal point. Instead message filed gets created with 14 character length string.
 
 Can some body help me please!
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Wed May 20, 2009 11:58 pm    Post subject: Re: PIC -9(11).99.  COBOL COPY FIELD gets created as string |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| CuriCAT wrote: |  
	| This field supposed to get converted to 11 digit and 2 decimal point. Instead message filed gets created with 14 character length string. |  
 That is the definition of a 14 character string. A 14 character string that has 11 numeric characters, a dot and 2 more numerics. If what you mean is you want to assign (for example) a decimal to that field in the message set and have it come out in that specific format, you'll need to specifically format it.
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mqjeff | 
			  
				|  Posted: Thu May 21, 2009 5:19 am    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 25 Jun 2008Posts: 17447
 
 
 | 
			  
				| What is the type of the element in the message definition?  Is it an xsd:decimal? or an xsd:string?  What are the properties of the element in the message definition? 
 That's actually a 15 character string, Vitor.  there's a sign char at the front of it.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Thu May 21, 2009 5:23 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| mqjeff wrote: |  
	| That's actually a 15 character string, Vitor.  there's a sign char at the front of it. |  
 Really? I thought you only got the sign if it was negative with that picture. Been a while though.
 
 I took the poster's problem to be that they want the field represented as a decimal, but are getting a string (of whatever length). My point was that picture describes a character formatted string rather than an xsd:decimal
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mqjeff | 
			  
				|  Posted: Thu May 21, 2009 5:29 am    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 25 Jun 2008Posts: 17447
 
 
 | 
			  
				| 
   
	| Vitor wrote: |  
	| 
   
	| mqjeff wrote: |  
	| That's actually a 15 character string, Vitor.  there's a sign char at the front of it. |  
 Really? I thought you only got the sign if it was negative with that picture. Been a while though.
 |  Yeah, and if it's not negative, what's there?
 
 
 
  Is it?  It's been a while for me too, but I thought a 9 always meant "this is a number"? 
	| Vitor wrote: |  
	| I took the poster's problem to be that they want the field represented as a decimal, but are getting a string (of whatever length). My point was that picture describes a character formatted string rather than an xsd:decimal |  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | harish_td | 
			  
				|  Posted: Thu May 21, 2009 5:32 am    Post subject: |   |  | 
		
		  | Master
 
 
 Joined: 13 Feb 2006Posts: 236
 
 
 | 
			  
				| We have seen this before. Although this definition is perfectly legal for the mainframe folks, the copybook importer within the toolkit creates this field as string.
 Workaround: Slightly modify your definition in the copybook to
 
 
   
	| Code: |  
	| 15 DISCOUNT-RATE PIC S9(11)V99 |  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Thu May 21, 2009 5:38 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| mqjeff wrote: |  
	| 
   
	| Vitor wrote: |  
	| 
   
	| mqjeff wrote: |  
	| That's actually a 15 character string, Vitor.  there's a sign char at the front of it. |  
 Really? I thought you only got the sign if it was negative with that picture. Been a while though.
 |  Yeah, and if it's not negative, what's there?
 |  
 Nothing.
 
 
 
   
	| mqjeff wrote: |  
	| 
  Is it?  It's been a while for me too, but I thought a 9 always meant "this is a number"? 
	| Vitor wrote: |  
	| I took the poster's problem to be that they want the field represented as a decimal, but are getting a string (of whatever length). My point was that picture describes a character formatted string rather than an xsd:decimal |  |  
 It does, but without additional qualification it means a numeric character.
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | Vitor | 
			  
				|  Posted: Thu May 21, 2009 9:31 am    Post subject: Re: PIC -9(11).99.  COBOL COPY FIELD gets created as string |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 11 Nov 2005Posts: 26093
 Location: Texas, USA
 
 | 
			  
				| 
   
	| CuriCAT wrote: |  
	| 15 DISCOUNT-RATE PIC -9(11).99.
 
 This field supposed to get converted to 11 digit and 2 decimal point. Instead message filed gets created with 14 character length string.
 
 |  
 According to this, the cause of your woes is the editing characters (the - and the .) which are causing the importer to give you an xsd:string rather than the xsd:decimal you were probably expecting.
 _________________
 Honesty is the best policy.
 Insanity is the best defence.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |