ASBITSTREAM function
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.
- Encoding
- CCSID
- Message set
- Message type
- Message format
- Options
The BITSTREAM function is retained only for compatibility with earlier versions.
Syntax
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.
- RootBitStream, in which the algorithm that generates the bit stream is the same as the algorithm that is used by an output node. In this mode, a meaningful result is obtained only if the field pointed to is at the head of a subtree with an appropriate structure.
- EmbeddedBitStream, in which not only is the algorithm that generates
the bit stream the same as the algorithm used by an output node, but
also the
- Encoding
- CCSID
- Message set
- Message type
- Message format
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
For full details of the validation options, refer to Validation properties.- Equivalent validation options are not available in the C plugin node API methods cniCreateElementAsLastChildFromBitstream() and cniElementAsBitstream().
- The Java plugin node API MBElement methods createElementAsLastChildFromBitstream() and toBitstream() provide validation options. However, the FolderBitStream and EmbeddedBitStream modes are not available. The only available mode is RootBitStream, which is the default value.
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.
0
uses the queue manager's CCSID-1
uses the CCSID's as determined by the parser itself. This value is reserved.
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.
Examples
DECLARE options INTEGER BITOR(FolderBitStream, ValidateContent,
ValidateValue);
SET result = ASBITSTREAM(cursor OPTIONS options CCSID 1208);
SET Result = ASBITSTREAM(Environment.Variables.MQRFH2.Data,,1208
,,,,options);