Im ILERPG heißt das
READE(E) ...
if %eof();
endif;
if %error();
endif;

Alternativ kann man das auch in eine MONITOR-Gruppe packen.