DEFINE ALIAS

Purpose

Specifies a name that can be used as a notation for a collection of data type attributes.

Syntax

DEFINE ALIAS [alias-name, attribute,...];

Parameters

alias-name
The name that can be used as a synonym for the explicit data type defined by the specified attributes.
attributes
The specified attributes for the alias. Separate each attribute with a comma(,). The attributes that can be specified are any of the attributes for variables that can be returned by a function. You cannot specify an alias for an array or a structured attribute list. Any string lengths or area sizes must be restricted expressions.

Missing data attributes are supplied using PL/I defaults.

Description

An alias can be used wherever an explicit data type can be used. Using DEFINE ALIAS, you can assign meaningful or shorter names for sets of data type attributes thus making a program easier to understand.

Example

   define alias Name char (32) varying;
   define alias EmployeeId pic (5)'9';

   dcl MyName type Name;         /* MyName has the attributes char (32) varying */.
   dcl MyId type EmployeeId;     /* MyId  has the attributes pic (5)’9’  */

   MyName = 'Jack Jones';
   MyId = 12345;
Note: Whenever Name is used in a DECLARE statement, it has the attributes char(32) varying.

Restrictions

Alias of aliases is not supported.