Author |
Message
|
cvag |
Posted: Wed Jun 03, 2009 3:30 am Post subject: capture the size of the Input message in bytes ? |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
Hiii,
Is there any way how can I capture the Message size in bytes ?
I tried as ...CAST(ASBITSTREAM(InputBody ----) AS BLOB and finding length of that blob....but it did not give me the xact size..It gave me more length than that of original size...
Any Ideas  |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 03, 2009 3:33 am Post subject: Re: capture the size of the Input message in bytes ? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
cvag wrote: |
Is there any way how can I capture the Message size in bytes ? |
Why would you need to? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
cvag |
Posted: Wed Jun 03, 2009 3:37 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
We are doing a POC....and there is a client requirement.... |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 03, 2009 3:43 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
cvag wrote: |
there is a client requirement.... |
Yes, I apologise for my earlier brevity - some guy turned up and expected me to do some actual work! I mean, just because I sit here and they pay me they seem to think they can interupt my posting....
What I was getting at was exactly that - what's the requirement? Why does your client need to know how long the message is in bytes? What value does it give them, or do they mistakenly think it gives them? What purpose does this information serve?
With these answers we may be able to suggest a better method.
If it's a requirement along the lines of "we need to know the length in bytes because we need to know it and we're the client and we're always right so there!!!" or "we need to know it because it's part of the checksum process we use to verify the tape's been written correctly and we know we've not used tape since we put the network in back in 1980 but we've never got round to changing the application", then it's trout time.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
cvag |
Posted: Wed Jun 03, 2009 3:46 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 03, 2009 3:50 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
You laugh (and rightly), but I've had both those reasons quoted at me. The "so there" was implied in the first example rather than stated, but during the free & frank exchange of views that followed, I was reminded that I was being paid to meet the customer's requirement and therefore I should just do as I was told.
That conversation did not end well. For the other guy.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
AkankshA |
Posted: Wed Jun 03, 2009 3:56 am Post subject: Re: capture the size of the Input message in bytes ? |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
cvag wrote: |
Hiii,
Is there any way how can I capture the Message size in bytes ?
I tried as ...CAST(ASBITSTREAM(InputBody ----) AS BLOB and finding length of that blob....but it did not give me the xact size..It gave me more length than that of original size...
Any Ideas  |
you need to convert the blob back to character and then count length...
make sure your msg is not XML .. else tags will also get counted _________________ Cheers |
|
Back to top |
|
 |
cvag |
Posted: Wed Jun 03, 2009 3:59 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
ohooooooooo my message indeed was XML ....  |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 03, 2009 4:00 am Post subject: Re: capture the size of the Input message in bytes ? |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
AkankshA wrote: |
make sure your msg is not XML .. else tags will also get counted |
Hence my question about requirement - "message length" has a number of possible meanings here. Do they mean total size on the wire, total size of message excluding headers (MQMD & RFH2 if present), total size of business payload, etc, etc.
Without knowing what the client is using the information for, any method could produce a misleading number. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
AkankshA |
Posted: Wed Jun 03, 2009 4:08 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
cvag wrote: |
ohooooooooo my message indeed was XML ....  |
so do you actually want the length of message or the data only ?
and how about MQRFH2 ??? is that present ?? _________________ Cheers |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 03, 2009 4:09 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
AkankshA wrote: |
cvag wrote: |
ohooooooooo my message indeed was XML ....  |
so do you actually want the length of message or the data only ?
and how about MQRFH2 ??? is that present ?? |
I think I've already asked that. Possibly implicitly.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
cvag |
Posted: Wed Jun 03, 2009 4:17 am Post subject: |
|
|
Centurion
Joined: 17 Mar 2008 Posts: 127
|
The Length of the Message....I dont have MQRFH2 |
|
Back to top |
|
 |
AkankshA |
Posted: Wed Jun 03, 2009 4:18 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
Quote: |
I think I've already asked that. Possibly implicitly |
yes you did.... as always hit the nail at first
well, i just missed your
Quote: |
Hence my question about requirement - "message length" has a number of possible meanings here. Do they mean total size on the wire, total size of message excluding headers (MQMD & RFH2 if present), total size of business payload, etc, etc.
Without knowing what the client is using the information for, any method could produce a misleading number. |
post... like like you, even my employer and his ppl comes and disturb in my posts a lot.... especially when i start drafting a reply...
 _________________ Cheers |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 03, 2009 4:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
cvag wrote: |
The Length of the Message....I dont have MQRFH2 |
But apparently without the tags?
Again I ask what for? What use is the length of the payload of an XML document? Or the length of an XML document come to that?
More information, better advice.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
AkankshA |
Posted: Wed Jun 03, 2009 4:21 am Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
cvag wrote: |
The Length of the Message....I dont have MQRFH2 |
cool
so ASBITSTREAM and then CHARACTER conversion with LENGTH shall do the trick but keep in minds that xml < > signs get counted as a byte and not &ls..... (something something) (which ll increase the count to 5 i guess) _________________ Cheers |
|
Back to top |
|
 |
|