SAS Component Language Dictionary |
Category: | External File |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
item-value=FINFO(file-id,info-item); |
contains the value of the file parameter, or a blank if info-item is invalid.
is the identifier that was assigned when the file was opened. If file-id is invalid, the program halts.
Details |
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.
Example |
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','');
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.