operation code-occur

105 pts.
Tags:
Code
RPG
RPGLE
In what condition we have to use occur?what is the use of occur(Set/Get Occurrence of a Data Structure )?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Cwc
    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
    4,290 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following