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 » INTEGER elements length in CWF

Post new topic  Reply to topic
 INTEGER elements length in CWF « View previous topic :: View next topic » 
Author Message
Testo
PostPosted: Wed Jul 28, 2004 10:49 am    Post subject: INTEGER elements length in CWF Reply with quote

Centurion

Joined: 26 Feb 2003
Posts: 120
Location: Italy - Milan

I know I'm going to post a fancy question but I've tried to find the solution with the Search in this forum and through WMQI 2.1 manuals without success.

I have to define a CWF message set, I have some INTEGER elements that have a specific number of digits, let's say 5. If I choose INTEGER, I can specify the length only in terms of bytes and not in terms of digits. What should I do? Define them as DECIMAL with 0 decimals? Or should I define them as STRING and then eventually cast them as INTEGER when manipulating them with ESQL? In this last scenario, I would loose the ability of the parser to check if they are really numbers instead of generic strings...

Thanks in advance for any help,
Cheers
Andrea Tedone
IBM IT Specialist
Back to top
View user's profile Send private message Send e-mail MSN Messenger
jefflowrey
PostPosted: Wed Jul 28, 2004 11:06 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Add them as Integer types, with a sufficient byte size to cover the needed number of digits.

Then set a maximum value constraint.

So, if you had a three digit integer, if you set the maximum value constraint to 999, that should enforce the digit length.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kirani
PostPosted: Wed Jul 28, 2004 11:18 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Andrea,

What is your input data source? Is it C program (Integer data) or COBOL or something else? If you are using COBOL data type then you can define the field as Extended Decimal in Physical Type and set the length to 3 bytes.

I think the maximum value constraint are not enfored by the broker in WMQI 2.1, but I could be wrong. I remember reading something like this in manual.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Testo
PostPosted: Wed Jul 28, 2004 11:19 am    Post subject: WOW Reply with quote

Centurion

Joined: 26 Feb 2003
Posts: 120
Location: Italy - Milan

Great trick Jeff!

Maybe in future releases it will be possible to do the opposite? I.e. to define the number of digits and setting implicitly the max value possible and the number of bytes needed for that max limit?

In any case, THANK YOU for your suggestion, I have been struggling with this issue also in the past and I can't believe it was so easy!!!

Cheers,
Andrea
Back to top
View user's profile Send private message Send e-mail MSN Messenger
jefflowrey
PostPosted: Wed Jul 28, 2004 11:21 am    Post subject: Re: WOW Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Testo wrote:
Great trick Jeff!

Hope it works!
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Testo
PostPosted: Wed Jul 28, 2004 11:32 am    Post subject: Ups Reply with quote

Centurion

Joined: 26 Feb 2003
Posts: 120
Location: Italy - Milan

Kiran,

I read your message a bit late, just after posting my reply to Jeff.

Thinking at Jeff's trick, I think it does not solve completely my issue. I will use an example.

Let's say I have a 5 digits integer that MUST be a 5 digits element, eventually padded with '0' on the left (in fact it's a fixed length string for a COBOL com area).

If I define it as an Integer with 3 bytes and with the maximum value constraint set to 99999, what happens if I assign a number like '999' or '00999'? I don't think the former could be padded and I don't think the latter will keep the two '0' on the left....

What do you think?

I hope to be wrong but I'm not sure I can avoid the 'horrible' String simulation...

Cheers,
Andrea
Back to top
View user's profile Send private message Send e-mail MSN Messenger
EddieA
PostPosted: Wed Jul 28, 2004 11:47 am    Post subject: Reply with quote

Jedi

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

Andrea. I think you need to be a little more specific in what you mean by Integer, because that will define (internally) how the data is held in terms of bytes vs. digits.

As you mentioned COBOL, I'll dig into me memory banks and try and remember the right terminology.

Are you talking about a PIC 9 COMP value. In which case this is a binary value and will be a half-word, full-word or double-word depending on how many '9's you define.

Or, are you thinking of a PIC 9, or PIC S9, type field.

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
Testo
PostPosted: Wed Jul 28, 2004 12:07 pm    Post subject: COBOL is not my domain... Reply with quote

Centurion

Joined: 26 Feb 2003
Posts: 120
Location: Italy - Milan

Eddie,

I don't know. I mean, I will have to put in these 5-digits elements just NUMBERS, that are related to financial deals (like an account number or something like that).

So, if I have to create a 5-digits number padded with '0' on the left, I would expect to define an INTEGER (because 5 numbers are in any case an integer) so that the parser can validate it. But this does not seem to be an easy task...

I don't know how the COBOL program will treat then this number... but my requirement, from the broker perspective, it's clear: is it possible to define a fixed-length element, treated as an integer, padded with '0' on the left?

I will perform some tests tomorrow (in Italy it's 10 PM now and I don't have a WMQI box with me right now) and I'll come back to you with my results...

Cheers and thanks for your feedbacks,
Andrea
Back to top
View user's profile Send private message Send e-mail MSN Messenger
kirani
PostPosted: Wed Jul 28, 2004 1:17 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Andrea,

Depending on what your PIC clause is for that element you can set your Physical Format to any one of the following,
1. Extended Decimal for PIC 9. For example, PIC 999 or PIC 9(10).
2. Packed Decimal for COMP-3 data types. For example, PIC 9(3) COMP-3.
3. Integer for COMP,COMP-4, COMP-5 in COBOL. For example, PIC 9(4) COMP.

You can make use of Padding propert in MRM to pad your data with any char.

Is this the input or output data definition we are talking about?
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Testo
PostPosted: Wed Jul 28, 2004 11:24 pm    Post subject: OK.. Reply with quote

Centurion

Joined: 26 Feb 2003
Posts: 120
Location: Italy - Milan

It's a PIC 9, so it should be Extended Decimal, with padding set to '0' and 'right justify'.

Correct?

Cheers,
Andrea
Back to top
View user's profile Send private message Send e-mail MSN Messenger
kirani
PostPosted: Thu Jul 29, 2004 8:16 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

You got it!
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » INTEGER elements length in CWF
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.