This section explains the function and use of the commands in the DOCUMENT application programming interface:
You can create an empty document using the DOCUMENT CREATE command, and then build the contents with subsequent DOCUMENT INSERT commands, or use DOCUMENT CREATE to create and build the document in one step. DOCUMENT CREATE has a mandatory DOCTOKEN parameter requiring a 16-byte data-area. The document handler domain uses the DOCTOKEN operand to return a token, which is used to identify the document on subsequent calls. The following example creates an empty document, and returns the token in the variable MYDOC:
EXEC CICS DOCUMENT CREATE
DOCTOKEN(MYDOC)
To create a document with data, use the DOCUMENT CREATE command in any of the following ways:
Use this option to add to the document the contents of a data-area that must not undergo conversion to a client code page when the data is sent.
EXEC CICS DOCUMENT CREATE
DOCTOKEN(MYDOC1)
BINARY(DATA-AREA)
Use this option to add the specified contents to the document. For example, if you define a character string variable called DOCTEXT and initialise it to This is an example of text to be added to a document, you can use the following command to create a document consisting of this text string:
EXEC CICS DOCUMENT CREATE
DOCTOKEN(MYDOC2)
TEXT(DOCTEXT)
LENGTH(53)
To copy an existing document into a new document, you can use the DOCUMENT CREATE command with the FROMDOC option. The following example shows this:
EXEC CICS DOCUMENT CREATE
DOCTOKEN(MYDOC3)
FROMDOC(MYDOC2)
where MYDOC2 and MYDOC3 are 16-character variables. MYDOC2 must contain the token returned by a previous DOCUMENT CREATE command.
This results in two identical documents, each containing the text This is an example of text to be added to a document.
[[ Contents Previous Page | Next Page Index ]]