DSM Template Services Manual

Display-Text Procedures
DSM Template Services Manual427187-004
2-19
Custom-Formatting Procedures
Custom-Formatting Procedures
You can customize the way the SPI_BUFFER_FORMAT procedures represent
structured tokens or fields of a particular type. To do so, you must write these entities
and include them in the system:
1. A custom-formatting procedure. Your procedure is called from the
SPI_BUFFER_FORMATNEXT_ procedure whenever a token or field of its type is
to be formatted. Your procedure must be placed in the system library so the
SPI_BUFFER_FORMAT procedures can find it.
2. A FORMAT statement. Custom-formatting procedures represent tokens or fields of
a particular type, and that type is based on a particular DDL DEF. When
representing a token or field of that type, the SPI_BUFFER_FORMATNEXT_
procedure must determine which custom-formatting procedure to call. The
template-language FORMAT statement provides the necessary link between the
custom-formatting procedure and its DEF.
After including the appropriate FORMAT statement in a template source file,
recompile the source file and install the resulting templates in the system.
When you write your custom-formatting procedure, make sure its syntax conforms
strictly to the syntax in the box.
Table 2-8. Supplementary Status Values
Main Status-1 Status-2 Explanation
-13 2 x File-management error x received while opening the
nonresident template file
-13 3 x File-management error x received while reading the
nonresident template file
-14 1 x ALLOCATESEGMENT error x received while allocating the
private segment.
-14 7 x MOVEX error x received while accessing the private
segment.
-15 -2 x Nonresident template file error x, in which x has the values:
-1 File code is not 844.
-2 File is not a disk file.
-3 File is not key-sequenced.
-4 File has wrong record size.
-5 Primary key def is wrong.
Note. Custom-formatting procedures are not used for the formatting done with the Template
Language. However, custom-formatting procedures can influence the output from
SPI_BUFFER_FORMATNEXT_.