I have successfully coded dynamic file allocation in a COBOL program. My problem is this: I need to dynamically allocate the file in a central subroutine and then be able to open and close that file from the program that calls the subroutine to allocate the file. Is this possible and if so, how?
Software/Hardware used:
COBOL Z/OS Enterprise Mainframe
ASKED:
February 22, 2010 5:11 PM
UPDATED:
July 28, 2010 4:40 PM
In your first sentence you stated you have successfully coded dynamic file allocation in a COBOL program. Then you would only have to call that module, passing the necessary parameters i.e. file name, disposition, etc. The called module would return a return-code indicating success or failure. In case of success you would proceed as normal in opening, reading, closing your file. Call the module again to deallocate – free – the file allocation. At least I remember thats the way I used to do, although the dynamic allocaiton routine was an assembler module.