Probably your best bet would be to do a SYSDSN before the EXECIO. If you try trapping the ALLOC return code, you will usually get a 0 as this can be created or read.
However, you could do something like;
Mem = 'MY.DATA.SET(MYMEM)'
If SysDsn("'"Mem"') = 'OK' then do
"Alloc Fi(IN) Da('"Mem"') Shr Reu"
"Execio * DiskR IN (Stem IN. Finis)"
"Free Fi(IN)"
end
else say 'Member 'Mem' does not exist'