Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Using variables

A variable is a data item whose value can change during a program. The value is restricted, however, to the data type that you define when you specify a name and a length for the data item.

For example, if a customer name is an alphanumeric data item in your program, you could define and use the customer name as shown below:

Data Division.
01  Customer-Name           Pic X(20).
01  Original-Customer-Name  Pic X(20).
. . .
Procedure Division.
    Move Customer-Name to Original-Customer-Name
    . . .

You could instead declare the customer names above as national data items by specifying their PICTURE clauses as Pic N(20) and specifying the USAGE NATIONAL clause for the items. National data items are represented in Unicode UTF-16, in which most characters are represented in 2 bytes of storage.

related concepts
Unicode and the encoding of language characters

related tasks
Using national data (Unicode) in COBOL

related references
NSYMBOL
Storage of national data
PICTURE clause (COBOL for Windows Language Reference)


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)