SAS Component Language Dictionary |
Returns a file information item
item-value=FINFO(file-id,info-item);
|
-
item-value
-
contains the value of the file parameter,
or a blank if info-item is invalid.
Type: Character
-
file-id
-
is the identifier that was assigned when
the file was opened. If file-id is invalid, the
program halts.
Type: Numeric
-
info-item
-
specifies which file information item to
retrieve.
Type: Character
FINFO returns the value of a system-dependent
information item for an external file. The information that is available
for files depends on the operating system.
FOPTNUM determines how many system-dependent information
items are available. FOPTNAME determines the names of the available items.
Assign the fileref MYFILE to an external file. Then
open the file and determine whether LRECL (logical record length, an attribute
used on some host systems) is one of the available information items. If
the value of the variable CHARVAL is nonblank, then a value for LRECL is displayed
to the user.
rc=filename('myfile',fname);
fid=fopen('myfile');
charval=finfo(fid,'lrecl');
if (charval=' ') then
_msg_= 'The LRECL attribute is not available.';
else
_msg_= 'The LRECL for the file is ' || charval || '.';
rc=fclose(fid);
rc=filename('myfile','');
DINFO
FOPEN
FOPTNAME
FOPTNUM
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.