VMS Help  —  ASSIGN  Examples
    1.$ ASSIGN $DISK1:[CREMERS.MEMOS] MEMOSD

      The ASSIGN command in this example equates the partial file
      specification $DISK1:[CREMERS.MEMOS] to the logical name
      MEMOSD.

    2.$ ASSIGN/USER_MODE $DISK1:[FODDY.MEMOS]WATER.TXT TM1

      The ASSIGN command in this example equates the logical name TM1
      to a file specification. After the next image runs, the logical
      name is deassigned automatically.

    3.$ ASSIGN XXX1:[HEROLD]  ED
      $ PRINT  ED:TEST.DAT
      Job 274 entered on queue SYS$PRINT

      The ASSIGN command in this example associates the logical
      name ED with the directory name [HEROLD] on the disk XXX1.
      Subsequent references to the logical name ED result in the
      correspondence between the logical name ED and the disk and
      directory specified. The PRINT command queues a copy of the
      file XXX1:[HEROLD]TEST.DAT to the system printer.

    4.$ ASSIGN YYY2:  TEMP:
      $ SHOW LOGICAL TEMP
         "TEMP" = "YYY2:" (LNM$PROCESS_TABLE)
      $ DEASSIGN TEMP

      The ASSIGN command in this example equates the logical name
      TEMP to the device YYY2. TEMP is created in supervisor mode
      and placed in the process logical name table. The SHOW LOGICAL
      command verifies that the logical name assignment was made.
      Note that the logical name TEMP was terminated with a colon in
      the ASSIGN command, but that the command interpreter deleted
      the colon before placing the name in the logical name table.
      Thus, you can specify TEMP without a colon in the subsequent
      DEASSIGN command. You should omit the colon in the SHOW LOGICAL
      command (for example, SHOW LOGICAL TEMP).

    5.$ MOUNT TTT1: MASTER TAPE
      $ ASSIGN TAPE:NAMES.DAT PAYROLL
      $ RUN PAYROLL
         .
         .
         .

      The MOUNT command in this example establishes the logical name
      TAPE for the device TTT1, which has the volume labeled MASTER
      mounted on it. The ASSIGN command equates the logical name
      PAYROLL with the file named NAMES.DAT on the logical device
      TAPE. Thus, an OPEN request in a program referring to the
      logical name PAYROLL results in the correspondence between
      the logical name PAYROLL and the file NAMES.DAT on the tape
      whose volume label is MASTER.

    6.$ CREATE/NAME_TABLE TABLE1
      $ ASSIGN/TABLE=LNM$PROCESS_DIRECTORY TABLE1,-
      _$ LNM$PROCESS,LNM$JOB,LNM$GROUP,LNM$SYSTEM LNM$FILE_DEV
      $ ASSIGN/TABLE=TABLE1 -
      _$ /TRANSLATION_ATTRIBUTES=CONCEALED  DKA1:  WORK_DISK

      The CREATE/NAME_TABLE command in this example creates the
      process private logical name table TABLE1.

      The first ASSIGN command ensures that TABLE1 is searched
      first in any logical name translation of a file specification
      or device name (because TABLE1 is the first item in the
      equivalence string for the logical name LNM$FILE_DEV, which
      determines the default search sequence of logical name tables
      whenever a device or file specification is translated).

      The second ASSIGN command assigns the logical name WORK_DISK
      to the physical device DKA1, and places the name in TABLE1.
      The logical name has the concealed attribute. Therefore, the
      logical name WORK_DISK will be displayed in system messages.

    7.$ ASSIGN/TABLE=LNM$PROCESS/TABLE=LNM$GROUP  DKA0:  SYSFILES
      $ SHOW LOGICAL  SYSFILES
        "SYSFILES" = "DKA0:" (LNM$GROUP_000240)

      The ASSIGN command in this example contains conflicting
      qualifiers. When you specify conflicting qualifiers, the ASSIGN
      command uses the last qualifier specified. The response from
      the SHOW LOGICAL command indicates that the name was placed in
      the group logical name table.

    8.$ ASSIGN/TABLE=LNM$GROUP 'F$TRNLNM("SYS$COMMAND")' TERMINAL
      %DCL-I-SUPERSEDE, previous value of TERMINAL has been superseded

      The ASSIGN command in this example uses the lexical function
      F$TRNLNM to translate the logical name SYS$COMMAND and use the
      result as the equivalence name for the logical name TERMINAL.
      The message from the ASSIGN command indicates that an entry for
      the logical name TERMINAL already existed in the group logical
      name table, and that the new entry has replaced the previous
      one.

      If this command is used in a LOGIN.COM file, the entry for
      TERMINAL will be redefined at the beginning of each terminal
      session. The current process and any subprocesses it creates
      can execute images that use the logical name TERMINAL to write
      messages to the current terminal device.

    9.$ ASSIGN DALLAS::DMA1:  DATA

      The ASSIGN command in this example associates the logical
      name DATA with the device specification DMA1 on remote node
      DALLAS. Subsequent references to the logical name DATA result
      in references to the disk on the remote node.

    10$ CREATE AVERAGE.COM
      $ ASSIGN/USER_MODE SYS$COMMAND:  SYS$INPUT
      $ EDIT/EDT AVERAGE.FOR
      $ FORTRAN AVERAGE
      $ LINK AVERAGE
      $ RUN AVERAGE
      87
      80
      90
      9999
      $ EXIT
 <Ctrl/Z>

      $ @AVERAGE.COM

      The CREATE command in this example creates the command
      procedure AVERAGE.COM. Then the command procedure is executed.

      The command procedure uses the ASSIGN command with the /USER_
      MODE qualifier to change temporarily the value of SYS$INPUT.
      When the EDT editor is invoked, it accepts input from the
      terminal. This allows you to create or modify the program
      AVERAGE.FOR interactively.

      When you exit from EDT, SYS$INPUT is reassigned to its original
      value (the input stream provided by the command procedure).
      Thus, when the program AVERAGE.FOR is ready to accept input, it
      looks for that input in the command procedure.
Close Help