1. DEFINE Statement

The DEFINE statement specifies an alias for a PL/I data type or defines an ordinal data type.

1.1. DEFINE ALIAS Statement

The DEFINE ALIAS statement specifies an alias for PL/I data type.

figure syntax define alias
DEFINE ALIAS statement
Component Description

alias-name

Alias name.

attributes

Attributes that can be specified for the data type of the alias.

The following is an example of using the DEFINE ALIAS statement to define an alias and using it to declare a variable.

  DEFINE ALIAS NAME CHAR(32);
  DECLARE COMPANY_NAME TYPE NAME;

1.2. DEFINE ORDINAL Statement

The DEFINE ORDINAL statement defines an ordinal data type.

figure syntax define ordinal
DEFINE ORDINAL statement

ordinal-value-list:

image

Component Description

ordinal-name

Name of the ordinal type.

member

Name of a member of the ordinal type.

VALUE

Value of a member of the ordinal type.

  • If VALUE is specified, it must be an integer value greater than that of the previous member.

  • If VALUE is omitted for the first member, 0 is used. If VALUE is omitted for any other members, the next greater integer is used (previous member’s value + 1).

PRECISION

Precision of VALUE. If PRECISION is omitted, PRECISION is determined by the range of VALUE.

SIGNED, UNSIGNED

Specifies VALUE as SIGNED or UNSIGNED.

The following is an example of using the DEFINE ORDINAL statement to define an ordinal data type and using it to declare a variable.

  DEFINE ORDINAL LANG ( PLI, COBOL, ASSEMBLER, C, CPP );
  DECLARE COMPILER ORDINAL LANG;