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 » General IBM MQ Support » how to compute LL in MQ and IMS?

Post new topic  Reply to topic
 how to compute LL in MQ and IMS? « View previous topic :: View next topic » 
Author Message
lianxiang
PostPosted: Thu May 15, 2008 6:05 pm    Post subject: how to compute LL in MQ and IMS? Reply with quote

Newbie

Joined: 15 May 2008
Posts: 4

I've seen many examples about LL,ZZ in MQ and IMS.

1) short LL = (short)(data.length() + 4);
short ZZ =0;

msg.writeShort(LL);
msg.writeShort(ZZ);
msg.writeString(data);

2) while (currOffset < maxOffset) {
ll = fromims.readShort();
zz = fromims.readShort();
rcvstring = fromims.readString(ll-4);
inOut.getOutputVector().addElement(rcvstring);

I find ll is always in connection with number "4".

who can tell me where "4" comes from!
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri May 16, 2008 12:26 am    Post subject: Re: how to compute LL in MQ and IMS? Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

lianxiang wrote:
who can tell me where "4" comes from!


It's a magic number, like 2, 8 , 16 & 1024.

It's the size of something.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
lianxiang
PostPosted: Fri May 16, 2008 1:54 am    Post subject: Re: how to compute LL in MQ and IMS? Reply with quote

Newbie

Joined: 15 May 2008
Posts: 4

Vitor wrote:
lianxiang wrote:
who can tell me where "4" comes from!


It's a magic number, like 2, 8 , 16 & 1024.

It's the size of something.



what is exactly "something" you mentioned?

what should I set it as?

2 ?8 ? or 1024 ?

thanks for your reply.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri May 16, 2008 2:22 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

It's the size of a double word. Depending on platform it may or may not be the size of a long integer. Or a short integer. Or an integer.

You often use the construction you quote to align structures on "magic" memory boundaries. Not so common in these Java days I believe.


It was all different in my day....


_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
lianxiang
PostPosted: Fri May 16, 2008 2:38 am    Post subject: Reply with quote

Newbie

Joined: 15 May 2008
Posts: 4

Vitor wrote:
It's the size of a double word. Depending on platform it may or may not be the size of a long integer. Or a short integer. Or an integer.

You often use the construction you quote to align structures on "magic" memory boundaries. Not so common in these Java days I believe.


It was all different in my day....




thanks, Vitor.
you mean this magic number is not fixing.
So how I figure out its value in my computer? (I thought I need this magic number)


On the other hand, I need to set the length of LL.
what value I shoud set??Could you offer a method for me ?

I am so appreciated!
Back to top
View user's profile Send private message
Bill.Matthews
PostPosted: Fri May 16, 2008 5:51 am    Post subject: Reply with quote

Master

Joined: 23 Sep 2003
Posts: 232
Location: IBM (Retired)

Check the provided samples as well as the help documentation. There may still be some sample ESQL that shows the process. If you don't see them in V6, see if you can find the V5 docs and look there.

I also found a recent article on the IBM Developer works:

http://www.ibm.com/developerworks/websphere/library/techarticles/0709_suarez/0709_suarez.html

In this article, in addition to the LLZZ being added, two additional dynamic parts are added. Thus, the ESQL code is adding several numbers.

The use of the "LLZZ" - is an IMS requirement, and has been there for a very long time. The LL is a binary value that represents the length of the message being given to IMS - PLUS - the 4 bytes of the LLZZ. The ZZ part of this 4 bytes is normally binary zero.

When the message is always a fixed size - one could simply add the proper values. However, when the size of the outbound message can vary in size, then this can be done in a Compute node located just before the MQOutput node.

This is the example that you want to look for.
_________________
Bill Matthews
Back to top
View user's profile Send private message
lianxiang
PostPosted: Fri May 16, 2008 6:25 pm    Post subject: Reply with quote

Newbie

Joined: 15 May 2008
Posts: 4

Bill.Matthews wrote:
Check the provided samples as well as the help documentation. There may still be some sample ESQL that shows the process. If you don't see them in V6, see if you can find the V5 docs and look there.

I also found a recent article on the IBM Developer works:

http://www.ibm.com/developerworks/websphere/library/techarticles/0709_suarez/0709_suarez.html

In this article, in addition to the LLZZ being added, two additional dynamic parts are added. Thus, the ESQL code is adding several numbers.

The use of the "LLZZ" - is an IMS requirement, and has been there for a very long time. The LL is a binary value that represents the length of the message being given to IMS - PLUS - the 4 bytes of the LLZZ. The ZZ part of this 4 bytes is normally binary zero.

When the message is always a fixed size - one could simply add the proper values. However, when the size of the outbound message can vary in size, then this can be done in a Compute node located just before the MQOutput node.

This is the example that you want to look for.


thank you for your reply.

But I have some questions.(I am not a COBOL developer,so ...... )

1. you mentioned "The LL is a binary value that represents the length of the message being given to IMS - PLUS - the 4 bytes of the LLZZ. "

"the 4 bytes of the LLZZ" I do not understand. the segment length of LLZZ is the 4 bytes??? "LL" is in connection with "LLZZ" ?


2. you mentioned "When the message is always a fixed size", when the size of the outbound message can vary in size ".

would you tell me why some massages are fixed,some others are vary ?
in other words what kind of messages are fixed , what kind of them are vary ?

3.At last , the meaning of "outbound message", "Compute node" ,"located just before the MQOutput node" I do not see. .
would you explain it in daitail ?

Thank you for taking time to help me. Thanks a lot ~~
Back to top
View user's profile Send private message
Bill.Matthews
PostPosted: Mon May 19, 2008 11:50 am    Post subject: Reply with quote

Master

Joined: 23 Sep 2003
Posts: 232
Location: IBM (Retired)

lianxiang wrote:

thank you for your reply.

But I have some questions.(I am not a COBOL developer,so ...... )

1. you mentioned "The LL is a binary value that represents the length of the message being given to IMS - PLUS - the 4 bytes of the LLZZ. "

"the 4 bytes of the LLZZ" I do not understand. the segment length of LLZZ is the 4 bytes??? "LL" is in connection with "LLZZ" ?


2. you mentioned "When the message is always a fixed size", when the size of the outbound message can vary in size ".

would you tell me why some massages are fixed,some others are vary ?
in other words what kind of messages are fixed , what kind of them are vary ?

3.At last , the meaning of "outbound message", "Compute node" ,"located just before the MQOutput node" I do not see. .
would you explain it in daitail ?


Let me give you an example:

Assume that the payload of the message, including all of the IMS required fields - except for the LLZZ - and the COBOL fixed fields is 2496 bytes. Of course, this is an arbitary number.

Lets also assume that the final field - lets call it MY-VAR, in the COBOL structure is one that has an OCCURS 0 to 10 DEPENDING ON SOME-FIELD-NAME attribute.

If the SOME-FIELD-NAME field, which is an Integer, has a value of 0, then the true length of the payload - after it has been parsed into its final output - is still 2496.

However, if the SOME-NAME-FIELD has a value of 6 and the size of the MY-VAR field is 12, then the final size is 2496 + (6 x 12) - or 2568.

So, the approach to calculating the LLZZ information is to parse the final message into a bitstream so that it becomes a BLOB. Then the LENGTH function is used to determine the length of the blob. A value of 4 is added to the length (to account for the LLZZ). This integer is casted to a blob and then it (the blob) plus a value of binary zero plus the bitstreamed playload are concatenated together. This represents the physical message to be sent to IMS.

On the assumption that one might have more than one message to deal with - it makes sense, for reuse purpose - to do this in a Compute node that is placed just before the MQOutput node that sends the message to IMS.


I would next suggest that you get together with one of the IMS programmers who understands how information to sent to the IMS Bridge via MQ to get more information and guidance on what your IMS system will require. IMS systems tends to have a lot of security requirements, and there are additional items that you will be required to build - such as the MQIMS header -.

Also spend some time with the IMS Application owner so that you can understand the COBOL part of the message.
_________________
Bill Matthews
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 » General IBM MQ Support » how to compute LL in MQ and IMS?
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.