7 17 1 DEF_ARRAY Parameters

LANSA Technical

7.17.1 DEF_ARRAY Parameters

ENTRY_DEC

ENTRY_LEN

INDEXES

NAME

OF_FIELDS

OVERLAYING

TOT_ENTRY

TYPE

NAME

Specifies the name that is to be assigned to the array. The following warnings and comments apply to the assignment of array names:

  • The name must begin with the standard "#" symbol.
  • The name can be from 2 to 4 characters long (including the "#").
  • The second character must be a letter from the English alphabet.
  • Subsequent characters must be a letter from the English alphabet, or, one of the values 1,2,3,4,5,6,7,8,9,0 or $.
  • It is strongly recommended that array naming standards are devised for application systems to facilitate the exchange of array data between functions and all improved impact analysis abilities.
  • The following names are reserved and must not be used
  • any name containing an "@" symbol.
  • any name containing an imbedded "#" symbol.
  • names containing "MVR", "CMK", "RIM" or "GEN".
  • 'TAB' can not be used as an array name.

INDEXES

Specifies the names of the numeric fields that will be used as indexes to reference individual elements in this array.

At least one index name must be specified. Up to 50 may be specified.

The following warnings and comments apply to the assignment of array index field names:

  • The name must begin with the standard "#" symbol.
  • The name must be 3 characters long (including the "#").
  • The second character must be a letter from the English alphabet.
  • The third character must be a letter from the English alphabet, or one of the values 1,2,3,4,5,6,7,8,9,0 or $.
  • The array index field must be a numeric field (packed or signed) and must be either defined in this function or in the LANSA data dictionary.
  • The array index field cannot be an RDMLX field.
  • The following names are reserved and must not be used
  • any name containing an "@" symbol.
  • any name containing an imbedded "#" symbol.

It is strongly recommended that several standard array index names are defined in the data dictionary as used by all programs. A minimum suggested set of index fields would be:

                                                                                                              

Name

Type

Length

Decimals

II

P

7

0

JJ

P

7

0

KK

P

7

0

LL

P

7

0

MM

P

7

0

NN

P

7

0

 

Do not skimp on the number of digits to values of 2 or 3, this will only cause later problems.

Array index fields must not be overlaid on or by other fields (in any context).

OF_FIELDS

Specifies from 1 to 100 fields that are to be grouped into a contiguous area so that they can be referenced by index via this array.

All fields must have the same type, length and number of decimal positions. An expandable group expression is allowed in this parameter. Either none of them have the ASQN attribute, or ALL of them have the ASQN attribute.

Any field specified in this parameter must NOT itself be overlaid onto another field by using the TO_OVERLAY parameter of DEFINE or OVERRIDE commands.

Once a field has been specified in the OF_FIELDS parameter of one DEF_ARRAY command it cannot be specified in the OF_FIELDS parameter of any other DEF_ARRAY command (ie: a field can only be defined in one array).

An RDMLX field does not have a #xxx#ARRAY field automatically defined, whether or not the length is less than or equal to 256.

Failure to observe these rules may cause unpredictable results.

The OF_FIELDS parameter and the OVERLAYING parameter are mutually exclusive. You must specify one, but cannot specify both.

OVERLAYING

Specifies the name of a field that is to be fully or partially overlaid by this array. RDMLX fields may not be overlaid, nor overlay another field.

When a full overlay is required, the total length (in bytes) of the array should match the total length (in bytes) of the field being overlaid.

When a partial overlay is required, the total length (in bytes) of the array may be less than the total length (in bytes) of the field being overlaid.

The optional start position component of this parameter allows the array to partially overlay only a component of the field being overlaid.

Whether a full or partial overlay is required, you must NOT define the array so that it goes beyond the last position of the field being overlaid. Failure to observe this rule will cause unpredictable results.

The field that is referenced by this parameter must NOT itself be overlaid onto another field by using the TO_OVERLAY parameter of the DEFINE or OVERRIDE commands.

The OVERLAYING parameter and the OF_FIELDS parameter are mutually exclusive. You must specify one, but cannot specify both.

TYPE

Specifies the type of data storage to be used within the array. Valid types are:

*CHAR

Character or alphanumeric data is to be stored in the array. Corresponds to the LANSA dictionary type of "A".

*PACKED/*DEC

Packed decimal data is to be stored in the array. Corresponds to the LANSA dictionary type of "P".

*SIGNED

Signed or zoned decimal data is to be stored in the array. Corresponds to the LANSA dictionary type of "S".

Do NOT specify this parameter when you use the OF_FIELDS parameter. Its value is automatically deduced from the type of the field(s) specified in the OF_FIELDS parameter.

TOT_ENTRY

Specifies the total number of entries the array will contain. Any integer value in the range 1 to 9999 is valid.

Do NOT specify this parameter when you use the OF_FIELDS parameter. Its value is automatically deduced from the number of field(s) specified in the OF_FIELDS parameter.

ENTRY_LEN

Specifies the total length of each individual entry in the array.

For type *CHAR arrays, the value must be an integer in the range 1 to 256.

For type *DEC, *PACKED and *SIGNED arrays, the value must be an integer in the range 1 to 30. The value you specify here is the total number of digits the numeric field contains. For packed fields this does not represent the number of bytes of memory each array entry will occupy.

Do NOT specify this parameter when you use the OF_FIELDS parameter. Its value is automatically deduced from the length of the field(s) specified in the OF_FIELDS parameter.

ENTRY_DEC

Specifies the total number of decimal positions (ie: digits, not bytes) that each numeric array entry should contain.

For type *CHAR arrays this value is ignored.

For type *DEC, *PACKED and *SIGNED arrays the value must be an integer in the range 0 to 9.

Do NOT specify this parameter when you use the OF_FIELDS parameter. Its value is automatically deduced from the number of decimal positions of the field(s) specified in the OF_FIELDS parameter.