![]() Chapter Contents |
![]() Previous |
![]() Next |
| FOPTNAME |
| Category: | External Files |
| Syntax | |
| Arguments | |
| Details | |
| Examples | |
| Example 1: Retrieving File Information Items and Writing Them to the Log | |
| Example 2: Creating a Data Set with Names and Values of File Attributes | |
| See Also | |
Syntax |
| FOPTNAME(file-id,nval) |
| Details |
FOPTNAME returns a blank if an error occurred.
Operating Environment Information: The number, value, and type of information items that are available depend
on the operating environment.
| Examples |
This example retrieves the system-dependent file information items that are available and writes them to the log:
%let filrf=myfile; %let rc=%sysfunc(filename(filrf, physical-filename)); %let fid=%sysfunc(fopen(&filrf)); %let infonum=%sysfunc(foptnum(&fid)); %do j=1 %to &infonum; %let name=%sysfunc(foptname(&fid,&j)); %let value=%sysfunc(finfo(&fid,&name)); %put File attribute &name equals &value; %end; %let rc=%sysfunc(fclose(&fid)); %let rc=%sysfunc(filename(filrf));
This example creates a data set that contains the name and value of the available file attributes:
data fileatt;
length name $ 20 value $ 40;
drop rc fid j infonum;
rc=filename("myfile","physical-filename");
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;
output;
end;
rc=filename("myfile");
run;
| See Also |
| Functions:
|
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.