How to check the external files?


I wonder if there is a way to check if an external file such as workfile, images, xml,…exist, before accessing them.

I don’t know if there are APIs or User Exits for it.


Is this question related to Mainframe or OpenSystems Natural ?

Hi Wolfgang,

This is open system question - (Linux/Unix) envrionment, but if you have solution for both - MF and OS - I would be so glad to hear both.


Use SYSEXT and check out the APIs under keyword WORKFILE.

Or use USR1052N (also in library SYSEXT) to check file existence with ‘ls’ commands or the like.