! Created by R.J. FitzPatrick   5-Aug-1980 via RED.
!
Determines if a named file exists, without cluttering up SYS$OUTPUT
with diagnostic messages, leaving $STATUS and $SEVERITY in a small set of
known states. Validate is a "foreign" command, so you must define it as
a symbol, viz.:
     $VAL:==$SYS$UTIL:VALIDATE.EXE   or   $VL:== $SYS$UTIL:VALIDATE.EXE/LOG

Format
      VAL file-spec

Result
      o If file-spec exists, $STATUS = $SEVERITY = 1.
      o If file-spec does not exist, but the command was well formatted,
        then $SEVERITY = 3 (informational) and $STATUS reflects the reason
        the file was not found.
      o For an error in the command or parameter, a diagnostic message is
        always issued, and $SEVERITY = 2 (warning).
*Exit_status
 For successfull completion of VALIDATE, $STATUS may take
 the following (hexidecimal) values:
  00001 -           normal (file found)
  18293 - RMS-I-FNF file not found
  18273 - RMS-I-DNR device not ready
  1C04B - RMS-I-DNF directory not found

 If the command fails, $STATUS may take on values indicating such CLI
 errors as Invalid-Keyword or such RMS errors as Invalid-Directory-Syntax.
*Uses

 To delete a file, without messages if it doesn't exist:
  $VAL FILE.BAD
  $IF '$SEVERITY .EQ. 1 THEN DELETE FILE.BAD;*

 To run a commnand procedure which makes a file, but only if the file
 does not already exist:
  $VAL NEEDED.DAT
  $IF '$SEVERITY .EQ. 3 THEN @MAKEFIL
*Parameters
file-spec
 A legal file specification without any wild cards (*).  Defaults are
 supplied by either (a) the current default device/directory or
 (b) the /DEFAULT qualifier.
*Qualifiers
/LOG[=option]
/NOLOG (D)
 Option
  SUCCESS - LOG message only if file found
  FAILURE - LOG message only if file not found
  ALL (D) - LOG message for SUCCESS or FAILURE

 Controls whether VALIDATE writes to SYS$OUTPUT:
  for SUCCESS the full file-spec of the file found, or
  for FAILURE as much of the file spec as can be constructed and the
  reason the file was not found.
/BRIEF
/NOBRIEF (D)
 Controls whether the file-spec written by /LOG is preceeded by
 a prefix such as  " File found: "

 The BRIEF version of the output is usefull if it is to be read by a
 program (or the DCL command READ).

 Specifying /BRIEF does not turn on /LOG.

 /BRIEF does not apply if $SEVERITY = WARN
/DEFAULT=pseudo-file-spec
 Any non-null fields are used to supply defaults if the parameter has
 null fields.  This is most usefull if the VALIDATE command is embedded in
 a command file, one of whose parameters is the parameter for VALIDATE.
 Example:   VAL/DEF=.DAT 'P1
