There is also the ability for COBOL to dynamically open the new file. No SELECT clause or JCL required.
Here is the source code;
MOVE 'YOUR.FILE.NAME' TO FN.
STRING 'ALLOC DD(OTFILE) DSN(' FN ') NEW '
'CATALOG ' 'LRECL(80) RECFM(F,B)' <<=== REMEMBER TO CHANGE THIS TO YOUR PARAMETERS
DELIMITED BY SIZE
DISPLAY ' WS-ALLOC-STRING *' WS-ALLOC-STRING '*'
CALL 'BPXWDYN' USING WS-ALLOC-STRING.
OPEN OUTPUT OT-FILE. Then write to it and when you are done close it.