‎2006 Oct 20 7:23 AM
Hi all,
Can anyone tell me that will open dataset give an error, if the file which i am opening is not downloaded fully in my application server.
The file which i will be accessing using open dataset, read dataset and close dataset will be loaded in my application server.
Regards,
Neo.
‎2006 Oct 20 7:25 AM
Hey it depends in what mode you are trying to open the file.
If you are not opening in read mode, may be it will throw an error.
regards,
Sandeep Josyula
reward if useful
‎2006 Oct 20 7:26 AM
Hi,
use an "end-record" at the end of your processing.
(transfer 'EOF' to file. )
so it can be checked,whether your file is complete,
when opening your file
Anderas
Message was edited by: Andreas Mann
‎2006 Oct 20 7:26 AM
Hi,
The open dataset will not give error if the file is not downloaded completely. It will give error if the file you are trying to read does not exists or the path where you are trying to write is incorrect and also if you donot have file permissions on the server.
Hope ths helps.
‎2006 Oct 20 7:27 AM
Open data set will returns SY-SUBRC value. If it is other than ZERO, some error has occured.Pls try to findout the meaning for different SY-SUBRC values so that u can capture the type of error
‎2006 Oct 20 7:27 AM
From your question I understand that the file is being written on the application server while you are trying to open. In case that file is already open, then when you try to open, it will set SY-SUBRC to a nonzero value, which is an error. .
Let me know if you have any further queries.
Don't forget to mark helpful answers!
Gaurav Parmar.
‎2006 Oct 31 12:33 PM
From your explanation what i can understand is that i dont have to specifically check for the downloading of the file to be complete on the application server.
As if it is being downloaded and while downloading i try to open it with open dataset the sy-subrc will be non-zero.
Regards,
Altaf Shaikh.
‎2006 Oct 20 7:31 AM
Further, read below:
OPEN DATASET <dsn> FOR OUTPUT.
If the file does not already exist, it is created automatically. If it does already exist, but is closed, its contents are overwritten. If the file exists and is already open (for read or write access, or for appending), the position is reset to the beginning of the file. If the system can open the file <dsn> successfully, SY-SUBRC is set to 0. If not, it is set to 8.
OPEN DATASET <dsn> FOR INPUT.
The file must already exist, otherwise, the system sets SY-SUBRC to 8, and ignores the statement.
If the file exists and is already open (for read or write access, or for appending), the position is reset to the beginning of the file. However, it is good programming style to close files that are already open before you reopen them for a different operation
Hope that helps you. Let me know if you have any further queries.
Don't forget to mark helpful answers!
Gaurav Parmar.