![]() | ![]() | ![]() | ![]() |
In SAS 9.2, the FINFO function (in conjunction with the FOPEN and FCLOSE functions) retrieves system information from a file. You provide the file ID (that is assigned when the file is opened with the FOPEN function) and the name of the file information item that you want to retrieve, as shown in the following syntax:
FINFO(file-id,info-item)
The available information items (or, attributes) depend on the operating environment and the SAS release. If you do not know the available attributes, you can use the FOPTNUM and FOPTNAME functions to identify those attributes for use with the FINFO function.
The following example uses all five functions (FOPEN, FOPTNUM, FOPTNAME, FINFO, and FCLOSE) to retrieve available attributes and their values. Of course, you can simplify the program if you already know which attributes (for example, File Size(bytes) or Last Modified) that you want to retrieve.
In a Windows operating environment, the output appears as follows:
infoname infoval Filename c:\temp\mon3.dat RECFM V LRECL 256 File Size (bytes) 332 Last Modified 05May2009:10:44:23 Create Time 04May2009:17:04:22
Output from same program run in SAS® 9.1.3 (fewer attributes are available – not very useful):
infoname infoval File Name c:\temp\mon3.dat RECFM V LRECL 256
Product Family | Product | System | Product Release | SAS Release | ||
Reported | Fixed* | Reported | Fixed* | |||
SAS System | Base SAS | Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.21 | 9.2 TS2M3 | ||
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.21 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.21 | 9.2 TS2M3 | ||||
Microsoft Windows XP 64-bit Edition | 9.21 | 9.2 TS2M3 | ||||
Microsoft® Windows® for x64 | 9.21 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Datacenter Edition | 9.21 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Enterprise Edition | 9.21 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Standard Edition | 9.21 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2008 | 9.21 | 9.2 TS2M3 | ||||
Microsoft Windows XP Professional | 9.21 | 9.2 TS2M3 | ||||
Windows 7 Enterprise 32 bit | 9.21 | 9.2 TS2M3 | ||||
Windows 7 Enterprise x64 | 9.21 | 9.2 TS2M3 | ||||
Windows 7 Home Premium 32 bit | 9.21 | 9.2 TS2M3 | ||||
Windows 7 Home Premium x64 | 9.21 | 9.2 TS2M3 | ||||
Windows 7 Professional 32 bit | 9.21 | 9.2 TS2M3 | ||||
Windows 7 Professional x64 | 9.21 | 9.2 TS2M3 | ||||
Windows 7 Ultimate 32 bit | 9.21 | 9.2 TS2M3 | ||||
Windows 7 Ultimate x64 | 9.21 | 9.2 TS2M3 | ||||
Windows Vista | 9.21 | 9.2 TS2M3 |