12-30-2007 6:12 AM
DATA FNAME(60).
FNAME = '/tmp/myfile'.
1] OPEN DATASET 'myfile'.
2] OPEN DATASET FNAME
DATA FNAME(60) VALUE myfile .
3] OPEN DATASET FNAME.
What is the difference among statements [1],[2],[3].
12-30-2007 9:26 AM
1] OPEN DATASET '\tmp\myfile'.
This statement tells to open the file(myfile) from the application server. Here myfile is a string constant.
This statement opens only file called "myfile".
2] OPEN DATASET FNAME
This statement tells to open the file which is stored that filename in variable called FNAME.
Here this variable must be declared before using this statement.
So You must have these following statements before this is used:
DATA FNAME(60).
FNAME = '/tmp/myfile'.
Now:
OPEN DATASET FNAME
Note: You do not need any other declarations for (1), because you are specifying directly the filename.