Data Structures

466 Views


Data Structures

The ILE RPG compiler allows you to define an area in storage and the layout of the fields, called subfields, within the area. This area in storage is called a data structure.

You define a data structure in free form by specifying the DCL-DS operation code followed by the data structure name and keywords. You define a data structure in fixed form by specifying DS in positions 24 through 25 on a definition specification.

You can use a data structure to:

  • Define the same internal area multiple times using different data formats
  • Define a data structure and its subfields in the same way a record is defined.
  • Define multiple occurrences of a set of data.
  • Group non-contiguous data into contiguous internal storage locations.
  • Operate on all the subfields as a group using the name of the data structure.
  • Operate on an individual subfield using its name.

IBM - Data Structures

RPGPGM - Data structures in RPG

Post Comments