Previous Page | Next Page

SAS Component Language Dictionary

FINFO



Returns a file information item
Category: External File

Syntax
Details
Example
See Also

Syntax

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


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

DINFO

FOPEN

FOPTNAME

FOPTNUM

Previous Page | Next Page | Top of Page