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 » XML to CWF integer field sizes

Post new topic  Reply to topic
 XML to CWF integer field sizes « View previous topic :: View next topic » 
Author Message
bpugh
PostPosted: Fri Jun 25, 2004 10:25 am    Post subject: XML to CWF integer field sizes Reply with quote

Novice

Joined: 27 Apr 2004
Posts: 24
Location: St. Louis, MO

Is there an easy way to handle differences in the size of integer or decimal fields when moving from XML to COBOL copybook?

For example, when I define a field as "integer" in XML, it is valid to receive something like

<intgrFld>123456</intgrFld>

But what if the COBOL copybook I am moving that to defines the field as PIC 9(03)?

When I SET cobol_field = InputBody.intgrFld I get an error.

The only thing I can think of is to move the data to a string field and then use the SUBSTRING function. But I dread the thought of having to do that for every integer field in my copybook. Is there an easier way?
Back to top
View user's profile Send private message
EddieA
PostPosted: Fri Jun 25, 2004 11:03 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

In your example, you are taking a 6 digit field and moving it to a 3 digit result. Is that really what you want.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
bpugh
PostPosted: Fri Jun 25, 2004 11:17 am    Post subject: Reply with quote

Novice

Joined: 27 Apr 2004
Posts: 24
Location: St. Louis, MO

My database field in this example is defined as being a 3 digit number, so I can't give it a value of 123456. I would hope that someone sending me the XML wouldn't give me such a number, but you never know what people will do. I don't want the whole message flow to abend as it is doing now. I would rather let it update with "123" or "0" (or some other valid value) and let the user fix it after the update has taken place.
Back to top
View user's profile Send private message
kimbert
PostPosted: Mon Jun 28, 2004 12:50 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

It sounds as if you need some validation on your input message. You'll need to use MRM XML for parsing the input document.

Quote:
I would rather let it update with "123" or "0" (or some other valid value) and let the user fix it after the update has taken place

...but the user would need to be told, otherwise how would they know that the database had been incorrectly populated? If you use MRM XML with validation, you can set the validation action so that the message flow continues after a validation error, but a warning is written to the system event log.
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 » XML to CWF integer field sizes
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.