Register Hereor login if you are already a member
Essentially a multiple occurance data structure is a 2 dimensianal array, common in many other languages. Until the capability to perform multiple orruance data structures came along, there really was not way to do this.
I can recall using this just a few times (2 maybe 3 times) in my career (20+ years). So it is not something that is used very often.
When I have used it, I was retrieving data from a file that was not organized to have a nice level break type program.
The one I recall the best: The goal was basically to have the summary of a level break program without the detail. Essentially a summary report grouped by factory location, within each factory the type of order, then the press, spread accross various time frames (over due, due this week, next week, week after, 30 days, 60 days, 90 days, etc.). All of the data was in seperate files with no good way to create a join for all of the files. So I would process an order, using the multiple occruance array to determine which occurance the job was to be applied to (factory, order type, press-think rows) then I put the data into a date bucket for the right bucket in the data structure (think columns).
I suppose I could have done this with a work file, but at the time this approach seemed a better way to go. This program replaced a series of SQL procedures that produced information in a series non-meaningful reports; that program took 12 minutes to run. My program ran in 90 seconds and provided a more useful report that users loved. Both ran as scheduled jobs and spit out the report every morning that someone else had the responsibility to copy and manually put on users desks (this was about 20 years ago on a v4 machine). Would I do things differntly today, very likely.
The other time I recall using a multiple occurance data structure was a similar situation, but there are too many miles since that bridge, so I don't recall the specifics.
@ToddN2000, I was still a relatively inexperienced programmer when I wrote those, but have never written a program for production that used the cycle and never written one that used L1, L2 etc. since a college course.
I have written a few update programs that used the cycle that were quick and dirty when I didn't trust my SQL skills to make the changes. But they were one-off programs.
I don't recall ever seeing a program written by someone else that used a MODS.