I monkeyed around a little with the Cobol example and found some syntax errors and other opportunities. This version will compile OK.
I'm not sure why IDMSIN01 was never used around here. I decided to split the work record out to an IDMS record so won't have to add as much to programs to use it.