The ASBITSTREAM field function generates a bit stream for the subtree of a given field according to the rules of the parser that owns the field.
The BITSTREAM function is retained only for compatibility with earlier versions.
>>-ASBITSTREAM -( -FieldReference--+------------------------------+--)->< | .-<<-----------------------. | | V | | '---+-OPTIONS--expression--+-+-' +-ENCODING--expression-+ +-CCSID--expression----+ +-SET--expression------+ +-TYPE--expression-----+ '-FORMAT--expression---'Note that each clause can occur once only.
ASBITSTREAM returns a value of type BLOB that contains a bitstream representation of the field that is pointed to by FieldReference and its children.
In this way, the algorithm for determining these properties is essentially the same as that used for the BITSTREAM function.
Some parsers also support another mode, FolderBitStream, which generates a meaningful bit stream for any subtree, provided that the field that is pointed to represents a folder.
In all cases, the bit stream obtained can be given to a CREATE statement with a PARSE clause, using the same DOMAIN and OPTIONS to reproduce the original subtree.
When the function is called, any clause expressions are evaluated. An exception is thrown if any of the expressions do not result in a value of the appropriate type.
If any parameter is NULL the result is NULL.
Clause | Type | Default value |
---|---|---|
OPTIONS | Integer | RootBitStream & ValidateNone |
ENCODING | Integer | 0 |
CCSID | Integer | 0 |
SET | Character | Zero length string |
TYPE | Character | Zero length string |
FORMAT | Character | Zero length string |
For details of the syntax of the TYPE clause, refer to Specifying namespaces in the Message property.
Although the OPTIONS clause accepts any expression that returns a value of type integer, it is only meaningful to generate option values from the list of supplied constants, using the BITOR function if more than one option is required.
Validate master options...
ValidateContentAndValue
ValidateValue -- Can be used with ValidateContent
ValidateContent -- Can be used with ValidateValue
ValidateNone
Validate failure action options...
ValidateException
ValidateExceptionList
ValidateLocalError
ValidateUserTrace
C and Java™ equivalent APIs
Only one option from each group can be specified, with the exception of ValidateValue and ValidateContent, which can be used together to obtain the content and value validation. If you do not specify an option within a group, the option in bold is used.
0
MQENC_INTEGER_NORMAL
MQENC_INTEGER_REVERSED
MQENC_DECIMAL_NORMAL
MQENC_DECIMAL_REVERSED
MQENC_FLOAT_IEEE_NORMAL
MQENC_FLOAT_IEEE_REVERSED
MQENC_FLOAT_S390
0 uses the queue
manager's encoding.The values that are used for the CCSID clause follow the normal numbering system. For example, 1200 = UCS-2, 1208 = UTF-8.
For absent clauses, the given default values are used. Use the CCSID and encoding default values, because they take their values from the queue manager's encoding and CCSID settings.
Similarly, use the default values for each of the message set, type, and format options, because many parsers do not require message set, type, or format information; any valid value is sufficient.
ENCODING -> CCSID -> SET -> TYPE -> FORMAT -> OPTIONS
The list can be truncated at any point and you can use an empty expression for any clauses for which you do not supply a value.
DECLARE options INTEGER BITOR(FolderBitStream, ValidateContent,
ValidateValue);
SET result = ASBITSTREAM(cursor OPTIONS options CCSID 1208);
SET Result = ASBITSTREAM(Environment.Variables.MQRFH2.Data,,1208
,,,,options);