The /EOF compiler directive is used to indicate that the compiler should consider that end-of-file has been reached for the current source file.
In fixed-form, /EOF must begin in column 7. 
/EOF can be specified within
any free-form statement other than a free-form calculation statement.
Within free-form statements, /EOF can begin in
column 8 or later. 
The remainder of the line containing /EOF must be blank. 
Using the /EOF directive will enhance compile-time performance when an entire /COPY member is to be used only once, but may be copied in multiple times. (This is not true if excluded lines are being printed).
The following is an example of the /EOF directive.
*-----------------------------------------------------------------
* Main source file
*-----------------------------------------------------------------
....
/IF DEFINED(READ_XYZ) 1
/COPY XYZ
/ENDIF 2
....
*-----------------------------------------------------------------
* /COPY file XYZ
*-----------------------------------------------------------------
/IF DEFINED(XYZ_COPIED) 3
/EOF
/ELSE
/DEFINE XYZ_COPIED
D .....
/ENDIF
The first time this /COPY member is read, XYZ_COPIED will not be defined, so the /EOF will not be considered.
The second time this member is read, XYZ_COPIED is defined, so the /EOF is processed. The /IF DEFINED(XYZ_COPIED) ( 3 ) is considered ended, and the file is closed. However, the /IF DEFINED(READ_XYZ) ( 1 ) from the main source member is still active until its own /ENDIF ( 2 ) is reached.