Occur is used with a multiple occuring datastructure
Kind of like an array
D MyDS DS Occurs(10)
D Myfield1 10A
D Myfield2 6 0
Positioning to an occurance or finding out which occurance you are positioned to is the OCCUR
5 OCCUR MyDS <-- positions to the 5th "record/occurance/set"
OCCUR MyDS P <- P contains the position (5) that you are at
Last Wiki Answer Submitted: October 23, 2008 2:13 pm by philpl1jb44,190 pts.
All Answer Wiki Contributors: philpl1jb44,190 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
You can also use a data structure array, instead of the OCCUR operation or the %Occur function. Functionally, a multiple occurrence data structure is essentially an array of data structures, so defining and manipulating these as an array tends to be a cleaner and easier syntax, particularly to those used to other languages.
You can also use a data structure array, instead of the OCCUR operation or the %Occur function. Functionally, a multiple occurrence data structure is essentially an array of data structures, so defining and manipulating these as an array tends to be a cleaner and easier syntax, particularly to those used to other languages.
Here is an informative article about the subject.
http://www.mcpressonline.com/programming/rpg/exploring-v5r2s-data-structure-arrays.html