[comp.os.vms] Extracting a Tape Volume Label...

agoe@ur-tut.UUCP (05/12/87)

I working on a small integrated BACKUP/TAPE Management Facility for our site
and I am yet to be able to find a way to extract a magnetic tape's volume
label for use in a DCL com file. If there is a lexical for this, I am really
at a loss.  I would appreciate any suggstions.

A VAX type-version of UCC1 it may not be but it will at least be
better than logging the damn things in by hand!  Thanks in advance.


-- 
Karl Cialli
MCI International Inc.   Dept. 433/875
2 International Drive    Rye Brook, NY 10573
UUCP:	{allegra, cmcl2, decvax, harvard, seismo}!rochester!ur-tut!agoe


===============================================================================

tedcrane@batcomputer.tn.cornell.edu (Ted Crane) (05/13/87)

In article <1318@ur-tut.UUCP> agoe@ur-tut.UUCP (Karl Cialli) writes:
>I working on a small integrated BACKUP/TAPE Management Facility for our site
>and I am yet to be able to find a way to extract a magnetic tape's volume
>label for use in a DCL com file. 

I assume you don't mind physically mounting the tape on the drive!  There
is no lexical in the world that'll help you if the tape is in the rack!
Seriously, now:

$!
$! First, mount the tape with over=id, so you don't need to know the
$! label.  Note that the second parameter is a space...this is just a
$! placeholder so you can enter a third parameter, TAPE, which will
$! be a convenient logical name for the tape drive.
$!
$ mount/nowrite/override=identification tape-device " " TAPE
$!
$! Now, you can get the volume label fairly easily:
$!
$ VOLUME_LABEL = f$getdvi(TAPE,"volnam")
$!
$! Dismount the tape, use nounload if you are going to reuse it immediately
$!
$ dismount/nounload TAPE

This is based on some code I've used for disks...I haven't tried it on
a tape for a long time, if ever, but it ought to work.