Sign in

docs RPG Reference

The Essential Array Specifications

The Essential Array Specifications

You define an array on a definition specification. Here are the essential specifications for all arrays:

  • Specify the number of entries in the array using the DIM keyword
  • Specify length, data format, and decimal positions as you would any scalar fields. You may specify explicit From- and To-position entries (if defining a subfield in fixed-form), or an explicit Length-entry; or you may define the attributes using the LIKE keyword; or the attributes may be specified elsewhere in the program.
  • If you need to specify a sort sequence, use the ASCEND or DESCEND keywords.

Figure 1 shows an example of the essential array specifications.