Skip to content

Instantly share code, notes, and snippets.

@prichelle
Last active November 5, 2019 10:12
Show Gist options
  • Save prichelle/3edb6373a4995ada4f6d to your computer and use it in GitHub Desktop.
Save prichelle/3edb6373a4995ada4f6d to your computer and use it in GitHub Desktop.
Tree (ExceptionList) serialization (BLOB) in LocalEnvironment using ESQL ASBITSTREAM FUNCTION
-- Create a folder "ExceptionList" in the LocalEnvironment tree. This Folder will hold the BLOB representation of the ExceptionList
SET OutputLocalEnvironment.Variables.BitStream.Info = 'exceptionList';
-- Define a XML parser element to be used to serialize the ExceptionList into bitstream
CREATE LASTCHILD OF OutputLocalEnvironment.Variables.BitStream DOMAIN('XMLNSC') NAME 'XMLNSC';
-- Attach or create the tree that has to be serialized under the XML parser element. here it is the ExceptionList
SET OutputLocalEnvironment.Variables.BitStream.XMLNSC.ExceptionList = InputExceptionList;
-- Create the BLOB representation of the ExceptinList using the function ASBITSTREAM
SET OutputLocalEnvironment.Variables.BitStream.BLOB =
ASBITSTREAM(OutputLocalEnvironment.Variables.BitStream.XMLNSC.ExceptionList OPTIONS FolderBitStream);
@prichelle
Copy link
Author

This code shows how to serialize a tree into an XML.
It uses the ESQL function ASBITSTREAM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment