Make it a habit to always "clean up" after your code. So if you use FOPEN, also use FCLOSE if FOPEN returned a non-zero value.
Particularly when using FOPEN in macro code, the file handles will pile up, and with a large number of files you can easily exceed the OS limit for open handles per process.
When using FOPEN in a DATA step, the handles will be automatically closed when the step terminates, but you might still run out of resources within the step.
The same is true, of course, for OPEN and DOPEN, and other similar stuff.
... View more