Author |
Message
|
fitzcaraldo |
Posted: Sun Dec 14, 2003 10:20 pm Post subject: Copying headers when there is no body. |
|
|
Voyager
Joined: 05 May 2003 Posts: 98
|
Hello,
We have a situation where empty messages can occur on our network. These can be empty in the sense that they have an MQMD but no body or an MQMD & RFH2 but no (further) body.
This is a problem for us because code is already in place that uses the "Copy Headers Only" snippet (which ignores the last header) or uses references to InputRoot.Body (which actually returns the MQMD or RFH2).
We have a custom input subflow that wraps MQInput. Can anyone suggest a way that we could explicitly set an empty (as opposed to NULL) body in ESQL when none was supplied.
How have some of you handled this? |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Dec 15, 2003 5:35 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Something like
Code: |
set OutputRoot.BLOB.BLOB = CAST(' ' as BLOB); |
(with spaces in the quotes)? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wmqiguy |
Posted: Mon Dec 15, 2003 7:39 am Post subject: |
|
|
 Centurion
Joined: 09 Oct 2002 Posts: 145 Location: Florida
|
Jeff:
It sounds like there may or may not be a payload, so you would need to add some evaluation around that or you would delete any true messages that had a payload.
Shooting from the hip here in pseudocode (time is precious):
IF OutputRoot.BLOB.BLOB = NULL or OutputRoot.BLOB.BLOB = ''
THEN
SET OutputRoot.BLOB.BLOB = CAST(' ' AS BLOB);
END IF
Haven't actually tried this, but worth a shot.  |
|
Back to top |
|
 |
fitzcaraldo |
Posted: Mon Dec 15, 2003 2:02 pm Post subject: |
|
|
Voyager
Joined: 05 May 2003 Posts: 98
|
But it's more complicated than that. Can't necessarily assume the payload is a BLOB - it may be MRM, XML or BLOB... |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Dec 15, 2003 2:57 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
fitzcaraldo wrote: |
But it's more complicated than that. Can't necessarily assume the payload is a BLOB - it may be MRM, XML or BLOB... |
You might be able to check the FIELDNAME of the OutputRoot.[LAST] (which is equivalent to OutputBody) to see if it's one of several values. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|