If a file is open and you use the record.resourceAssociation variable to change the resource name that is associated with that file, EGL closes the file automatically before it runs the next statement that affects the file. For details, see resourceAssociation variable for file I/O.
When the program ends, EGL also closes all open files.

if (userRequest == "C")
try
close recordA;
onException(fileErr FileIOException)
myErrorHandler(fileErr);
end
end
| Platform | Issue |
|---|---|
| CICS® for z/OS® |
|
| IMS™ BMP or z/OS batch | EGL issues an OS CLOSE for the file. |