VMS Help  —  Lexicals  F$UNIQUE
    Valid on Alpha and Integrity server systems only.

    Generates a string that is suitable to be a file name and is
    guaranteed to be unique across the cluster. Unique file names can
    be useful when creating temporary files.  The string returned
    is alphanumeric and may be used as a file name, logical name,
    or DCL symbol name or value with no reserved character issues.

    The F$UNIQUE function has no arguments, but must be followed by a
    blank pair of parentheses.

    Format

      F$UNIQUE()

1  –  Return Value

    A character string containing the unique string.

2  –  Examples

    1.$ WRITE SYS$OUTPUT F$UNIQUE()
      414853555241159711D7DF797CCF573F
      $
      $ WRITE SYS$OUTPUT F$UNIQUE()
      414853555241509811D7DF797E3F2777
      $

      This example shows how a unique string is returned on
      subsequent WRITE commands.

    2.$ OPEN/WRITE TEMP_FILE 'F$UNIQUE()
      $ DIRECTORY

      Directory WORK1:[TEST]

      594B53554C421C9C11D75463D61F58B7.DAT;1

      Total of 1 file.
      $
      $ CLOSE/DISPOSITION=DELETE TEMP_FILE
      $ DIRECTORY
      %DIRECT-W-NOFILES, no files found
      $

      The first command creates a temporary file and gives it a
      unique name, which is displayed by the subsequent DIRECTORY
      command. After the file is later closed and deleted, it no
      longer shows up in the directory.
Close Help