SQL/MP Programming Manual for COBOL

Host Variables
HP NonStop SQL/MP Programming Manual for COBOL529758-003
2-25
Associating a Character Set With a Host Variable
Using INVOKE with SQLCI provides less program independence than embedding
INVOKE in your program, because you must re-create the host variable declarations if
the referenced table changes. However, if necessary, you can edit the host variables
before copying them into your program’s compilation unit.
Associating a Character Set With a Host
Variable
By default, SQL/MP associates a single-byte unknown character set with a host
variable. To associate a specific character set such as ISO 8859/n, Kanji, or KSC5601
with a host variable, include the CHARACTER SET clause in the host variable
declaration using this syntax:
level
is the COBOL level number.
host-variable
is a COBOL identifier that is the name of the host variable, which must conform to
COBOL naming conventions.
"character-set-name"
specifies the name of the character set, which must be one of these keywords:
ISO8859n (where n ranges from 1 through 9)
KANJI
KSC5601
UNKNOWN
You must enclose character-set-name in double quotation marks ("). Any
leading or trailing spaces inside the double quotation marks are ignored.
The UNKNOWN keyword indicates an unknown single-byte character set and is
equivalent to omitting the CHARACTER SET clause.
length
is the length in characters (not bytes) of the host variable. For a double-byte
character set, you must code the PICTURE clause specification (the X part) on a
single line.
level host-variable
[ CHARACTER SET [ IS ] "character-set-name" ]
PIC[TURE] { X [ ( length ) ] }...[ COBOL-clause ]... .