Workbook for SLD Offline Users - The Tape System

Introduction to Use of Tapes in SLD

This section of the workbook teaches you the basics of tape handling in SLD. By the end of this section, you will have queried the status of tapes, read tapes and obtained tapes of your own. The final step, writing to tapes, has to wait until you complete the next section of this workbook, batch processing.

SLD uses four inch rectangular cartridge-style tapes for most work at SLAC. The tapes come in two lengths which are often referred to around SLD as short tapes (or old tapes) and long tapes (or new tapes).

The long tapes are reserved for production work. Users' personal work is stored on the short tapes.

Most users never actually see any tapes, not even the tapes that they write on. The most commonly used tapes are stored in three automated tape silos in the SLAC computing center. Each silo holds about 7,000 tapes and automatically loads and unloads the tapes from 8 tape drives contained in the silo (for a total of about 20,000 tapes and 24 tape drives). During normal SLD running, raw data is read up to tapes in the silo directly from the SLD's acquisition Vax. The same tape silo can then feed information to any of SLAC's other analysis platforms.

All SLD tapes are cataloged in an Oracle database. A collection of tape handling utilities interacts with this database to help users locate tapes, give users write access to their own tapes, label tapes with comments and even exchange ownership of tapes with other SLD collaborators. Karen Heidenreich maintains this system, but most users just need the automated functions. The notable exception is that Karen must personally make decisions about what tapes are being used so infrequently that they can be offloaded from the silo system to nearby racks.

In addition to cartidge-style tapes, SLD also has access to 8mm tape systems. These are primarily used to make copies of data to ship to collaborating institutions. Details on how to make such tapes are in the document How to Take the SLD Data Home With You.

In some VMS commands and messages, the word "Volume" is used in place of the word "Tape." And "Volume Name" means the same as "Tape Name."

Open a Tape by Specifying its Nickname

Tapes can be specified either by their actual tape label name, such as QF0062, but more often users specify them by nicknames, such as REC27840. IDA resolves the nicknames by checking any available DATACATs. These are the same kind of DATACATs that you learned about earlier when using disk data files. It also checks a list of data files stored in the Oracle database.

As a first example, lets start an IDA session and read some data in from tape which matches the data we previously read from a disk file.

Start IDA by typing IDA

Open the data by typing OPENTAPE READ REC27840 STAGE WAIT

Notice that this is the same command that you use to read data files from disk. In general, IDA lets you use all of the same commands when reading data files from tapes as it does from disk.

IDA will respond with

   READCAT: Catalog entry found for the requested data
   Catalog Name: ORACLE Dataset Name: REC27840

          Medium      : CART
          Tape name   : QF0062
          File number : 26
          File label  : REC27840
          Status      : OK
          Entry Date  : 19-AUG-94
          Comments    :
   %STAGE-I-FILINPROC, Requested tape/file is currently being stage
   OPENTAPE: Request completed.  Tape QF0062.26 is staging.

This means that the dataset specified turned out to be a nickname for the 26th file on the tape QF0062. IDA then has the automated tape silo mount the tape and then position the tape to the point where the actual data begins (just past the tape header). The next time you type GO 1, a record will be read from the appropriate file of this tape.

You may wonder about the 74 in the IDA output that says

   %JIOFT-I-FILSKPNG Skipping forward 74 physical file(s) on tape volume QF0062

The data files we read from tape are what VMS calls "logical files." Each "logical file" consists of three "physical files." To get to the start of logical file 26, the tape must be advanced past 3 physical files for each of the first 25 logical files (minus one since we started on one and not zero). 3x25-1=74.

Staging Tapes

In the OPENTAPE command above, we had you include the options STAGE and WAIT. These options refer to the SLD tape "staging system." This system helps jobs read data as quickly as possible. It also helps the collaboration get the most use out of the limited number of tape drives,

When a data tape is read using the "STAGE" option, the data is copied to a special area of disk space called the "staging area," before it is read into IDA. If later in the day you again issue the same OPENTAPE command, the staging system will check whether the data is still available on disk (chances are it will be). It will then save time by reading the data from disk rather than from tape.

The STAGE option is required when you issue OPENTAPE from an interactive job. IDA will include this option whether you request it or not. This prevents users who leave an interactive job idle for a long period of time from tying up a tape drive.

In rare cases, users doing specialized batch processing, may have cases where they do not want to include the STAGE option. They may want to avoid wiping out other people's data from the stage disk. But usually, STAGE is what you want.

The WAIT option included after STAGE above means that your IDA job will wait until the data has been staged before proceeding. Most users include this option. Without it, you will have to issue a second OPENTAPE command later.

Staged data remains on disk for as long as there is room. Once the staging area becomes full, the least recently used files are deleted from the disk automatically. The work is done without any intervention by the user. The result is that, though you always type the same OPENTAPE command, most of the time the data is found on disk.

Typically, a user reads the same data set several times a day for a week or so. During such a week, chances are that the data will only actually need to be read from tape once. The rest of the week, since the data has been used recently it will have priority to remain on the staging disk. Data reading will be fast and there will be no delays waiting for tape mounts or tape drives.

Open a Tape by Specifying its Full Name

You can also give the OPENTAPE command the actual tape name rather than a nickname. Try this now by closing and reopening the same tape as follows.

To close the dataset and dismount the tape, type CLOSE INFILE

Now open the same tape using its actual tape name.

Type OPENTAPE READ QF0062.26/REC27840 STAGE WAIT

You should get a response indicating that the data is already in the staging area, unless you waited a long time between the CLOSE and the new OPENTAPE, in which case the data might have been erased from the stage disk. This could happen if the disk space is needed for some other data. You would then just have to wait a while for your data to be staged again.

Notice that you had to supply more than just the QF0062.

The .26 means that you are specifying the 26th logical file on the tape.

The last thing you are required to specify, the /REC2840, is the file label. By requiring you to specify both the logical file number and the file label, the tape system has a redundant check that you are getting the intended file.

If you QQUIT out of IDA Now and edit the relevant datacat, DUCSDATACAT:RECON.DATACAT, you will see that REC27840 is a nickname for this particular tape, file number and file label.

QTAPE: to Check the Status of a Tape

This and the next four sections of the workbook teach you additional tape handling commands that you can issue from the DCL prompt. These commands work by exchanging messages with a server machine that checks and updates information in an Oracle database.

If you have problems running with a particular tape, you may want to check on the status of that tape. To do this, use the QTAPE command. For example, check on the status of the tape you just read,

type QTAPE QF0062

You should get a response like

           Tape:  QF0062
          Owner:  SLDPM
        OwnerId:  SLDPM
      Type Tape:  PRODUCTION
       Location:  SILO
     When Owned:  19-AUG-94
      Last Used:  03-JAN-95
     Times Used:  3986
     Write lock?  N
       Comments:  Dump old REC files

The information is mostly self-explanatory. Location is generally either SILO or RACK. Only tapes in the SILO can be read or written automatically. To use tapes that have been moved to the racks, contact Karen Heidenreich to request that the tape be moved to the silo.

GETFREE: to Get a Tape of Your Own

From time to time, you may need a tape of your own. If, for example, you are only interested in a particular class of events, and you want to look at these events repeatedly, you may want to start by copying all of the interesting events from some large set of tapes onto a single new tape. Your later running will then go faster because you only have to run a single tape.

Before you can get a tape of your own, you must be listed both in the SLD Personnel Database and in the SLD Computer Accounts Database.

To check whether you are already listed in the SLD Personnel Database, issue the command SLDWHO followed by your last name. If you get no response, you are not yet listed in this database. Contact Barbara Barrera to obtain the form to put yourself into the SLD Personnel Database.

You will find out whether you are already listed in the SLD Computer Accounts Database when you first try to get a tape of your own. Do this now as follows:

Type GETFREE

If you get a response like

   ERROR UGTFRE024E Owner ... not found in Sld_Comp_Accts table
it means you are not yet listed in the SLD Computer Accounts Database. Contact Karen Heidenreich to request that you be entered into the SLD Computer Accounts Database.

Once you are in the database, when you issue GETFREE you will be prompted for a tape comment, to be used to identify this tape later. It is important that you enter a meaningful comment. If you keep a tape for a long time, you may be asked to justify why you need the tape. Without a meaningful comment, you may find it difficult to remember what tape needs to be saved for what reason.

The comment can be up to 100 characters. Put the comment in double quotes to preserve mixed case. For example, "This is a Mixed Case Comment."

After you have provided a comment, the system will respond by giving you the name of the tape you have been assigned. Try QTAPE with this tape name to double-check the status of your new tape.

MYTAPES: to List the Tapes You Own

To see a complete list of what tapes you own,

type MYTAPES TYPE

The TYPE option causes the results to be immediately typed at your console.

You can also issue the MYTAPES command without this option. In that case, the results will be sent to you in the form of a file which you can put onto your current directory by typing

RECEIVE *

The file will have file name equal to your account name and file extension equal to "tape". Type or edit the file to see the list or your tapes.

If the RECEIVE command gives the response

   %DCL-W-ACTIMAGE, error activating image JAN_SYS:RECEIVE
   -CLI-E-IMGNAME, image file JAN_SYS:[SYSEXE]RECEIVE.EXE;
   -RMS-F-DEV, error in device name or inappropriate device type for operation

this just means that the host on which your are running does not contain the JNET file transfer system. As of late 1994, the SLDB machines do not have this system. To RECEIVE the file, log on to a different host that does have JNET, such as SLACVX.

NEWCOM: to Change the Comment on Your Tape

You can change the comment on any tape that you own by using the NEWCOM command.

Type NEWCOM followed by the name of your new tape.

You will be prompted for a new comment.

MAKEFREE: to Free a Tape You No Longer Need

You can free up a tape when you are done using it by using the MAKEFREE command.

Type MAKEFREE followed by the name of your new tape.

You will be asked to confirm that you really want to give up the tape. Type YES to proceed.

It is important that you give up tapes when you have finished with them. SLD has plenty of tapes for the work that needs to be done, but there is not an infinite supply. Please keep careful track of what tapes you own and make them free when you don't need them.

If you have tapes that have not been used in a long time, they may be moved out of the silo and into the racks. After a longer period of not being used, such tapes may be erased and recycled. Because she is careful not to inconvenience users unnecessarily, Karen has to do these tape handling chores by hand and has to go to great efforts to contact users before she gives up and recycles tapes. Please save her the work by running MAKEFREE yourself at the appropriate time.

If you have a tape that absolutely needs to be kept for ever, send mail to Karen Heidenreich informing her of the tape and the reason. You will find that if you have not put meaningful comments on your tapes, you will find it hard to justify keeping them.

See the SLD User Tape Policy for details on tape ownership.

Writing Tapes

You cannot actually write to a tape until you have learned the material in the next section of this workbook, batch processing. But when you do, you will see that the command to open a tape for writing is almost the same as the command to open a tape for reading:

OPENTAPE WRITE your_tape_id.1/FIVETRK

The tape system does not allow you to open a tape to write from an interactive job because this can cause a tape drive to be tied up for an indefinite period of time. If a user left an interactive job idle overnight, the tape drive would be tied up all night.

The STAGE option that is available for OPENTAPE READ eliminates this problem for reading tapes. But no such STAGE option is available for writing tapes.

For these reasons, you will not actually write to your tape until we get to the next section of the workbook.

More Details on Use of Tapes

You have now learned the basics of reading and writing tapes in the SLD offline system. A few details remain having to do with the peculiarities of tape drives and with ways to avoid actually having to wait for tapes any longer than necessary.

There are only a limited number of tape drives available for SLACVX use (12 of the 24 drives in the SLAC tape silos). If your job is very slow to start sometimes, it may be that there are no tape drives available. You can check the status of the tape drives by issuing the following command from the DCL prompt:

   CART SHOW DEVICE

Try it now.

If all of the tape drives show STATUS as "In Use," your job will have to wait.

The tape system currently has a problem that can leave a tape drive tied up for a long time after the tape has been closed. You may find that the reason there are no tape drives available is that your own job has a drive tied up that it no longer needs. You can speed up the release of this tape drive by typing the command:

   CART DISMOUNT device_name

Sometimes when you want to use a tape you will get a message telling you that the tape is currently in use by another process. To see what process is using this tape, type the command:

   CART SHOW VOLUME tape_name

If the tape is not currently in use, it will be listed as "in cell." Between the QTAPE command which you learned before and the CART SHOW VOLUME command, you can figure out everything about the status of a tape.

Try CART SHOW VOLUME now for your own tape and also for some other tape that you saw listed in the response from CART SHOW DEVICES.

Since there is such a problem with availability of tape drives, it is considered poor form to tie up more than three drives in any job. If you ever find yourself needing more than three, there is probably a better way to do what you are trying to do.


Back to Workbook Front Page

Joseph Perl
13 November 1996