I'm pretty much clueless about all COBOL data formats, but I wrote what you are now trying to write for PL/I way back in 1992, also as a complete REXX newbie. It took me probably at least a hundred hours of my own time, but now, 21 years later it still works, be it that I never added support for PL/I's "UNION" and some features like REFER. However, once you figure out how to do it, you will be able to use your core, the COPY BOOK parser for many other purposes, my parser has back-ends that let me do formatted browse/view of files, it lets me build files, it lets me use it to to in-edit formatted views of records, and it even allows me to format data in system dumps.
Writing the code will be a challenge, but it will be fun!
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy