‎2008 Sep 04 12:19 PM
HI All,
am reading data from the unix directory using open data set stmt.
sample code :
OPEN DATASET ws_unix_dir_and_filename FOR INPUT IN LEGACY TEXT MODE.
IF sy-subrc EQ 0.
CLOSE DATASET ws_unix_dir_and_filename.
ELSE.
WITH 'File: ' ws_unix_dir_and_filename ' not found!'
RAISING inv_input_parameters.
the above code was excuted in background mode , so job failed with retun code 2, this is happening some times only.
my question is when the above code failes with retun code 2.
regards,
DSK
‎2008 Sep 04 12:28 PM
Hi,
When the specified file is not found the return code will be 2.
However to rectify the eroor message try like this.
OPEN DATASET ws_unix_dir_and_filename FOR INPUT
IN TEXT MODE
ENCODING DEFAULT.
IF sy-subrc EQ 0.
CLOSE DATASET ws_unix_dir_and_filename.
ELSE.
Regards,
Rama.