cancel
Showing results for 
Search instead for 
Did you mean: 

Background job gives dump with 'DATASET_NOT_OPEN' whether through SE38 program executed smoothly

Former Member
0 Kudos

Hi

I have also scheduled a background job. Through SE38 the program runs easily and save output to our ZTABLE. Problem is that when we scheduled this program in background. I have paste my code snippets and also the cases which I try before posting of my question.

Point1 :

OPEN DATASET file FOR INPUT IN BINARY MODE.

(i ahve also tried it by using OPEN DATASET FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT)

IF sy-subrc = 0.

       DO.

         READ DATASET file INTO l_line.

         IF sy-subrc <> 0.

           EXIT.

         ELSE.

           ********store lines in an internal table.

         ENDIF.

       ENDDO.

ENDIF.

CLOSE DATASET file.

Point2 : When I execute the program through SE38 then 'open dataset' gives sy-subrc = 0 and also read dataset gives sy-subrc = 0.

Our file which i accessed though open dataset, put at server (dir_home). I have full authorization on that directory and its folders and sub folders.

Point3: As the program executed through se38 so i think its not abap syntactical program. DIR_HOME is based on UNIX which I executed from R/3.

Point4: After scheduling the job, our program executed successfully once and after that its give dump.

**my question is that, is it possible if the program executed normally ( through SE38) then is there any disruption occurred during background scheduling.

Please tell me the logic behalf of your answer.

Regards

Swati

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184681
Active Contributor
0 Kudos

Hi Swati,

The OPEN DATASET statement checks the authorization of the executing user. Most probably, when executing the program in dialog you are using your own user that does have authorization, and the scheduled background job is executed on a different user that does not have the required authorization. You can try scheduling this background job on your username to confirm that:

Regards,

Greg

Former Member
0 Kudos

Dear Greg

I have executed the program though se38 and executing though scheduling background job using  same username. So its not the case of 'lack of authorization'.

Regards

Swati

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

just open it as I've described

Regards,

Michal Krawczyk

Former Member
0 Kudos

Dear Michal

You advised OPEN DATASET filename but 'FOR INPUT' addition is was expected. If I open dataset other than this addition, program gives syntax error.

Regards

Swati

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

for input is not mandatory

check this code sample for reading a server file without for input

http://help.sap.com/saphelp_45b/helpdata/en/34/55cad198482bc0e10000009b38f91f/content.htm

Regards,

Michal Krawczyk

Former Member
0 Kudos

Dear MIchal

Please consider the below mentioned screen shot.

Regards

Swati

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

why do you open is for input if you only read from it ?

just open it without the "for input" and try again

Regards,

Michal Krawczyk