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 » LENGTH FUNCTION

Post new topic  Reply to topic Goto page 1, 2  Next
 LENGTH FUNCTION « View previous topic :: View next topic » 
Author Message
goldym
PostPosted: Tue Feb 20, 2007 3:01 pm    Post subject: LENGTH FUNCTION Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

Does any one know how to calculate the entire length of your Data. I am trying to calculate the total length of the incoming file. I tried the following ESQL below but it returns null.

DECLARE LENG int;
SET LENG = LENGTH(InputRoot.MRM.Data);
Back to top
View user's profile Send private message
madi
PostPosted: Tue Feb 20, 2007 3:18 pm    Post subject: Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

do a asbitstream and cast the data into a string

then u can use LENGTH to find its length

may not be the best way to do it but will get the job done i think

--madi
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Feb 20, 2007 4:38 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Read the message as BLOB, ask for the length of InputRoot.BLOB.BLOB and then parse the message as MRM...
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
goldym
PostPosted: Thu Feb 22, 2007 6:37 am    Post subject: Reply with quote

Centurion

Joined: 24 Jun 2005
Posts: 116

[quote="jefflowrey"]Read the message as BLOB, ask for the length of InputRoot.BLOB.BLOB [i]and then[/i] parse the message as MRM...[/quote]


thanks this worked!
Back to top
View user's profile Send private message
ravi_sri24
PostPosted: Thu Mar 01, 2007 9:30 pm    Post subject: Reply with quote

Voyager

Joined: 11 May 2006
Posts: 83

goldym wrote:
jefflowrey wrote:
Read the message as BLOB, ask for the length of InputRoot.BLOB.BLOB and then parse the message as MRM...



thanks this worked!


Hi journeyman,

Am also looking for the same, please could you help me out in this, is message set is required, my input message is XML,

DECALRE MESSAGE BLOB;
DECLARE Length NUMBER;

MESSAGE = (InputRoot.BLOB.BLOB)
NUMBER = LENGHT(MESSAGE)

is the a bove code will work, what needs to be entered in the INPUT NODE of the message flow

Thanks in Advance.....
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Mar 02, 2007 1:06 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

The usual style is to set the 'Message Domain' property on the input node to 'BLOB', use a Compute node to extract the length, and then either
a) use an RCD node to switch to another domain or
b) use CREATE...PARSE to switch to another domain

Quote:
is message set is required, my input message is XML
If you need to validate your XML message against the schema you need the MRM domain, and so you will require a message set.
If you don't need validation, you can use the XMLNSC domain. In that case, you do not require a message set, but I still advise you to create one, because it makes writing your ESQL and mappings a lot easier.
Back to top
View user's profile Send private message
ravi_sri24
PostPosted: Fri Mar 02, 2007 2:38 am    Post subject: Reply with quote

Voyager

Joined: 11 May 2006
Posts: 83

kimbert wrote:
The usual style is to set the 'Message Domain' property on the input node to 'BLOB', use a Compute node to extract the length, and then either
a) use an RCD node to switch to another domain or
b) use CREATE...PARSE to switch to another domain

Quote:
is message set is required, my input message is XML
If you need to validate your XML message against the schema you need the MRM domain, and so you will require a message set.
If you don't need validation, you can use the XMLNSC domain. In that case, you do not require a message set, but I still advise you to create one, because it makes writing your ESQL and mappings a lot easier.




Hi,

Actually i want to insert the total message and message size in the table, i don't want to do anything with the message,

I have tried with the BLOB in the INPUT NODE of the message but it has failed

please suggest me, only i want insert the actual message and length of the message
Back to top
View user's profile Send private message
kimbert
PostPosted: Fri Mar 02, 2007 2:57 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Quote:
it has failed
How?
Back to top
View user's profile Send private message
ravi_sri24
PostPosted: Fri Mar 02, 2007 5:56 am    Post subject: Reply with quote

Voyager

Joined: 11 May 2006
Posts: 83

kimbert wrote:
Quote:
it has failed
How?


Hi,

If i use the BLOB Domain, then it's giving me the MQRFH2 header also, I required only Message then what should i do, here I don't require any parsing of the message just i want to insert the Message(which should not have any headers) and MessageLength in the DataBase

It's very urgent for me please some advise me
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Mar 02, 2007 5:58 am    Post subject: Reply with quote

Grand High Poobah

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

This is kinda functioning as designed - the RFH2 is carried as part of the message body, it's the MQMD that's a header.

You may need some minimal processing to strip off the RFH2 if you don't want it stored. Better minds than mine may be able to suggest a more cunning solution.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Paul D
PostPosted: Fri Mar 02, 2007 2:16 pm    Post subject: Reply with quote

Master

Joined: 16 May 2001
Posts: 200
Location: Green Bay Packer Country

That makes no sense to me. All headers including the RFH headers should be parsed out into the message tree regardless of if the BLOB domain was specified on the input node. I'd be questioning if the inbound message was set up correctly with that header. If you can't control that, you should still be able to salvage the message and strip off the RFH header.
_________________
Thanks!!!

Paul D
Back to top
View user's profile Send private message Visit poster's website
whocares61
PostPosted: Sun Mar 04, 2007 6:41 pm    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2006
Posts: 7
Location: New Zealand

Works for me like this:

Code:

DECLARE cursor REFERENCE TO Root.XMLNSC.Content;

SET rsd = FIELDVALUE(cursor);
IF (LENGTH(rsd) = 0)  THEN
  -- do stuff
END IF;




Back to top
View user's profile Send private message Visit poster's website
kimbert
PostPosted: Mon Mar 05, 2007 1:17 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

goldym wrote:
Quote:
I am trying to calculate the total length of the incoming file.

whocares61 : Your code does not do what goldym requires.
Back to top
View user's profile Send private message
madi
PostPosted: Mon Mar 05, 2007 9:15 am    Post subject: Reply with quote

Chevalier

Joined: 17 Jan 2006
Posts: 475

u can still use the asbitstream on the XMLNS and then find the length

--madi
Back to top
View user's profile Send private message
whocares61
PostPosted: Mon Mar 05, 2007 1:03 pm    Post subject: Reply with quote

Newbie

Joined: 06 Dec 2006
Posts: 7
Location: New Zealand

Quote:
Your code does not do what goldym requires.




Well I agree, but I thought it's easy to see how it could be applied, isn't it?

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

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » LENGTH FUNCTION
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.