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 » Variable length fields

Post new topic  Reply to topic
 Variable length fields « View previous topic :: View next topic » 
Author Message
DELLIPIZ
PostPosted: Tue Oct 12, 2004 6:47 pm    Post subject: Variable length fields Reply with quote

Acolyte

Joined: 08 Oct 2003
Posts: 70

Hi,

When creating an MRM, how would you create a variable length field, using CWF?

I have a COBOL field that can be either 30 - 300 characters.

Thanks!

-Lori
Back to top
View user's profile Send private message
siliconfish
PostPosted: Tue Oct 12, 2004 7:02 pm    Post subject: Reply with quote

Master

Joined: 12 Aug 2002
Posts: 203
Location: USA

You can set the "Length Units" in the CWF tab to "End of Bitstream"

Quote:
End of Bitstream. All data to the end of the bitstream is processed. (Valid only if this element is the last in the message. If you select this value, you do not need to enter a value for the properties Length Count or Length Value Of.)

_________________
siliconfish
Back to top
View user's profile Send private message
DELLIPIZ
PostPosted: Tue Oct 12, 2004 7:11 pm    Post subject: Reply with quote

Acolyte

Joined: 08 Oct 2003
Posts: 70

Hi again,

Well, my input is in XML and my output structure needs to look like this in PL1:

FIELD1 CHAR(250) VAR;
FIELD2 CHAR(3000) VAR;
FIELD3 CHAR(1);

Can I still use the 'End of Bitstream' when it is not the last field in the structure?

Thanks!

-Lori
Back to top
View user's profile Send private message
JT
PostPosted: Tue Oct 12, 2004 7:53 pm    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Define the field(s) as variable length using the min & max value constraints rather than setting a definitive length.
Back to top
View user's profile Send private message
JLRowe
PostPosted: Wed Oct 13, 2004 1:15 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

In CWF you need a length count element for each variable length field, this is the only way of doing it (except for the last element which can run to the end of bitstream).
Back to top
View user's profile Send private message Send e-mail
EddieA
PostPosted: Wed Oct 13, 2004 8:41 am    Post subject: Reply with quote

Jedi

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

Quote:
I have a COBOL field that can be either 30 - 300 characters.

Then, if I remember my COBOL correctly (from far too many years ago), you must also have a field that contains the length of that field. I don't think COBOL supports any "other" type of variable length, like "null terminated".

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
kirani
PostPosted: Wed Oct 13, 2004 8:49 am    Post subject: Reply with quote

Jedi Knight

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

JT wrote:
Define the field(s) as variable length using the min & max value constraints rather than setting a definitive length.

This will not work for CWF.
_________________
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
kimbert
PostPosted: Wed Oct 13, 2004 4:35 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Looks like the last field is only one character, so why not omit it from your message definition. Then you can use ASBITSTREAM to serialize the message into a string, and just stick the final character on the end.
(I have not tried this, but I think it should work)
Back to top
View user's profile Send private message
shanson
PostPosted: Thu Nov 04, 2004 1:47 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

A PL/I CHAR VAR is a string preceded by (I think) a 2 byte length. That's what the CWF string physical type 'Encoded String 2' is designed to handle. All you have to do is use that.
Back to top
View user's profile Send private message
DELLIPIZ
PostPosted: Fri Nov 12, 2004 5:27 am    Post subject: Reply with quote

Acolyte

Joined: 08 Oct 2003
Posts: 70

Hi,

I was looking at the above advice:

A PL/I CHAR VAR is a string preceded by (I think) a 2 byte length. That's what the CWF string physical type 'Encoded String 2' is designed to handle. All you have to do is use that.

--------------------------------

Please forgive my cluelessness... can you show me what my CWF tab for Field2 should look like.

FIELD2 CHAR(3000) VAR;

Thanks!

-Lori
Back to top
View user's profile Send private message
shanson
PostPosted: Mon Nov 15, 2004 4:31 am    Post subject: Reply with quote

Partisan

Joined: 17 Oct 2003
Posts: 344
Location: IBM Hursley

Physical Type = Length Encoded String 2
Length Count = <greyed out>

The data is preceded by 2 bytes that give the length of the data. Hence Length Count has no meaning. If you wish to validate that the length of the data is not greater than 3000 then you should add a maxLength facet to the simple type.
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 » Variable length fields
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.