Rules for Indicator Variables - Teradata Preprocessor2

Teradata® Preprocessor2 for Embedded SQL Programmer Guide - 20.00

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
Lake
VMware
Product
Teradata Preprocessor2
Release Number
20.00
Published
October 2023
ft:locale
en-US
ft:lastEdition
2023-11-20
dita:mapPath
nyr1691484085721.ditamap
dita:ditavalPath
obe1474387269547.ditaval
dita:id
xfi1470440464166
Product Category
Teradata Tools and Utilities
Number Contained in Indicator Variable Description
A negative number (most commonly -1) The number specifies, to the precompiler, that the associated input main variable should be treated as a null.

Alternatively, it means the database returned a null for the associated column.

Zero The number specifies, to the precompiler, that the associated input main variable is non-null or that a non-null value was successfully returned with no exception conditions applied.
A positive number The number specifies, to the application, that truncation has occurred when returning a character or byte string to the associated main variable.

This value represents the original length of the string before truncation.

An indicator variable is defined as a 2-byte integer (smallint) or by a 4 digit signed zoned decimal.

In COBOL, the smallint form is declared as:

PIC S9(n) <comp>

where the value for n is 3 or 4 and <comp> is COMP-5 for MF COBOL and COMP for all other COBOL compilers.

The zoned decimal form is declared as:

PIC S9(4) <zoned decimal type>

where <zoned decimal type> is DISPLAY [SIGN {LEADING | TRAILING} [SEPARATE]]