Mmm... did you try compiling it yet? It looks like, if you are using Release 4, you might just get the odd error or two. Sorry about that. Release 2 is apparently '74 Cobol standard. Release 4 is '85 Cobol standard. If you can believe it, no-one asked me when they were discussing the '85 standard
, and the flexibility of OCCURS DEPENDING ON was severely curtailed.
You can still use the Release 2 by specifying the compiler option CMPR2, but this particular technique will now have limited (no) use to you in the future. I am saddened. Also a little concerned about what various poor souls will have had to do in various places I worked when they migrated to Release 4. I bet they didn't see that coming! They even screwed up another trick I used to use, but that is another story.
I picked up this looking through the manuals. I assume it is correct.
Perhaps time to take my own advice and look up "reference modification"