Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FNAME = '/tmp/myfile'. --what?

Former Member
0 Kudos

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].

1 REPLY 1

Former Member
0 Kudos

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.