Chapter Contents |
Previous |
Next |
FINDFILE |
Language element: | function |
Category: | general-purpose OpenVMS |
OpenVMS specifics: | All aspects are host-specific |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
FINDFILE(file-specification,context) |
Details |
The FINDFILE function searches all directories and subdirectories for file-specification and returns the first filename that matches the file specification given. Subsequent calls return other filenames that match the specification. For more information, see the description of the CALL FINDEND routine in CALL FINDEND.
The return value is the name of the file that matches file-specification. If no file matches or if the last one in the list has already been returned, a blank is returned. The target variable must be long enough to contain an OpenVMS pathname, which can be up to 255 characters long. SAS character variables have a maximum length of 32767.
Example |
The following example uses the FINDFILE function:
context=0; fn=findfile('myprog*.sas',context); do while (fn ^= ' '); put fn; fn=findfile('myprog*.sas',context); end;
This example searches the user's directories for a filename
that matches MYPROG*.SAS; for example,
if it finds a file named MYPROG12.SAS, then
FN is set to
myprog12.sas
.
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.