There are two valid forms of character host variables.
>>-+-01------+--variable-name--+-PICTURE-+----------------------> +-77------+ '-PIC-----' '-level-1-' .-IS-. >--+----+--picture-string--+----------------------------+-------> | .-IS-. | | .-USAGE--+----+-. | '-+---------------+--DISPLAY-' >--+--------------------------------+-- . --------------------->< | .-IS-. | '-VALUE--+----+--string-constant-'
>>-+-01------+--variable-name-- . ------------------------------> '-level-1-' .-IS-. >--49--var-1--+-PICTURE-+--+----+--picture-string-1-------------> '-PIC-----' .-IS-. .-USAGE--+----+-. >--+---------------+--+-BINARY----------+-----------------------> +-COMPUTATIONAL-4-+ '-COMP-4----------' >--+---------------------------------+-- . ---------------------> | .-IS-. | '-VALUE--+----+--numeric-constant-' .-IS-. >--49--var-2--+-PICTURE-+--+----+--picture-string-2-------------> '-PIC-----' >--+----------------------------+-------------------------------> | .-IS-. | | .-USAGE--+----+-. | '-+---------------+--DISPLAY-' >--+--------------------------------+-- . --------------------->< | .-IS-. | '-VALUE--+----+--string-constant-'
Note that the database manager will use the full size of the S9(m) variable even though COBOL on the iSeries™ only recognizes values up to the specified precision. This can cause data truncation errors when COBOL statements are being run and may effectively limit the maximum length of variable-length character strings to the specified precision.