User's Guide

FINDFILES

Find file names

Function:

Find specified file names and return them in a named parameter.

Parameters:

INFILE(--)
Input file. A cataloged file name or list of names, optionally including wild card characters or an alias name. A LAS name, not a host name is to be specified.

NFILES
Number of files. The number of file names returned in OUTFILES is returned in the specified named parameter.

OUTFILES
Output files. The names of the files that matched the INFILE specification are returned in the specified named parameter.

FIRST(1)
First file number. Causes the function to skip over a specified number of file names when returning them to OUTFILES.

OUTFLG(YES)
Output flag. Flag to determine if the files that have matched should be returned in OUTFILES. The number of files matched will always be returned in NFILES.

  = YES:  Return the matched filenames in OUTFILES.
  = NO :  Don't return the matched filenames in OUTFILES.

MAXFILES(100)
Maximum number of files. The maximum number of file names to be returned.

LOCKFLG(YES)
Check lock flag. Flag to determine if files that are locked should be returned in OUTFILES.

  = YES:  Check if files are locked; don't return
	  the files that are locked.
  = NO :  Don't check if the files are locked;
       	  return both locked and unlocked files.

Examples:

  1. LAS> findfiles infile=fac*;* nfiles=fcount outfiles=flist maxfiles=1 lockflg=no

    All files beginning with "FAC" will be located in the current directory. A maximum of one file name will be retrieved. The number of files found (zero or one) will be returned in FCOUNT, and the complete file name, if a file is found, will be returned in FLIST. Checking will not be performed to determine if the file is locked or not, but will be returned in either case (LOCKFLG has been set to NO).

  2. LAS> findfiles nfiles=fcount outfiles=flist

    The names of all files present in the current working directory (up to 100) will be returned in FLIST, and the number of these images will be returned in FCOUNT. Since LOCKFLG has been left to default to YES, only those files that are unlocked will be returned.

  3. LAS> findfiles infile= *;img nfiles=fcount outfiles=flist first=11 maxfiles=10

    FINDFILES will build a list of all files in the current directory that match the specification "*;img" and then place up to ten of them into NFILES, starting at the eleventh filename found.

  4. LAS> findfiles infile=[images]a*;arch nfiles=fcount outfiles=flist

    FLIST will be filled with the names of all files in the [images] directory (up to 100) that begin with "A" and have an extension of ";ARCH". The number of files that match this specification is returned in FCOUNT. Since LOCKFLG has been left to default to YES, only those files that are unlocked will be returned.

  5. LAS> findfiles infile=[images]a*;arch nfiles=fcount outfiles=flist outflg=no

    The names of all files in the [images] directory (up to 100) that begin with "A" and have an extension of ";ARCH" are matched, but will not be returned in FLIST (OUTFLG is NO). The number of files that match this specification is returned in FCOUNT. Since LOCKFLG has been left to default to YES, only those files that are unlocked will be matched.

Description/Algorithm:

All specified files in the given directory are found. The number of files and names of the files are returned in TAE named variables. These file names can then be passed to other programs.

Nonfatal Error Message:

    None.

Fatal Error Message:

  1. [findfiles-fatal] Fatal error encountered

    The error message that is displayed immediately preceding this message is the specific error that was encountered. Processing is terminated.

  2. [findfiles-pass] Unable to pass variables to TAE parameter block

    The function was unable to update the TAE parameter block with the appropriate information. Contact the LAS system administrator.

  3. [findfiles-size] Parameter block too large to send to TAE monitor

    The information that is being returned by FINDFILES is too large to be returned to TAE. Contact the LAS system administrator.

User Notes:

  1. Since FINDFILES returns values in TAE variables, it is usually called from a procedure PDF.