This section explains how to use documents and document templates
in your application programs.
Subtopics
Creating a document
You can use the DOCUMENT CREATE command to create either an empty
document, or a document containing data. The data can be a character string,
a block of binary data, a document template, or a buffer of data.
Defining symbol values
Your application can define values for symbols in a document template
using the DOCUMENT SET command or the DOCUMENT CREATE command. The symbol
values are substituted when the template is used, either by a DOCUMENT CREATE
command or by a DOCUMENT INSERT command.
Rules for specifying symbols and symbol lists
Each symbol has a name and a value. Follow these rules
for selecting the symbol name and specifying values for symbols, either
individually or in a symbol list.
Adding more data to a document
When you have created a document, you can extend its contents by
issuing one or more DOCUMENT INSERT commands. You can insert text, binary
data, a buffer of data, a document template, or the value of a symbol. You
can also insert bookmarks in a document, and use these to position later insertions.
Replacing data in a document
You can place bookmarks in a document to delimit an area of data
that can be replaced by a later insertion, or deleted. This technique lets
you provide a default item of text or other data in your document, which can
be used if your application finds that no data is available to replace it.
Retrieving, storing and reusing a document
Documents created by an application exist only for the length of
the CICS® task
in which they are created. To reuse a document, the application needs to retrieve
a copy and save it.
Deleting a document
You can use the DOCUMENT DELETE command to delete documents that
are no longer required during a transaction. On execution of the command,
the storage allocated to the document is released immediately. The DOCSTATUS(DOCDELETE)
option of the WEB CONVERSE, WEB SEND (Client) and WEB SEND (Server) commands
also allows document deletion.