DEFINE ALIAS statement
The DEFINE ALIAS statement specifies a name that can be used as a synonym for the set of data type attributes you give to the alias.
- alias-name
- Specifies the name that can be used wherever the explicit data type defined by the specified attributes is allowed.
- attributes
- The attributes that can be specified
are only the data attributes valid in the RETURNS option and attributes
listed in the Table 2, plus the
attributes DATE, VALUELIST, and VALUERANGE. As in the RETURNS option
and attribute, any string lengths or area sizes must be restricted
expressions.
Non-data attributes, such as (UN)ALIGNED, (NON)NATIVE, and BYVALUE/BYADDR, are valid in the RETURNS option, but they are not valid in a DEFINE ALIAS statement.
Specifying an alias for an array or a structured attribute list is not allowed. However, it is allowed to specify an alias for a type that is defined in a DEFINE ORDINAL statement, or a DEFINE STRUCTURE statement, or another DEFINE ALIAS statement.
Missing data attributes are supplied with PL/I defaults.
Example
In this example, whenever Name is
used in a DECLARE statement, it has the attributes char(31)
varying.
define alias Name char(31) varying;
define alias Salary fixed dec(7); /* real by default */
define alias Zip char(5) /* nonvarying by default */