Manipulating messages in the BLOB domain

This topic provides information specific to dealing 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)
Start of change

Simple example to write a string in the output message

The following simple example allows you to write some character data in your ESQL (for example, if you have read some character fields from a database) out as a BLOB:
CALL CopyMessageHeaders();
	-- CALL CopyEntireMessage();
	DECLARE mystring CHARACTER;
	SET mystring='hello';
	SET OutputRoot.BLOB.BLOB=CAST (mystring AS BLOB CCSID 1208);
End of change