Closing files



As with other languages, it is good practice to close the file or data set once processing is complete.

File de-allocation, in fore-ground, may fail if the file or data set is not closed.

Remember EXECIO does not perform an implicit CLOSE, so the file will be left OPEN.

Closing a file or data set.



z/OS

 

z/VM

 

Closing an input file or data set (DISKR)

"EXECIO 0 DISKR ddname ( FINIS "

Closing an output file or data set (DISKW)

"EXECIO 0 DISKW ddname ( FINIS "

Closing an update file or data set (DISKRU)

"EXECIO 0 DISKRU ddname ( FINIS "

In all of the above examples ddname should match the file name on the assciated TSO ALLOCATE (ALLOC) command, or the relevant DD statement in the batch JCL.

 

Closing an input file or data set (DISKR)

"EXECIO 0 DISKR fn ft ( FINIS "

Closing an output file or data set (DISKW)

"EXECIO 0 DISKW fn ft ( FINIS "

Close using the CMS Command.

"FINIS fn ft fm "

Copyright © Legac-e Education 2015-