Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

String data and attributes

Refer to Data types and attributes for general information about strings.

BIT, CHARACTER, GRAPHIC and WIDECHAR attributes

The BIT attribute specifies a bit variable.

The CHARACTER attribute specifies a character variable. Character strings can also be declared using the PICTURE attribute.

The WIDECHAR attribute specifies a widechar variable which will hold UTF-16 data.

The GRAPHIC attribute specifies a graphic variable.

The syntax for the BIT, CHARACTER, GRAPHIC and WIDECHAR attributes is:

Read syntax diagramSkip visual syntax diagram>>-+-BIT-------+--+-(length-+-----------------+-)-+------------->
   +-CHARACTER-+  |         '-REFER(variable)-'   |
   +-GRAPHIC---+  '-(*)---------------------------'
   '-WIDECHAR--'
 
   .-NONVARYING---.
>--+-+---------+--+--------------------------------------------><
   | '-VARYING-'  |
   '-+----------+-'
     '-VARYINGZ-'
 
Table 12. Abbreviations for string data attributes
Attribute Abbreviation
CHARACTER CHAR
GRAPHIC G
WIDECHAR WCHAR
NONVARYING NONVAR
VARYING VAR
VARYINGZ VARZ  
length
Specifies the length of a NONVARYING string or the maximum length of a VARYING or VARYINGZ string. The length is in bits, characters, widechars or graphics (DBCS characters), as appropriate.

You can specify the length as an expression or as an asterisk. If the length is not specified, the default is 1. For named constants, length is determined from the length of the value expression.

For a parameter, an expression is valid only if it is CONTROLLED. An asterisk specification for a parameter indicates that the length is taken from the argument that is passed.

If the length specification is an expression, it is evaluated and converted to FIXED BINARY(31,0), which must be positive, when storage is allocated for the variable.

For STATIC data, length must be a restricted expression.

For BASED data, length must be a restricted expression, unless the string is a member of a structure or a union and the REFER option is used.

REFER
See REFER option (self-defining data) for the description of the REFER option.

The statement below declares User as a variable that can represent character data with a length of 15:

  declare User character (15);

The following example shows the declaration of a bit variable:

  declare Symptoms bit (64);

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)