SAS Component Language Dictionary |
Returns the name of an item of information for a file
item-name=FOPTNAME(file-id,item-num);
|
-
item-name
-
contains the name of the information item,
or a blank if an error occurred.
Type: Character
-
file-id
-
contains the identifier that was assigned
when the file was opened. If file-id is invalid,
the program halts.
Type: Numeric
-
item-num
-
is the number of the information item.
Type: Numeric
The number, value, and type of available information
items depend on the operating system.
Retrieve the system-dependent file information items
and write them to the log:
length name $ 8;
rc=filename('myfile',fname);
fid=fopen('myfile');
infonum=foptnum(fid);
do j=1 to infonum;
name=foptname(fid,j);
value=finfo(fid,name);
put 'File attribute' name 'has a value of' value;
end;
rc=fclose(fid);
rc=filename('myfile','');
The example produces the following output:
File attribute LRECL has a value of 256.
DINFO
DOPTNAME
DOPTNUM
FINFO
FOPEN
FOPTNUM
MOPEN
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.