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

Data attributes

Describe computational data, program-control data, and program characteristics.

AREA
BINARY
BIT
CHARACTER
COMPLEX
DECIMAL
DIMENSION
ENTRY
FILE
FIXED
FLOAT
FORMAT
GRAPHIC
HANDLE
LABEL
NONVARYING
OFFSET
ORDINAL
PICTURE
POINTER
PRECISION
REAL
RETURNS
SIGNED
STRUCTURE
TASK
TYPE
UNSIGNED
UNION
VARYING
VARYINGZ
WIDECHAR

Nondata attributes

Describe nondata elements (for example, built-in functions) or provide additional description for elements that have other data attributes.

ABNORMAL
ALIGNED
ASSIGNABLE
AUTOMATIC
BASED
BIGENDIAN
BUFFERED
BUILTIN
BYADDR
BYVALUE
CONDITION
CONNECTED
CONTROLLED
DEFINED
DIRECT
ENVIRONMENT
EXCLUSIVE
EXTERNAL
GENERIC
HEXADEC
IEEE
INITIAL
INPUT
INTERNAL
KEYED
LIKE
LIST
LITTLEENDIAN
NONASSIGNABLE
NONCONNECTED
NORMAL
OPTIONAL
OPTIONS
OUTPUT
PARAMETER
POSITION
PRINT
RECORD
SEQUENTIAL
STATIC
STREAM
UNALIGNED
UNBUFFERED
UPDATE
VALUE
VARIABLE

For example, the keyword CHARACTER is a data attribute for the string type of computational data. The keyword FILE is a data attribute for the file type of program-control data. The INTERNAL scope attribute specifies that the data item is known only within its declaring block.

The details on using keywords and expressions to specify the attributes are in Data declarations. Briefly, you specify attributes:

Table 7 and Table 8 help you correlate PL/I’s variety of attributes with its variety of computational and program-control data types. The tables show that the constants and the named constants can only have the indicated data and scope attributes (Table 7). Variables can specify additional attributes (Table 8).

In the example,

  Area = (Radius**2)*3.1416;

the constant 3.1416 is given the attributes:

(See the "Coded arithmetic" row, and "Data Attributes" and "Scope Attributes" columns of Table 7.)

The constant 1.0 (a decimal fixed-point constant) is different from the constants 1 (another decimal fixed-point constant), '1'B (a bit constant), '1' (a character constant), 1B (binary fixed-point constant), or 1E0 (a decimal floating-point constant).

In the following example, the variable Pi has the programmer-defined data attributes of FIXED and DECIMAL with a PRECISION of five digits, four to the right of the decimal point.

  declare Pi fixed decimal(5,4) initial(3.1416);

Because this DECLARE statement contains no other attributes for Pi, PL/I applies the defaults for the remaining attributes:

(See the coded arithmetic row of Table 8.)

Table 7. Classification of attributes by constant types
Constant Type
Data Attributes
Notes 1 and 2
Scope Attributes
Notes 1 and 2
Coded
arithmetic
REAL | imaginary
FLOAT | FIXED
BINARY | DECIMAL
PRECISION
SIGNED
internal
Named coded
arithmetic
REAL | COMPLEX
FLOAT | FIXED
BINARY | DECIMAL
PRECISION
VALUE
SIGNED | UNSIGNED
internal
String
BIT | CHARACTER |
GRAPHIC | WIDECHAR
(length)
internal
Named string
BIT | CHARACTER |
GRAPHIC | WIDECHAR
[(length)]
NONVARYING
VALUE
internal
Named locator
POINTER | OFFSET | HANDLE
VALUE
internal
Named picture
PICTURE
REAL | COMPLEX
VALUE
internal
FileNote 3
FILE ENVIRONMENT
STREAM | RECORD
INPUT | OUTPUT | UPDATE
SEQUENTIAL | DIRECT
BUFFERED | UNBUFFEREDNote 4
KEYED
PRINT
INTERNAL | EXTERNAL
EntryNote 5
ENTRY [RETURNS] 
INTERNAL | EXTERNAL
FormatNote 5
FORMAT
internal
LabelNote 5
LABEL
internal
Notes:
  1. Attributes in this table that appear in uppercase can be explicitly declared. Attributes that are in lowercase are implicitly given to the data type.
  2. Defaults for data attributes are underlined. Because the data attributes for literal constants are contextual, defaults are not applicable. Named constants and file constants have selectable attributes, so defaults are shown.
  3. File Attributes are described in Input and output.
  4. BUFFERED is the default for SEQUENTIAL files. UNBUFFERED is the default for DIRECT files.
  5. Format and label constants, and INTERNAL entry constants cannot be declared in a DECLARE statement.
Table 8. Classification of attributes by variable types
Variable
Type
Data Attributes
Alignment
Attributes
Scope
Attributes
Storage
Attributes
Area
AREA(size)
ALIGNED
INTERNAL |
EXTERNAL
 
(INTERNAL is
mandatory for
 AUTOMATIC
 BASED
 DEFINED
 PARAMETER)
AUTOMATIC |
STATIC |
BASED |
CONTROLLED
 
(AUTOMATIC
is the
default for
INTERNAL;
STATIC is
the default
for
EXTERNAL)
 
Defined
variable:
  DEFINED
  [POSITION]
 
Parameter:
PARAMETER
[CONNECTED |
NONCONNECTED]
[CONTROLLED]
 
[INITIAL
[CALL]]
 
[VARIABLE]
 
[NORMAL |
ABNORMAL]
 
ASSIGNABLE |
NONASSIGNABLE
Coded
arithmetic
Note 1
REAL | COMPLEX
FLOAT | FIXED
BINARY | DECIMAL
PRECISION
[SIGNED |
UNSIGNED]
ALIGNED |
UNALIGNED
Entry
ENTRY [RETURNS]
[LIMITED]
File
FILE
Format
FORMAT
Label
LABEL
Locator
POINTER |  HANDLE |
{OFFSET
[(area-variable)]}
Ordinal
ORDINAL
Picture
PICTURE
REAL | COMPLEX
ALIGNED |
UNALIGNED
String
BIT | CHARACTER |
GRAPHIC | WIDECHAR
[(length)]
[ VARYING |
VARYINGZ |
NONVARYING]
Task
TASK
ALIGNED |
UNALIGNED
Arrays: DIMENSION can be added to the declaration of any variable. Refer to Arrays for more information.
Structures and unions:
  • For a major structure or union: scope, storage (except INITIAL), alignment, STRUCTURE or UNION, and the LIKE attributes can be specified.
  • For a member that is a structure or a union: alignment, STRUCTURE or UNION, and the LIKE attributes can be specified.
  • Members always have the INTERNAL scope attribute.
Refer to Structures and Unions for more information.
Notes:
  1. Undeclared names, or names declared without a data type, default to coded arithmetic variables. Default attributes are described in Defaults for attributes. Defaults shown are IBM defaults. ANS defaults are FIXED and BINARY rather than FLOAT and DECIMAL.
  2. POSITION can be used only with string overlay defining.

Terms of use | Feedback

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