DEFINE STRUCTURE

Purpose

Specifies a union type or a named structure.

Syntax

DEFINE STRUCTURE 1 struct-type-name [UNION] 
   {minor-struct-name [attribute][...]};

Abbreviation: STRUCT

Parameters

struct-type-name
Specifies the name given to the structure type. This name cannot have dimensions, but its substructures can.
minor-struct-name
Specifies the name given to a child level and deeper.
attributes
Specifies attributes for the minor-struct-name, which are limited to:
  • Data attributes
  • INITIAL non-data attribute

PL/I defaults supply missing data attributes. A variable declared as a typed structure does not propagate any of the following attributes to the members of the typed structure. These attributes are propagated only when the variable is declared as an untyped structure:

  • ALIGNED|UNALIGNED
  • ASSIGNABLE|NONASSIGNABLE
  • DIMACROSS
  • NATIVE|NONNATIVE
  • SUPPRESS

Variables declared with DEFINE STRUCTURE can only be assigned to variables (or parameters) having the same structure type.

A DEFINE STRUCTURE statement that names a structure without specifying any of its members defines an unspecified structure, which can be useful when a structure definition contains a handle to a second structure that also contains a handle to the first structure. An unspecified structure:

  • Cannot be de-referenced, but you can use it to declare a HANDLE that also cannot be de-referenced.
  • Can be the subject of a subsequent DEFINE STRUCTURE statement that does specify its members.

Restrictions

Unsupported type functions include BIND, CAST, NEW, RESPEC, SIZE and VALUE.