MEDIA
General User's Guide


Previous Contents Index

The acceptable values for these selection strings depends on your site. Contact your MANAGER for the appropriate values. Any of the selection strings can contain the VMS wildcards * and %. If you include any blanks or other non alphanumeric characters in the selection string, you must surround the string with double quotes (").

11.2.13 Deleting media from the database

You may only delete media from the MEDIA database that you have added. If the MANAGER or OPERATOR has added a medium to the database for you, you cannot delete it.

In the case of INCORE additions, you can delete the media you have added for the current session or simply log off the system and it will be done automatically. The command to delete temporary media is:


 
$ MEDIA INCORE DELETE 
 
 
 

This command will delete the INCORE media added during the current session.

11.3 Using MEDIA job commands

MEDIA job commands are the primary interface to the system for the user working with tapes. Job commands eliminate the need for an OPERATOR to be present in the computer room at exactly the same time as the user issues the command.

Job commands are MEDIA commands that pass VMS commands, command files or programs to a MEDIA batch job. Job commands create a batch job to perform the requested operation on the specified medium and request the OPERATOR to place the desired medium on a drive when the batch job executes. All the allocate and mount functions are automatically added, and the job is placed in a job queue that controls a device with the required characteristics (correct density, device type, etc.)

The two MEDIA job commands are:

Command Description
$ submits a job to perform any single VMS DCL command for the specified medium.
* interactively requests a series of commands from the user and then submits a job with these commands for the specified medium.

11.3.1 Moving files between on-line and off-line media with a dollar sign

The job command $ (dollar sign) is used to create a single VMS command MEDIA job. The $ command creates a batch job to perform the VMS command that follows it in the command line. The VMS command can be any proper VMS command, including another program name or a command file. The batch job automatically includes all of the instructions necessary to communicate with the OPERATOR. The command format is:


 
$ MEDIA [/QUALIFIERS] MEDIUM_NAME $ ANY_VMS_COMMAND 
 
 
 

Probably the most common use of the $ job command is to copy files to the on-line disk from an off-line medium and vice versa. This requires one of the VMS commands COPY for ANSI tapes, BACKUP for backup tapes, or FORMAT to copy an unlabeled tape.

For example, to read all of the document files from the ANSI formatted tape called SALES_JAN to the on-line disk, type:


 
$ MEDIA/NOWRITE SALES_JAN $ COPY MEDIA:*.DOC * 
 
 
 

The DCL prompt $ is followed by the keyword MEDIA to invoke the MEDIA program. This is followed by the name for the medium to be copied from, SALES_JAN. This is the MEDIA section of the command. Any qualifiers to modify this section must come after the keyword MEDIA and before the second $ in order to affect the MEDIA command. For instance, to get the system to print a running commentary of every medium affected, you insert the qualifier /LOG after the keyword MEDIA.

The VMS section of the command starts at the second $, which signals that the subsequent command is the VMS executable command COPY, to be applied to the specified medium SALES_JAN. The COPY command is followed by the logical name MEDIA:, the path to the physical device. This is followed by a wildcard file specification, *.DOC, which requests that all files with the extension .DOC be copied. Since this is a regular VMS-style COPY command, the second * indicates that all the files will have the same name on the disk as they had on the tape.

Once the job has been submitted, the system responds with a message that the job has been entered in the queue:


 
Tape job 23, medium SALES_JAN;4 (63201) entered on queue SYS$TAPE 
 

Once the job becomes active, the OPERATOR will be prompted to mount the required tape on a specified drive. MEDIA will automatically translate the name of the tape to the external ID and match the drive parameters to the tape attributes.

When the MEDIA batch job completes, a message is returned as a broadcast message if you are still logged in or as a VMS MAIL message if you have logged out. This job leaves a log file in your default login directory. The log file has the same name as the external id of the medium used.

To write a file LEATHER.COM to a medium SALES_JAN, use the following command:


 
$ MEDIA SALES_JAN $COPY LEATHER.COM MEDIA:*/LOG 
 
 
 
Tape job 24, medium SALES_JAN;4 (63201) entered on queue SYS$TAPE 
 

The file LEATHER.COM is copied from the current directory of the on-line disk to tape SALES_JAN.

While COPY is used for ANSI format tapes, BACKUP is used for backup tapes. For instance, if you wanted to erase the backup tape X334 and write new files to it, you would use the following command:


 
$ MEDIA/INITIALIZE/FOREIGN X334 $BACKUP *.* MEDIA:BD.BAK 
 
 
 

Here, the tape X334 is first initialized because of the qualifier /INITIALIZE immediately after the keyword MEDIA. After tape X334 is initialized, it becomes the target of the VMS command BACKUP, which then backs up the current directory into the file BD.BAK on to volume X334.

11.3.2 Using multiple VMS commands with *

The job command * (asterisk) signals the creation of a multi-command MEDIA job. This command will cause the system to respond with the altered prompt MEDIA $, at which the user can type in VMS commands until the user responds with CONTROL/Z to exit the job command. The job command then applies the entire series of commands to the medium specified. The command format is:


 
$ MEDIA [/QUALIFIERS] MEDIUM_NAME * 
 
 
 

This results in the prompt


 
Media $ 
 

For example, if a user wants to copy certain files from a tape SALES_JAN to the on-line disk, and other files from the on-line disk to SALES_JAN, all in one job, he or she types the command


 
$ MEDIA SALES_JAN * 
 
 
 

The system responds with the prompt


 
Media $ 
 

The user then enters a VMS command at each prompt until he or she has included all the desired commands. He or she then presses CONTROL/Z to exit from *, and a batch job is created and placed in the appropriate queue. For example:


 
$ MEDIA SALES_JAN * 
 
Media $ COPY MEDIA:*.SAL * 
Media $ COPY MEDIA:*.FCS * 
Media $ COPY *.TAX MEDIA:*/LOG 
Media $ COPY *.PAY MEDIA:*/LOG 
Media $ COPY *.COM MEDIA:*/LOG 
Media $ <CONTROL/Z> 
 
Tape job 26, medium SALES_JAN;4 (63201) entered on queue SYS$TAPE 
 
 
 

This command sequence would do the following:

11.3.3 Media job command qualifiers

Qualifiers for job commands behave much the same as any other MEDIA qualifier, but you must take care to place them correctly. Job commands have two distinct sections, the MEDIA section and the VMS command section, and qualifiers must be put in the right section. Within each section, the qualifiers are position-independent. Multiple qualifiers can be entered in any order.

For example, in the command line


 
$ MEDIA/CONFIRM MYTAPE $COPY MEDIA: *.DOC * 
 
 
 

The qualifier /CONFIRM affects the The qualifier -confirm affects the The qualifier -confirm affects the MEDIA command $, causing the system to check with the user that MYTAPE is the correct medium. If the command line were entered as:


 
$ MEDIA MYTAPE $COPY MEDIA: *.DOC */LOG 
 
 
 

the qualifier /LOG would affect the VMS command COPY.

The general qualifiers /LOG and /CONFIRM can be applied to any of the three job commands.
Qualifier Description
/LOG lists every medium affected by the operation
/CONFIRM causes the system to check with the user if the selected medium is the correct one. The user must respond with yes or no

In addition, there are three categories of qualifiers, to the general qualifiers discussed above, that are useful for the job commands $ and *. The most commonly used ones are listed and described below. A complete list can be found in the Reference Manual.

Setting qualifiers set various field or notification values. Any qualifier specified in MEDIA section of the command only affects the one command being issued. It is not recorded in the MEDIA DATABASE. Completion notification allows the system to notify you either by a broadcast message if you are still logged in or by a mail message via the VMS MAIL utility.
Qualifier Description
/MAIL forces notification via MAIL
/NOTIFY notifies creator when job completes (default)
/NONOTIFY prevents any form of user notification
/OPERATOR=text message sends a text message to the operator
/INITIALIZE the medium is to be initialized during the job

Mount qualifiers control how a medium is mounted.
Qualifier Description
/ANSI indicates that the tape to be mounted is a normal VMS type
/FILES11 indicates that the disk to be mounted is a normal VMS type
/FOREIGN indicates that the medium format is unknown to VMS and that the application program will do all label and format operations
/READONLY mount only for reading. A software write lock is put on the volume so that writing is prevented

Submit qualifiers control how the job is submitted.
Qualifier Description
/HOLD sets the job in the queue in a hold status; it will not execute until a SET QUEUE/ENTRY command is issued
/AFTER=date holds submitted job in the queue until the specified time

11.4 Using MEDIA Device Commands

Device commands are not normally used by the general user because they are automatically included in any batch job created by a job command. The six device commands are listed in Table 11-4. The six device commands are:

Table 11-4 MEDIA device commands
Command Function
MEDIA medium_name ALLOCATE Allocate a drive from the system for private use
MEDIA INITIALIZE Initialize medium
MEDIA MOUNT Mount medium on drive
MEDIA DISMOUNT Dismount medium from drive
MEDIA UPDATE Update the online directory
MEDIA DEALLOCATE Return control of the drive to the system

They are interrelated and must be executed in a specific sequence. It is much easier and safer to use job commands. If you need to use device commands to write command procedures, see the discussion in Section 11.4.7.

Device commands are designed to operate on a medium while it is mounted on a drive. These commands are automatically included in any batch job created by a MEDIA job command. Depending on the way in which your MANAGER installed MEDIA on your system you may or may not be able to use these commands interactively. If you are able to use them, you must execute them in a specific sequence because they are interrelated.

Not all of the device commands need to be used, but those that are must be in the correct order. The MOUNT command must be included even if the mount mode is NOMOUNT.

11.4.1 The MEDIA ALLOCATE command

The MEDIA ALLOCATE command requires read access to the medium and is used in the format:


 
$ MEDIA MEDIUM_NAME ALLOCATE[/QUALIFIER] [DEVICE_NAME] 
 
 
 

Both the device name and qualifiers are optional in the command line. If you omit the device name, the system will select a device with the appropriate characteristics for the medium.

The qualifiers applied to the ALLOCATE command override the values contained in the database but affect the database only for the duration of the command.


Previous Next Contents Index