Document revision date: 30 March 2001
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

OpenVMS DCL Dictionary


Previous Contents Index

This MOUNT command requests the operator to mount the volume TESTSYS on the device DYA1. Because DYA1 is allocated to another user, the device cannot be mounted. In this case, the user can wait for the device to become available, redirect the mount to another device, or abort the mount. Here, the user remains in operator-assisted mount waiting for the process that is using the device to deallocate it.

At this point, because the device is available but no volume is mounted, the original mount request is canceled, and a new request to mount TESTSYS is issued. Finally, the operator places the volume in the drive and lets MOUNT retry the mount. When the mount completes, the request is canceled.
#6

$ MOUNT DYA1:  TESTSYS/COMMENT="Is there an operator around?"
%MOUNT-I-OPRQST, Please mount volume TESTSYS in device _DYA1:
Is there an operator around?
%MOUNT-I-NOOPR, no operator available to service request
. 
. 
. 
%MOUNT-I-MOUNTED, TESTSYS    mounted on _DYA1:
%MOUNT-I-OPRQSTDON, operator request canceled - mount
completed successfully
      

This MOUNT command requests the operator to mount the volume TESTSYS on the device DYA1. In this example, no operator is available to service the request. At this point, the user can abort the mount by pressing Ctrl/Y, or wait for an operator. Here, the user waited, and an operator eventually became available to service the request.

#7

$ MOUNT/SYSTEM/MEDIA=CDROM $1$DKA1 USER
%MOUNT-I-CDROM_ISO, USER:VMS_ONLINE_DOCUMENTATION (1 of 4) , 
mounted on _$1$DKA1: (CDROM)
$ MOUNT/SYSTEM/MEDIA=CDROM $1$DKA2 PROGRAMMING_1
%MOUNT-I-CDROM_ISO, PROGRAMMING_1:VMS_ONLINE_DOCUMENTATION (2 of 4) , 
mounted on  _$1$DKA2: (CDROM)
$  MOUNT/SYSTEM/MEDIA=CDROM $1$DKA3 PROGRAMMING_2
%MOUNT-I-CDROM_ISO, PROGRAMMING_2:VMS_ONLINE_DOCUMENTATION (3 of 4) , 
mounted on  _$1$DKA3: (CDROM)
MOUNT/SYSTEM/MEDIA=CDROM $1$DKA4 MANAGEMENT
%MOUNT-I-CDROM_ISO, MANAGEMENT:VMS_ONLINE_DOCUMENTATION (4 of 4) , 
mounted on  _$1$DKA4: (CDROM)
 
      

These commands mount each member of a four-member ISO 9660 volume set whose volume-set name is VMS_ONLINE_DOCUMENTATION.

#8

$ MOUNT/SYSTEM/MEDIA=CDROM $1$DKA1,$1$DKA2,$1$DKA3,$1$DKA4 
USER,PROGRAMMING_1,PROGRAMMING_2,MANAGEMENT
%MOUNT-I-CDROM_ISO, USER:VMS_ONLINE_DOCUMENTATION (1 of 4) , mounted on 
_$1$DKA1: (CDROM)
%MOUNT-I-CDROM_ISO, PROGRAMMING_1:VMS_ONLINE_DOCUMENTATION (2 of 4) , 
mounted on  _$1$DKA2: (CDROM)
%MOUNT-I-CDROM_ISO, PROGRAMMING_2:VMS_ONLINE_DOCUMENTATION (3 of 4) , 
mounted on  _$1$DKA3: (CDROM)
%MOUNT-I-CDROM_ISO, MANAGEMENT:VMS_ONLINE_DOCUMENTATION (4 of 4) , 
mounted on  _$1$DKA4: (CDROM)
 
      

This command mounts four members of an ISO 9660 volume set whose volume set name is VMS_ONLINE_DOCUMENTATION.

#9

$ MOUNT/SYSTEM/SUBSYSTEM $8$DKA300: ATLANTIS_WORK1
%MOUNT-I-MOUNTED, ATLANTIS_WORK1 mounted on _$8$DKA300: (ATLANTIS)
$ SHOW DEVICE/FULL $8$DKA300:
 
 
 
 
Disk $8$DKA300: (ATLANTIS), device type RZ24, is online, mounted, 
 file-oriented device, shareable, served to cluster via MSCP Server, 
 error logging is enabled. 
 
Error count                   0   Operations completed                385 
 Owner process                ""   Owner UIC                      [SYSTEM] 
 Owner process ID       00000000   Dev Prot            S:RWPL,O:RWPL,G:R,W 
 Reference count               1   Default buffer size                 512 
 Total blocks             409792   Sectors per track                    38 
 Total cylinders            1348   Tracks per cylinder                   8 
 Allocation class              8 
 
 Volume label   "ATLANTIS_WORK1"   Relative volume number                0 
 Cluster size                  3   Transaction count                     1 
 Free blocks              396798   Maximum files allowed             51224 
 Extend quantity               5   Mount count                           1 
 Mount status             System   Cache name        "_$8$DKA700:XQPCACHE" 
 Extent cache size            64   Maximum blocks in extent cache    39679 
 File ID cache size           64   Blocks currently in extent cache      0 
 Quota cache size             50   Maximum buffers in FCP cache        295 
 Volume owner UIC    [VMS,PLATO]   Vol Prot    S:RWCD,O:RWCD,G:RWCD,W:RWCD 
 
 
Volume status: ODS-2, subject to mount verification, protected 
    subsystems enabled, file high-water marking, write-through caching enabled.
  
 
      

The MOUNT command mounts a volume labeled ATLANTIS_WORK1, which is available systemwide. Subsystems on the volume are accessible.

#10

$ MOUNT DSA0: /SHADOW=($200$DKA200:,$200$DKA300:,$200$DKA400:) X5OZCOPY
%MOUNT-I-MOUNTED, X5OZCOPY mounted on _DSA0: 
%MOUNT-I-SHDWMEMSUCC, _$200$DKA200: (VIPER1) is now a valid member of 
the shadow set 
%MOUNT-I-SHDWMEMSUCC, _$200$DKA300: (VIPER1) is now a valid member of 
the shadow set 
%MOUNT-I-SHDWMEMSUCC, _$200$DKA400: (VIPER1) is now a valid member of 
the shadow set
$ DISMOUNT DSA0:
$ MOUNT/INCLUDE DSA0: /SHADOW=$200$DKA200: X5OXCOPY
%MOUNT-I-MOUNTED, X5OZCOPY mounted on _DSA0: 
%MOUNT-I-SHDWMEMSUCC, _$200$DKA200: (VIPER1) is now a valid member of 
the shadow set 
%MOUNT-I-AUTOMEMSUCC, _$200$DKA300: (VIPER1) automatically added to the 
shadow set 
%MOUNT-I-AUTOMEMSUCC, _$200$DKA400: (VIPER1) automatically added to the 
shadow set
 
 
      

In this example, an existing shadow set is mounted in two ways. The first MOUNT command specifies each member of the shadow set with the /SHADOW qualifier. Then, after DSA0: is dismounted, the second MOUNT command uses the /INCLUDE qualifier to automatically mount all members of the shadow set.


NCS

Invokes the OpenVMS National Character Set (NCS) utility, which provides a convenient method of implementing alternative (non-ASCII) string collating sequences, typically using subsets of the DEC Multinational character set. NCS also facilitates the implementation of string conversion functions.

For more information about the NCS utility, refer to the OpenVMS National Character Set Utility Manual (available on the Documentation CD-ROM) or online help.


Format

NCS [filespec[,...]]


ON

Performs a specified action when a command or program executed within a command procedure encounters an error condition or is interrupted by Ctrl/Y. The specified actions are performed only if the command interpreter is enabled for error checking or Ctrl/Y interrupts (the default conditions). Use the ON command only in a command procedure.

Format

ON condition THEN [$] command


Parameters

condition

Specifies either the severity level of an error or a Ctrl/Y interrupt. Specify one of the following keywords, which may be abbreviated to one or more characters:
WARNING Return status of warning occurs ($SEVERITY equals 0).
ERROR Return status of error occurs ($SEVERITY equals 2).
SEVERE_ERROR Return status of error occurs ($SEVERITY equals 4).
CONTROL_Y Ctrl/Y character occurs on SYS$INPUT.

The default error condition is ON ERROR THEN EXIT.

command

Specifies the DCL command line to be executed. Optionally, you can precede the command line with a dollar sign ($).

If you specified an error condition as the condition parameter, the action is taken when errors equal to or greater than the specified level of error occur.


Description

During the execution of a command procedure, the command interpreter checks the condition code returned from each command or program that executes. With the ON command, you can establish a course of action for the command interpreter to take based on the result of the check.

The system places condition codes in the global symbol $STATUS. The severity of the condition code is represented in the first 3 low-order bits of $STATUS. This severity level is also represented by the global symbol $SEVERITY. See the description of the EXIT command for information on severity level values.

If an ON command action specifies the severity level of an error, the command interpreter executes the ON command action for errors at the specified severity level or greater. For example, the following command causes a procedure to exit on warnings, errors, or severe errors:

$ ON WARNING THEN EXIT

The default action is as follows:

$ ON ERROR THEN EXIT

That is, the command interpreter continues when a warning occurs, and executes an EXIT command when an error or severe error occurs. An ON command action that specifies a severity level is executed only once; after the ON command action is taken, the default ON action is reset. There is an exception to the default ON action. If you use the GOTO command and specify a label that does not exist in the current command procedure, the procedure issues a warning message and exits.

The action specified by an ON command applies only within the command procedure in which the command is executed; therefore, if you execute an ON command in a procedure that calls another procedure, the ON command action does not apply to the nested procedure. An ON command executed at any command procedure level does not affect the error condition handling of procedures at any other level.

To disable error checking with the ON command, use the SET NOON command. You can enable error checking with the SET ON command, or by entering another ON command.

The ON command also provides a way to define an action routine for a Ctrl/Y interrupt that occurs during execution of a command procedure. The default (Ctrl/Y) action is to prompt for command input at the Ctrl/Y command level. The Ctrl/Y command level is a special command level where you can enter DCL commands. If you enter a command that is executed within the command interpreter, you can resume execution of the procedure with the CONTINUE command. (For a list of commands that are executed within the command interpreter, refer to the OpenVMS User's Manual.)

If you enter any other DCL command, the command interpreter returns to command level 0 and executes the image invoked by the command. If you interrupt the command procedure while it is executing an image that contains an exit handler, the exit handler is allowed to execute before the new command (image) is executed. (However, if you enter the STOP command after you interrupt a command procedure by pressing Ctrl/Y, exit handlers declared by the interrupted image are not executed.)

You can use the ON command to change the default action for a Ctrl/Y interrupt. If you change the default Ctrl/Y action, the execution of a Ctrl/Y interrupt does not automatically reset the default Ctrl/Y action. A Ctrl/Y action remains in effect until one of the following occurs:

A Ctrl/Y action can be specified for each active command level; the Ctrl/Y action specified for the currently executing command level overrides actions specified for previous levels.

Note

The ON CONTROL_Y and SET NOCONTROL=Y commands are intended for special applications. Compaq does not recommend, in general, that you disable Ctrl/Y interrupts. For example, if a procedure that disables Ctrl/Y interrupts begins to loop uncontrollably, you cannot gain control to stop the procedure from your terminal.

Examples

#1

$ ON SEVERE_ERROR THEN CONTINUE 
      

A command procedure that contains this statement continues to execute normally when a warning or error occurs during execution. When a severe error occurs, the ON statement signals the procedure to execute the next statement anyway. Once the statement has been executed as a result of the severe error condition, the default action (ON ERROR THEN EXIT) is reinstated.

#2

$ ON ERROR THEN GOTO BYPASS 
$ RUN A 
$ RUN B 
   .
   .
   .
$ EXIT 
$ BYPASS: 
$      RUN C 
 
      

If either program A or program B returns a status code with a severity level of error or severe error, control is transferred to the statement labeled BYPASS and program C is run.

#3

$ ON WARNING THEN EXIT 
   .
   .
   .
$ SET NOON 
$ RUN [SSTEST]LIBRA 
$ SET ON 
   .
   .
   .
 
      

The ON command requests that the procedure exit when any warning, error, or severe error occurs. Later, the SET NOON command disables error checking before executing the RUN command. Regardless of any status code returned by the program LIBRA.EXE, the procedure continues. The next command, SET ON, reenables error checking and reestablishes the most recent ON condition.

#4

$ ON CONTROL_Y THEN GOTO CTRL_EXIT 
   .
   .
   .
$ CTRL_EXIT: 
$ CLOSE INFILE 
$ CLOSE OUTFILE 
$ EXIT 
 
      

The ON command specifies action to be taken when Ctrl/Y is pressed during the execution of this procedure: the GOTO command transfers control to the line labeled CTRL_EXIT. At CTRL_EXIT, the procedure performs cleanup operations (in this example, closing files and exiting).


OPEN

Opens a file for reading, writing, or both; assigns a logical name to a file; and places the name in the process logical name table.

See the qualifier descriptions for restrictions.


Format

OPEN logical-name[:] filespec


Parameters

logical-name[:]

Specifies the logical name and a character string to be assigned to the file.

filespec

Specifies the name of the file or device being opened for input or output. The file type defaults to DAT. The asterisk (*) and the percent sign (%) wildcard characters are not allowed.

To create a new, sequential file, specify the /WRITE qualifier. See the description of the /WRITE qualifier for more information.


Description

A file can be opened for either reading or writing, or for both reading and writing. After the file is opened, it is available for input or output at the command level with the READ and WRITE commands.

The OPEN command opens files as process permanent. Therefore, these files remain open until you close them with the CLOSE command, or until you log out. If a command procedure that opens a file terminates without closing an open file, the file remains open; the command interpreter does not automatically close it. The OPEN command uses OpenVMS RMS to open files, and is subject to RMS restrictions on using process-permanent files. The OPEN command opens sequential, relative, or indexed sequential files.

The logical devices SYS$INPUT, SYS$OUTPUT, SYS$COMMAND, and SYS$ERROR do not have to be opened explicitly before they can be read or written at the command level. All other files must be opened explicitly.

Do not use the same logical name when you open different files. If you specify a logical name with the OPEN command and the logical name is currently assigned to another file, no warning message is issued; however, the file is not opened, and the next READ request will access the file to which the logical name was originally assigned.

You can enter more than one OPEN command for the same file and assign it different logical names if you use the /SHARE qualifier the first time the file is opened. Also, if you open the file by using the /SHARE=READ or the /SHARE=WRITE qualifier, other users can access the file with the TYPE or the SEARCH command.

When you use the OPEN command to create a new file, variable fixed control (VFC) record format is used. Concatenating a file of this record format with a file of another record format might be impossible due to record format incompatibilities. To avoid the VFC format, use the CREATE command to create the file.

When the OPEN command is specified on an existing file, the record type of that file is used.


Qualifiers

/APPEND

Opens an existing file for writing and positions the record pointer at the end-of-file (EOF). New records are added to the end of the file.

Only sequential files allow more than one user to append records concurrently.

Use the /APPEND qualifier only to add records to an existing file. The /APPEND and the /WRITE qualifiers are mutually exclusive.

/ERROR=label

Transfers control to the location specified by the label keyword (in a command procedure) if the open operation results in an error. The error routine specified for this qualifier overrides any ON condition action specified. If the /ERROR qualifier is not specified, the current ON condition action is taken.

If an error occurs and the target label is successfully given control, the global symbol $STATUS retains the code for the error that caused the error path to be taken.

/READ (default)

Opens the file for reading. If you specify the /READ qualifier without the /WRITE qualifier, you must specify an existing file.

/SHARE[=option]

Opens the specified file as a shareable file to allow other users read or write access. If you specify the /SHARE=READ qualifier, other users are allowed read (R) access to the file, but not write (W) access. If you specify the /SHARE=WRITE or the /SHARE qualifier with no option, users are allowed read and write access to the specified file.

If the /SHARE qualifier is not present, other users are allowed only read access to the specified file.

/WRITE

Opens the file for writing. The following restrictions apply to the /WRITE qualifier:

Examples

#1

$ OPEN INPUT_FILE AVERAGE.DAT 
$ READ_LOOP: 
$ READ/END_OF_FILE=ENDIT  INPUT_FILE  NUM 
   .
   .
   .
$ GOTO READ_LOOP 
$ ENDIT: 
$ CLOSE INPUT_FILE 
      

The OPEN command opens the file named AVERAGE.DAT as an input file and assigns it the logical name INPUT_FILE. The file is opened with read access because the /READ qualifier is present by default. The READ command reads a record from the logical file INPUT_FILE into the symbol named NUM. The procedure executes the lines between the labels READ_LOOP and ENDIT until the end of the file is reached. At the end of the file, the CLOSE command closes the file.

#2

$ OPEN/WRITE/ERROR=OPEN_ERROR  OUTPUT_FILE  TEMP.OUT 
$ COUNT = 0 
$ WRITE_LOOP: 
$ COUNT = COUNT + 1 
$ IF COUNT .EQ. 11 THEN GOTO ENDIT 
$ WRITE OUTPUT_FILE "Count is ''COUNT'." 
   .
   .
   .
$ GOTO WRITE_LOOP 
$ ENDIT: 
$ CLOSE OUTPUT_FILE 
$ EXIT 
$ 
$ OPEN_ERROR: 
$ WRITE SYS$OUTPUT "Cannot open file TEMP.OUT" 
$ EXIT 
      

The OPEN command with the /WRITE qualifier creates the file TEMP.OUT and assigns it the logical name OUTPUT_FILE. TEMP.OUT is a sequential file.

The /ERROR qualifier specifies that if any error occurs while opening the file, the command interpreter should transfer control to the line at the label OPEN_ERROR. The command procedure writes records to the file TEMP.OUT until the symbol COUNT equals 11.

#3

$ OPEN/READ INPUT_FILE TRNTO::DKA0:[COST]INVENTORY.DAT 
$ READ_LOOP: 
$ READ/END_OF_FILE=ENDIT  INPUT_FILE  NUM 
$ FIRST_CHAR = F$EXTRACT(0,1,NUM) 
$ WRITE SYS$OUTPUT FIRST_CHAR 
$ GOTO READ_LOOP 
$ ENDIT: 
$ CLOSE INPUT_FILE 
      

This command procedure opens the file INVENTORY.DAT located at remote node TRNTO as an input file, and assigns it the logical name INPUT_FILE. The READ command reads a record from the logical file INPUT_FILE into the symbol named NUM. The next two commands extract the first character from the record and write the character to the SYS$OUTPUT device. These two steps occur for all records in the file until the procedure reaches the end-of-file (EOF). At this point, the CLOSE command closes the file and deassigns the logical name INPUT_FILE.


PASSWORD

Provides the password associated with the user name that you specify with the JOB card when you submit a batch job through a card reader. Although the PASSWORD card is required, the password on the card is optional if the account has a null password.

The PASSWORD command is valid only in a batch job submitted through a card reader and requires that a dollar sign ($) precede the PASSWORD command on the card.


Format

PASSWORD [password]

Note

To change your password, use the SET PASSWORD command. For information on this command, see the description of SET PASSWORD.

Parameter

password

Specifies the password associated with the user name specified with the JOB command. The password can be 1 to 31 characters long.

If you are submitting the job from an account with a null password, omit the password specifier on the PASSWORD card.


Description

The PASSWORD command is used in conjunction with the JOB command. The JOB card identifies the user submitting the batch job through a card reader and is followed by a PASSWORD card giving the password. The password is checked by the system to verify that it matches the password associated with the user name on the JOB card. If the passwords do not match, the job is rejected.

Note that you might want to suppress printing when you originally keypunch the PASSWORD card to prohibit other users from seeing the password when the PASSWORD card is in use.


Example


      


The JOB and PASSWORD commands precede a batch job submitted from the card reader. An EOJ command marks the end of the job.


Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
9996PRO_040.HTML