Author |
Message
|
know_ashu |
Posted: Mon Oct 17, 2005 11:47 pm Post subject: problem while using message set - URGENT |
|
|
Novice
Joined: 25 Jun 2005 Posts: 22
|
Hi,
I am trying to use a message set with my message flow (WMQI2.1 on windows), following are the details:-
incoming message: GREG
expected output message: GREG JOHNS 123456
message set used has the following elements with max field length.
ELEMENT NAME FIELD LENGTH
EMP_NAME 10
EMP_NO 6
below is the ESQL:
SET OutputRoot.Properties = InputRoot.Properties;
SET OutputRoot.Properties.MessageDomain='MRM';
SET OutputRoot.Properties.MessageSet = 'DV61DBO0FA001';
SET OutputRoot.Properties.MessageType = 'MY_MSG_TYPE';
SET OutputRoot.Properties.MessageFormat = 'CWF';
SET OutputRoot.MRM.EMP_NAME = InputRoot.MRM.EMP_NAME || ' JOHNS';
SET OutputRoot.MRM.EMP_NO = InputRoot.MRM.EMP_NO;
When I am trying to test it, I am getting the following error:
-----------------------------------------------------------------------
Read of a text element failed. Message is too short.
Message data : '0x61736875'
Text element offset : 0
Expected length of element : 10
The reading of a text element of a message failed because the message was too short to contain the expected length of text.
Check that the message model is correct. Review previous messages for details of the message set and message type.
Check that the processed message is of the expected format and type.
----------------------------------------------------------------------- |
|
Back to top |
|
 |
kimbert |
Posted: Tue Oct 18, 2005 1:39 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
It looks as if your message definition is 10+6 = 16 characters long, but your input message is only 4 characters long. So 'Message is too short' seems like a fairly clear error message!
If you want to parse a short message and output a longer one, you need two message definitions. |
|
Back to top |
|
 |
know_ashu |
Posted: Tue Oct 18, 2005 5:21 am Post subject: |
|
|
Novice
Joined: 25 Jun 2005 Posts: 22
|
message is short...thats right...actually my requirement is like:-
lengths defined are only maximum lengths .. so If any element is shorter in length or blank it should not throw an error. |
|
Back to top |
|
 |
kimbert |
Posted: Tue Oct 18, 2005 5:42 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
If any element is shorter in length or blank it should not throw an error. |
That may well be your requirement, but that's not the way the CWF format is supposed to work. CWF uses fixed-length fields or null-terminated strings.
You can achieve your objective by defining two messages - one for the input and one for the output. |
|
Back to top |
|
 |
know_ashu |
Posted: Tue Oct 18, 2005 10:39 pm Post subject: |
|
|
Novice
Joined: 25 Jun 2005 Posts: 22
|
I did it with two message sets...message flow works now...still have the following questions:-
1. for a field e.g. EMP_NAME (max length 10) , if emp_name is 'ASHU' then its putting the following message in output queue:-
'ASHU......' (ASHU with 6 dots when i retrieve the output message using RFHUTILC )
'ASHU ' (ASHU with 6 boxes that could not be copied .. when I use MQ JMS Client to put input and get output message)
2. If for input EMP_NAME (max length 10) :- I just give 'ASHU', i expect that it should accept it and add 6 blank spaces automatically......please let me know if it doesnt work this way?? and the solution...
Thanks for your timely responses. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Oct 19, 2005 3:32 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What part of "fixed length" do you not understand?
How do you expect the parser to know that "AAAAABBBBB" should be treated as one field that is ten characters long or two fields that have a max length of ten, but only supplied five characters?
Have you considered getting some training on this product? Message Modeling in particular is not easy to pick up on your own.
And we're not here to train you on it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
know_ashu |
Posted: Wed Oct 19, 2005 7:13 am Post subject: |
|
|
Novice
Joined: 25 Jun 2005 Posts: 22
|
sorry for bothering u for this...it had the following solution :-
Just to change 'padding Character' to 'Space' instead of 'NUL' in element property of msg set.
Anyway, nice and thanks for your help. |
|
Back to top |
|
 |
schofier |
Posted: Wed Oct 19, 2005 7:40 am Post subject: |
|
|
Novice
Joined: 10 Dec 2003 Posts: 14 Location: IBM Hursley
|
That may well help you on output, but its not going to help you on input (parsing) unless your input message also contains the appropriate number of padding characters. |
|
Back to top |
|
 |
|