ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » PIC -9(11).99. COBOL COPY FIELD gets created as string type

Post new topic  Reply to topic
 PIC -9(11).99. COBOL COPY FIELD gets created as string type « View previous topic :: View next topic » 
Author Message
CuriCAT
PostPosted: Wed May 20, 2009 6:49 pm    Post subject: PIC -9(11).99. COBOL COPY FIELD gets created as string type Reply with quote

Voyager

Joined: 26 Sep 2006
Posts: 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
View user's profile Send private message Send e-mail Yahoo Messenger
Vitor
PostPosted: Wed May 20, 2009 11:58 pm    Post subject: Re: PIC -9(11).99. COBOL COPY FIELD gets created as string Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 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
View user's profile Send private message
mqjeff
PostPosted: Thu May 21, 2009 5:19 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 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
View user's profile Send private message
Vitor
PostPosted: Thu May 21, 2009 5:23 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 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
View user's profile Send private message
mqjeff
PostPosted: Thu May 21, 2009 5:29 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 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?

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
Is it? It's been a while for me too, but I thought a 9 always meant "this is a number"?
Back to top
View user's profile Send private message
harish_td
PostPosted: Thu May 21, 2009 5:32 am    Post subject: Reply with quote

Master

Joined: 13 Feb 2006
Posts: 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
View user's profile Send private message Yahoo Messenger
Vitor
PostPosted: Thu May 21, 2009 5:38 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 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:
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
Is it? It's been a while for me too, but I thought a 9 always meant "this is a number"?


It does, but without additional qualification it means a numeric character.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu May 21, 2009 9:31 am    Post subject: Re: PIC -9(11).99. COBOL COPY FIELD gets created as string Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » PIC -9(11).99. COBOL COPY FIELD gets created as string type
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.