See information about the latest product version
Manipulating messages in the BLOB domain
How to deal with messages that belong to the BLOB domain, and that are parsed by the BLOB parser.
You cannot manipulate the contents of a BLOB message, because it has no predefined structure. However, you can refer to its contents using its known position within the bit stream, and process the message with a minimum of knowledge about its contents.
The BLOB message body parser does not create a tree structure in the same way that other message body parsers do. It has a root element BLOB, that has a child element, also called BLOB, that contains the data.
You can refer to message content using substrings if you know the location of a particular piece of information within the BLOB data. For example, the following expression identifies the tenth byte of the message body:
InputBody.BLOB.BLOB[10]
The following expression references 10 bytes of the message data starting at offset 10:
SUBSTRING(InputBody.BLOB.BLOB from 10 for 10)
You can use the Mapping node to map to and from a predefined BLOB message, and to map to and from items of BLOB data.
Simple example to write a string in the output message
CALL CopyMessageHeaders();
-- CALL CopyEntireMessage();
DECLARE mystring CHARACTER;
SET mystring='hello';
SET OutputRoot.BLOB.BLOB=CAST (mystring AS BLOB CCSID 1208);