Multiple Occurrence Data Structures

Multiple Occurrence Data Structures by default behave the same as in RPG/400. The current occurrence is initially set to the first and can be changed using the OCCUR operation code or %OCCUR function. They can be declared using the DCLDS command.

Encore RPG also allows the [ ] characters to access occurrences. Use of the [ ] does not alter the current occurrence.

Example

MOVE Total MyDS[5].Total
MOVE Prod MyDS[5].ProdArray[3]
MOVE Amount MyMultDCLFLDDS[5,3,2].Amount

See Also

Language Elements

Data Structure Element

DCLDS

DCLDSFLD

DCLOVERLAYGROUP

OCCUR

%OCCUR

Array Elements

Control Properties

Fields