USING MAGNETIC TAPES AT USC


Introduction
Using Magnetic Tape as a Storage Medium
General Procedures for Using Tapes on the USC Mainframe
Tape Format Specifications
Job Control Language for Accessing Tapes
Examples of Tape JCL
Tape Utilities
Related Documentation


Introduction

This documentation was written for people using magnetic tapes for the first time on the USC mainframe computer system and was produced by the Academic Research and Data Center of USC.  It includes a general introduction to data storage on magnetic tape and covers standard procedures for using tapes on the USC computer system.

Cartridge Tapes:

3480 cartridge tape drives on the USC MVS system have the IDRC (Improved Data Recording Capability) feature. It allows 20-80% more data to be written to a cartridge tape and also allows compressed cartridge tapes created at other computing installations to be read on our system. All cartridge tapes (not round tapes) are written in compressed format.

Data compression on cartridge tapes is a characteristic similar to density on 9-track tapes.  It is an attribute of the whole tape, rather than a feature applied to individual files on a tape.  Using this feature on our system will not affect the way you create or read your cartridge tape datasets; the workings of this upgrade will be transparent -- you will not need to code your job setups differently to read or write to cartridge tapes in most instances.  The only notable exception is in instances when you may be transporting a tape to another computing site (see the note below for instructions).  Following is a brief examination of how compression will work on our system:

When reading a cartridge tape, you will not need to specify in your JCL whether the tape file is compressed or uncompressed.  The cartridge tape drives will detect the compression status of the tape and switch to the appropriate setting.

When writing to the first file of a cartridge tape, the system default of compressed will be in effect unless you override it.  In your JCL this is accomplished with an optional DCB parameter, TRTCH=NOCOMP (TRTCH=COMP is the default and need not be coded).  See the note below for an example of requesting that a tape be written without data compression.

When writing files beyond the first file to a cartridge tape, any TRTCH parameter coded in the DCB information will be ignored.  Files that are added to a tape already containing tape files will be compressed ONLY if the previously-written files are compressed.  If the existing files on a tape are not in compressed form, additional files will also not be compressed.

The DSUTIL command TAPEINFO can be used to determine the compression status of user-owned tape cartridges.  For more information on the TAPEINFO command, refer to the ARDC DSUTIL documentation.

NOTE: TAPES TO BE TRANSPORTED TO OTHER COMPUTING INSTALLATIONS SHOULD NOT BE COMPRESSED.  When creating a tape to be transported to another computing installation or when creating files on temporary tape volumes (TTVs), you should request that your files NOT be written in compressed format (in the event you transport the tape to another computing site which does not have the capability to read compressed data).  To do so, the DCB parameter TRTCH=NOCOMP should be coded in your JCL, for example:

   DCB=(TRTCH=NOCOMP,additional DCB parameters)
Questions about data compression, as well as general questions about the use of magnetic tape storage on our system, should be referred to Dorothy Tudor of ARDC (777-6865).

Using Magnetic Tape as a Storage Medium

Magnetic tape has many advantages as a storage medium.  Tape is one of the least expensive ways to store data, and when large volumes of data are to be stored, and accessed infrequently, magnetic tape makes a very efficient storage medium.  Master files, history files, and back-up copies of data are good candidates for storage on tape.  Tape storage is also an efficient means of transferring data from one computer site to another (refer to the discussion of transporting tape between computer systems in General Procedures for Using Tapes for important considerations).

Magnetic tapes come in a variety of sizes and shapes; the typical 'round' tape is 2,400 feet long, a half-inch wide, and is wound on a hard plastic reel 10 inches in diameter.  A relatively recent magnetic tape storage format is the 3480 tape cartridge, or so-called 'square tape'; these tapes are 520 feet long, and are permanently encased in a 5" square plastic cover.  3480 tape cartridges are faster and more reliable than conventional round tapes, and hold up to 20% more data than a 10-inch round tape due to the high density with which they are written.  3480 tape cartridges are also easier to carry and to mail, and are less expensive than round tapes.  The Computer Services system also has more 3480 tape drives than round tape drives and can therefore accommodate a greater load of 3480 tape jobs.  For these reasons CS suggests the use of 3480 tapes for data storage whenever possible.  This documentation will note differences in procedures for 3480 tape cartridges (square tapes) when they apply and these notes will set off by double colons (::) so they may easily be located.

Data stored on magnetic tape is not unlike audio recordings stored on reel-to-reel tape.  Electromagnetic signals representing the data are encoded on the tape, and these signals must be read sequentially; direct access of a specific file is not possible.   To access the second file on a tape, the tape drive has to 'fast forward' through the first file to find the second.  Sequential access, and the fact that tapes require operator intervention to be loaded on the computer system, makes access to tape datasets slower than access to datasets stored on direct access disk drives permanently mounted on the system (refer to the DISK documentation for a discussion of storing datasets on auxiliary disk storage).

Using tapes also requires some initial effort on the part of the user to understand the considerable intricacies of creating tape datasets.  Unlike audio tapes where an industry standard of recording exists, data tapes can be recorded in very different ways: data tapes can be recorded with labels (and the type of label depends on the computer system being used), without labels, encoded in any one of several different electronic character-set codes, in a variety of densities (how many characters are stored per inch of tape), and in different physical layouts (how many characters define a record, how many records define a block of data, etc.).

Storing data on magnetic tapes requires an understanding of these tape formatting specifications, and a familiarity with Job Control Language (JCL) which is used to define these specifications to the computer system where the tape is being accessed.  It is also necessary to understand the procedures for using tapes at any given computing installation, and the tape formats that a given installation is capable of processing.

The next section of this documentation will discuss general procedures for using magnetic tapes on the USC mainframe.  Subsequent sections discuss tape format specifications in general and those that are used on the USC system in particular, present general Job Control Language (JCL) parameters used in accessing tapes, site specific examples of JCL necessary in a variety of tape applications on the USC system, discuss tape utility programs available on the USC system, and site sources of more detailed documentation on magnetic tape use.

General Procedures for Using Tapes on the USC Mainframe

The following discussion covers general procedures for using magnetic tape as a storage medium on the USC system and restrictions which apply.


Purchasing Tapes

If blank magnetic tapes are required, small quantities may be purchased directly from Computer Services.  If many tapes are required, they can be ordered directly from a vendor.  Contact the DLIS Business Office (777-8053) for more information.


Maintaining Backups of Tape Data

Computer Services does not make backup copies of tape datasets.  Tape users should keep a back-up copy of each tape dataset that would be difficult or impossible to recreate.  Protect status does not guard against equipment malfunction that can destroy tape datasets.  Refer to Tape Utilities for a discussion of the TAPECOPY procedure for instructions on making backup copies of tapes.


Transporting Tapes between Computer Systems

When transporting tapes from one computer installation to another, a user must consider the differences in the format used to store data on tape at both locations.  In order to read a tape at USC that was written on another system, or read a tape written on the USC system at another computer installation, the user must know the tape format.
Tapes can be read at USC if they fit the following criteria:
    - 18-track 3480 tape cartridges or 9-track round tapes
    - Recording densities of 38000 bpi with or without IDRC compression in effect (3480 tape cartridges), or 1600 or 6250 bpi round tapes)
    - Any record length, fixed or variable
    - Block size between 18 and 32760 bytes
    - ASCII or EBCDIC character code
    - IBM standard labels, ANSI labels created on IBM systems, or no labels

The following characteristics are preferred when reading tapes on the USC system:
    - 18-track, 38000 bpi square tapes
    - Fixed-length records, blocked (RECFM=FB)or unblocked (RECFM=F)
    - IBM standard labels or no labels
    - EBCDIC character code

If you are creating a tape at USC to be used on another computer system, first contact someone at that computer installation to ascertain specific tape formatting instructions.
:: NOTE: 3480 tape cartridges created on the USC system are written in IDRC compressed format by default;  if you will be transporting the tape to a site where IDRC is not supported, refer to Job Control Language for Accessing Tapes instructions on overriding this default.
Note: if you are unfamiliar with the terminology used in discussion, refer to Tape Format Specifications for an explanation of tape specifications.


Entering Tapes to be Used on the USC System

Tapes may be accessed on the USC mainframe in two ways: as a temporary tape volume (TTV) or as a library tape.   Basically, tapes which are to be accessed for only a short period of time are entered as temporary tapes; tapes which are to be held at Computer Services for long-term accessibility are entered as library tapes.
The following discussion outlines the differences in procedures for entering and accessing library tapes and TTVs.


LIBRARY TAPES:

Library tapes are permanently stored at Computer Services in the 'Tape Library'.  Tapes in the Tape Library typically contain archived data or data accessed repeatedly over a long period of time.  For example, a library tape may be used by a professor who updates student records stored on the tape each semester.  Any user with a valid batch account number may create a library tape.  Library tapes are assigned a six-digit serial number by the Tape Librarian and are accessed using that serial number (VOL=SER).

Procedure to Enter a Tape as a Library Tape:
To create a library tape, you must complete a 'Tape Action Request Form' when you deliver your tape to the CS Service Center (1st floor, CS Building, 1244 Blossom Street).  You should indicate on the TARF form the CS account number and userid to be associated with the tape volume.  If the tape has never been written on before, or if you wish to write over any existing files, you should indicate on the form that you wish the tape to be initialized, and, for round tapes you should also indicate the appropriate density (see the discussion of density in Tape Format Specifications for details).  NEVER request that a tape be initialized if there is data on the tape that want to keep.  Once a tape is initialized, any existing data are destroyed.  If the tape is to be part of a group of tapes to contain a multi-volume dataset, the DSUTIL TAPEGRP command should be run against the tapes to be included in the group (see Tape Utilities for details).

Library Tape Restrictions:
Some tapes cannot be entered directly into the CS Tape Library because of internal formatting considerations.  Tapes created elsewhere containing files written using IBM standard labels and tapes where the internal format is not known must be read using 'Bypass Label Processing' (BLP), in the first instance because the internal tape name will not match that assigned by the CS tape librarian, and in the second because the internal volser is unknown.  Accessing tapes using BLP processing removes some protective tape system checks and is restricted to TTVs on the USC system.

To process tapes in either of the previously described situations, the tapes should be entered as TTVs.  BLP access can then be used to 1) execute the TTVCOPY utility program to copy SL data files from a TTV to a library tape for permanent storage or 2) to execute the SAS TAPELABEL utility to ascertain the tape's internal format.  Instructions for each of these procedures is given in Tape Utilities.

Anyone who has a tape containing non-labeled files to be entered into the Tape Library should request that a volume serial number be assigned to the tape when entering the tape into the tape volume.  These tapes with non-labeled files should be accessed with no-label processing, (NL).  The SETDSNB utility (outlined in Tape Utilities) may be used to associate data set names with NL tape files.
Note:  if a tape is created as a CS library tape, checked out, and later reentered as a library tape and the format of the tape has been altered (datasets added), it will be necessary to (1) run the DSUTIL SCRATCH program against the tape to scratch the old dataset information associated with it, and then (2) to run the SETDSNB procedure to add the new dataset information to the tape management system directory.

Library Tape Access:
New tapes entered into the library are entered as 'scratch' tapes and the owner of the tape should set access and authorization levels using the CMS PERMIT command or the DSUTIL batch utility discussed in Tape Utilities.  Tapes reentered into the tape library retain the authorization and access levels previously associated with the VOL=SER on our system; the LISTACC exec discussed in Tape Utilities can be used to determine these settings.

NOTE:  In order to write over files on a library tape, it is first necessary to run the DSUTIL utility program and execute the SCRATCH command to delete information associated with the file(s) on the tape management system directory(Refer to Tape Utilities for details).


TEMPORARY TAPE VOLUMES (TTVs):

A Temporary Tape Volume (TTV) is a tape that the owner will access for a short time, usually no longer than a week.  Data stored on TTVs may be copied to CMS, DASD, or to a Library Tape for longer-term access.  The Tape Librarian does not keep records on TTVs and does not assign a Tape Library serial number to a TTV;  TTVs are not protected by the RACF security system or by the tape management system as are library tapes.


Entering a Tape as a TTV:
To enter a TTV to be read on the USC system, you must complete a 'TTV form' and submit the form with the tape at the Service Center, Computer Services Building, 1244 Blossom St.  Each TTV must be assigned an 'external tape name', a six-character, user-chosen name written on a paper label affixed to the tape (no other labels or different tape names should be on the tape).  Specify the same external tape name on the TTV form and on the tape.  When assigning an external tape name to a TTV try to use a unique six-character alphabetic or partially alphabetic name (examples: JJONES, SMITH1, MARY01).  Since library tapes have numeric serial numbers, alphabetic or partially alphabetic tape names indicate to the tape operator that the tape is a TTV.  This labeling procedure helps prevent the possibility of two tapes in the system with identical serial numbers.
NOTE:   If the internal tape name (the VOL=SER recorded in the volume header on the tape) is known, and if the internal VOL=SER is alphabetic, the internal tape name should be used as the external tape name.  If the tape has never been written on before, or if you wish to write over any existing files, you should indicate on the form that you wish the tape to be initialized, and, for round tapes indicate the appropriate density (see the discussion of density in TapeFormat Specifications for details).
NOTE: NEVER request that a tape be initialized if there is data on the tape that you want to keep.  Once a tape is initialized, any existing data is destroyed.

Since TTVs are not protected by the tape management system be sure there is no 'write ring' in a 'read only' tape before the tape is submitted to the system.  A write ring is a removable plastic ring that fits into the back of the tape casing.  If there is a write ring in the tape casing the tape is in 'non-protect status.'  If a tape is to be read only, the write ring is removed, putting the tape in 'protect status.'  You cannot write to a tape that is in protect status.

:: 3480 tape cartridges ('square tapes') do not have write rings; a switch on the side is used to protect/unprotect the tape from write access -- when the white dot is exposed, the tape is protected.
Write-protecting a tape does not guarantee the tape will not be written over, but is recommended as a safeguard.

:: NOTE:  3480 tape cartridges created on the USC system are written in IDRC compressed format by default; if you will be transporting the tape to a site where IDRC is not supported, refer to Tape Format Specifications for JCL instructions on overriding this default.

Indicate on the TTV form the date the TTV will be picked up.  TTVs can be held in the system for a maximum of one week at a time.  If access to the TTV is required for more than a week, an additional TTV form must be completed at the Service Center to re-enter the tape.


Accessing a TTV:
After dropping off a TTV at the Services Center, allow at least one hour for the tape to be delivered to the computer room before trying to access the tape.

The TTV will be returned to the Service Center after the number of days indicated for access has expired.  Before picking up a TTV, call the Service Center at 777-1800 to be sure the tape has been returned from the computer room.

Tape Format Specifications

Tape format is defined using the seven characteristics described below.  For the JCL instructions to code these parameters, refer to JCL for Accessing Tapes.

TAPE DENSITY
The density of data on tape varies from 600 bits (characters) per inch to 6250 bpi on round tapes; tape cartridges (square tapes) are recorded at 38000 bpi.  Different tape drives are required to read tapes written at different densities.  Tape density is coded in JCL using the DD parameters 'DEN' and 'UNIT'. NOTE:  Any jobs which require more than TWO concurrent round tapes or more than THREE concurrent tape cartridges (square tapes) must be scheduled with the operator to run; refer to the ARDC JOBS documentation for details.
:: IDRC - By default, 3480 tape cartridges are written at USC in a compressed format called IDRC ('improved data recording capability').  Data compression on cartridge tapes is a characteristic similar to density on 9-track tapes.  IDRC allows 20-80% more data to be written to a cartridge tape.  It is an attribute of the whole tape, rather than a feature applied to individual files on a tape.  When reading a cartridge tape, you do not need to specify in your JCL whether the tape file is compressed or uncompressed (the drive will detect the appropriate value); when writing to the first file of a cartridge tape, the system default of compressed will be in effect unless you override it (refer to JCL for Accessing Tapes for details); when writing files beyond the first file to a cartridge tape, the file will be written in the same format as the first file written to the tape.  TTVs and tapes to be transported to other computing installations should be written without IDRC in effect.

TAPE LABELS
A tape label is information magnetically coded on a tape to mark the beginning of a tape and to mark the beginning and end of each dataset on tape.  Labels contain information about data written on the tape and the format of the data.  The format used to write a tape label depends on the computer system used (for example, IBM standard label format is used on IBM systems).  It is also possible to write data to a tape without a tape label.  Tape label type is coded in JCL using the DD parameter 'LABEL'.

PHYSICAL ARRANGEMENT OF DATA
Characters on tape can be stored in columns of 7 bits (7-track) or 9 bits (9-track) on tape reels (round tapes) or 18 bits (18-track) on tape cartridges (square tapes).  7-track tapes are rarely used and cannot be read on the USC computer system.  The USC computer system can only read and write in 9-track and 18-track format.  The physical arrangement of the data is coded in JCL using the DD parameters 'UNIT' and 'DEN'.

DATA FORMAT
Data is written on tape as records or individual units of information. Records are arranged into blocks.  Records are measured in bytes and may be fixed or variable length.  To read a tape you must know if the records are fixed or variable length, the logical length or maximum number of bytes per record, and the number of records per block.  Data format is coded in JCL using the DCB subparameters 'RECFM', 'BLKSIZE', and 'LRECL'.  An 'unblocked record' is data written to tape so there is one record per block.

CHARACTER CODE USE TO REPRESENT DATA Character data is represented in the computer as code (for example, '11000001' might represent the letter 'A').  There are many sets of character codes, but the two used most frequently are:  ASCII (American Standard Code for Information Interchange) and EBCDIC (Extended Binary Coded Decimal Interchange Code).  When translation from one character code to another is desired, the JCL DCB subparameter 'OPTCD' is coded.

Job Control Language for Accessing Tapes

The following discussion assumes the reader has a basic knowledge of Job Control Language (JCL).  Readers unfamiliar with JCL should consult the JCL documentation described in Related Documentation.

The DD statement contains all the information needed for tape input and output.  There are four DD parameters used specifically for tape access.  These parameters must be coded for input and output tapes: UNIT, VOL=SER, LABEL, and the DEN subparameter of the DCB parameter.  When accessing an IBM standard label tape, the following DD parameters are required:

INPUT FROM TAPE:

     DSN=
     UNIT=
     VOL=SER=
     DISP=(OLD,KEEP)
     LABEL=(n,SL)
 
OUTPUT TO TAPE:
     DSN=
     UNIT=
     VOL=SER=
     DCB=
     DISP=(NEW,KEEP)
     LABEL=(n,SL)
 

n is the sequence number of the dataset on the tape.
The DD statement parameters: DSN (dataset name), DISP (disposition),and DCB (data control block) are discussed in the JCL documentation.
Following is a brief discussion of the DD parameters UNIT, VOL=SER, LABEL, and the and TRTCH subparameters of the DCB parameter.  A discussion of some additional tape JCL used for character translation and cataloging datasets on the RACF security system is also included.

UNIT parameter
UNIT specifies the kind of tape drive needed to read or write to a tape.  UNIT is based on the density and physical arrangement of the data on the tape.  Use one of the following UNIT codes to access a tape:

     UNIT=CTAPE  18-track, 38000 bpi tape cartridges (square tapes)
     UNIT=T6250  9-track, 6250 bpi tapes
     UNIT=TAPE9  9-track, 1600 bpi tapes  

 
NOTE:  The default tape density for round tape drives on the USC system is 6250 bpi.  Tape drives on the USC system default to 6250 bpi in the event that the output file being created is the first physical file on tape and density is not coded (either as DEN= or UNIT=).

     TYPE OF TAPE DRIVE              DEFAULT DENSITY
 Dual density 1600/6250 bpi             6250 bpi
 (UNIT=TAPE9 or T6250)
 
:: As noted earlier tape cartridges can only be read on 3480 tape drives.  All 3480 tape drives on our system are single density 38000 bpi (UNIT=CTAPE).

The UNIT subparameter, DEFER specifies the tape should not be mounted until the dataset it contains is called for in a program.  To use the DEFER subparameter, code the UNIT parameter as follows:


     UNIT=(dev,,DEFER)
 
dev is CTAPE, T6250, or TAPE9

VOL=SER parameter
VOL=SER specifies the volume serial number of a tape.  The internal VOL=SER is written to the first record on an IBM standard label tape; the external VOL=SER is the user-generated label affixed to the tape or the library tape number assigned by the Tape Librarian.  The VOL=SER you code in your JCL must match the VOL=SER coded internally on the tape.  For library tapes, the CS tape librarian assigns a six digit VOL=SER: a four- or five-digit number with one or two leading zeros (for example, 400001).  The entire six-digit number must be coded as the VOL=SER parameter.  For TTVs the VOL=SER is the six character name you assigned the tape when you entered it at the CS Service Center (the name you wrote on the external label, for example, SMITH1, ECON03, TAXDAT).
Code the VOL=SER parameter as follows:

     VOL=SER=serial
serial is the tape's volume serial number The VOL=SER subparameter, RETAIN specifies the tape will not be demounted or rewound after its last use in a job step or at the end of the step; the tape will be demounted at the end of the job.  When using RETAIN, code the VOL=SER parameter as follows:

     VOL=(,RETAIN,SER=serial)
 
LABEL parameter
LABEL specifies the sequential position of a dataset on tape and the type of labels written to the tape.  To write datasets to tape, specify '1' to write a dataset at the first file position on the tape, '2' to write data at the second file position, etc.
Specifying the wrong file position number causes the job to abend, or may destroy datasets by recording new datasets over old ones.  For example, a tape contains five datasets and the user wants to add the sixth dataset to the tape.  If an 8, or any number greater than 6 is coded as the file position number in the label parameter, the job will abend since the operating system expects to find at least 7 datasets on the tape when attempting to write to the 8th position.  If a number less than 6 is coded as the file number, the existing dataset of the file number coded, as well as data sets following the coded file number, may be written over.

The LABEL parameter for a library tape is coded:

     LABEL=(n,label,,access)
and the LABEL parameter for a TTV is coded:
     LABEL=(n,label,,access,EXPDT=98000)
n is the sequential file position number to be read or written to.
label is the type of label written to the tape.
    The most commonly used labels are:
    BLP = bypass label processing (restricted to TTVs)
    NL = no labels or ASCII character-coded data
    SL = IBM standard labels
    NSL = non-standard labels
    AL = ASCII character-coded data
access is either input or output tape access
    IN = input tape
    OUT = output tape
If 'access' is not coded, the tape may be used for both input and output.
For example, to input the third dataset on a library tape with IBM standard labels the LABEL parameter is coded:

     LABEL=(3,SL,,IN)
If the LABEL parameter is not coded it will default to:
     LABEL=(1,SL)
To input the second dataset on a TTV with IBM standard labels code:
     LABEL=(2,SL,,IN,EXPDT=98000)

Some special circumstances to consider when coding the LABEL parameter should be noted:

1. BLP Processing is Restricted to TTVs.  Accessing tapes with BLP as the label type removes some protective tape system checks.  Because of the potential danger of using BLP access, it is restricted to TTVs.   BLP access is necessary only when the internal tape name does not match the external tape name, or the internal tape name is unknown.  Since standard label tapes created on another system have an existing internal tape name which would conflict with the external tape name assigned by the CS Tape Librarian, any standard label tape to be entered into the CS Tape Library should be entered as follows:
    i) Enter the tape as a TTV (temporary tape volume),
    ii) Copy the data from the TTV to a library tape which is initialized with a volume serial number (VOL=SER) assigned by the CS Tape Librarian using the TTVCOPY utility (refer to Tape Utilities for details).
    iii) Access the data from the library tape using standard label (SL) processing.  Standard label processing provides system volume and dataset name checks to assure greater data security.
2. In instances when you know very little about a tape's internal format, enter it as a TTV, and run the SAS procedure TAPELABEL using BLP access (refer to Tape Utilities for an example).  The SAS TAPELABEL procedure outputs label, dataset, and internal VOL=SER information.  Once you have this information you will be able in many cases to use standard label processing.
3. NEVER use both BLP and SL to add files to an IBM standard label tape. Using standard label access (LABEL=(n,SL)) and bypass label processing (LABEL=(n,BLP)) in the same job or consecutive jobs to write files to a tape may erase data already written to the tape due to a possible system generated tape reinitialization.
4. When reading datasets from a protected tape with FORTRAN, the LABEL parameter should be coded: LABEL=(n,labtype,,IN).
This setup is required because FORTRAN opens tape files by default with read and write access.

TRTCH subparameter of the DCB parameter
The TRTCH subparameter is coded in circumstances when you wish to create a 3480 tape cartridge without IDRC data compression in effect.  By default, all 3480 tapes created at USC are written in with IDRC in effect (TRTCH=COMP).  IDRC is a characteristic associated with the whole tape, not individual files.  TRTCH= need never be coded when reading a cartridge tape:  the cartridge tape drives will detect the compression status of the tape and switch to the appropriate setting.
When writing to the first file of a cartridge tape, the system default of compressed will be in effect unless you override it by coding the optional DCB parameter

   TRTCH=NOCOMP
Since TRTCH=COMP is the system default, it need not be coded.
When writing files beyond the first file to a cartridge tape, any TRTCH parameter coded in the DCB information will be ignored.  Files that are added to a tape already containing tape files will be compressed ONLY if the previously-written files are compressed.  If the existing files on a tape are not in compressed form, additional files will also not be compressed.

Refer to Example 2 in Examples of Tape JCL for an example of overriding IDRC when creating a 3480 TTV.

The DSUTIL command TAPEINFO can be used to determine the compression status of user-owned tape cartridges.  For more information on the TAPEINFO command, refer to Tape Utilities.

NOTE: TAPES TO BE TRANSPORTED TO OTHER COMPUTING INSTALLATIONS SHOULD NOT BE COMPRESSED.  When creating a tape to be transported to another computing installation or when creating files on temporary tape volumes (TTVs), you should request that your files NOT be written in compressed format (in the event you transport the tape to another computing site which does not have the capability to read compressed data).

DEN subparameter of the DCB parameter
The DEN subparameter of the DCB parameter specifies tape density for round tapes.
:: When reading a 3480 tape cartridge ('square tape'), always code UNIT=CTAPE and do not code density.
The DCB parameter (data control block) supplies information about the physical format of the datasets on tape.  (For details on coding DCB subparameters other than DEN in the DCB parameter, refer to the JCL Documentation; the DCB subparameter 'OPTCD' is discussed later in this section.)

To code only the DEN subparameter as DCB information, use the following format:


     DCB=DEN=n
 
n is a valid code for tape density:
    3 = 1600 bpi
    4 = 6250 bpi To read a file on tape, you must code either the DEN subparameter as part of the DCB information on the input DD statement (DCB=DEN=n) or the UNIT parameter corresponding to the tape density (UNIT=dev).
When writing to tape, additional files must be written at the same density as existing files on the tape.  The operating system will not allow a user to write additional files to a tape at a different density.

When adding a new file to a round tape, code DEN as part of the DCB information.  The DCB subparameters, RECFM, LRECL, and BLKSIZE must also be coded on an output DD statement (these subparameters are discussed in full in the JCL documentation).  For example, to write a file with a record length of 80 bytes, a block size of 3200 bytes, and a density of 1600 bpi, the DCB parameter is coded as follows:

      DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200,DEN=3)
:: When writing to a 3480 tape cartridge ('square tape') do not code DEN; UNIT=CTAPE is sufficient since all 3480 drives are the same density.

Some special DCB coding circumstances should be noted:
1. When writing a SAS data library or SPSSX system file to tape, DO NOT code the subparameters, RECFM, LRECL, or BLKSIZE as part of the DCB information.  SAS, SPSS, and SPSSX set up the correct format for library and system datasets.  Only the DEN subparameter should be coded in the DCB field if using round tapes (for example, DCB=DEN=3).  For example, to write a SAS or SPSSX dataset to a round tape at 6250 bpi, the DCB parameter is coded as follows:

   DCB=DEN=4
2. When writing raw data files to tape from SAS or SPSSX (using a PUT statement in SAS, for example), you must code the subparameters RECFM, LRECL, BLKSIZE, and DEN as part of the DCB information.
3. When NL or BLP is coded in the LABEL parameter, the dataset name (DSN) can be omitted, but DCB information must be coded.  NOTE: BLP access is restricted to TTVs.

Additional Tape JCL

JCL for Character Code Translation:
When character translation is required, the OPTCD (optional services code) subparameter of the DCB parameter is used.  This subparameter requests translation from or to the ASCII character set.  The OPTCD subparameter is coded as follows:

   DCB=(OPTCD=Q,other DCB subparameters)
If the OPTCD subparameter is coded on an input DD statement the input tape dataset is written in the ASCII character set and will be translated from ASCII to EBCDIC as it is read onto the system.  If the OPTCD subparameter is coded on an output DD statement, the tape dataset will be translated from EBCDIC on the system and written as ASCII to tape.
See Example 4 in Examples of Tape JCL for an example of coding the OPTCD subparameter.

JCL for Cataloging Tape Datasets on the RACF Security System: When creating RACF cataloged tape data sets (using the DISP parameter 'CATLG'), the DSN for each data set MUST begin with a valid userid.  This id must match the userid on the JOB statement used to create the dataset, and this userid must have ALTER authority to the tape volume where the data set is to be stored.

Examples of Tape JCL

Example 1: FORTRAN Input from a TTV

The following job executes a FORTRAN program (not shown) that inputs the first dataset from a non-labeled temporary tape (TTV).

          JOB statement
     // EXEC FORTVCLG
     //FORT.SYSIN DD *
           FORTRAN program
     /*
     //GO.FT20F001 DD VOL=SER=FORTPG,DISP=(OLD,KEEP),
     // UNIT=CTAPE,LABEL=(1,NL,,IN,EXPDT=98000),
     // DCB=(RECFM=FB,BLKSIZE=800,LRECL=80)
     //
 
NOTE: FORTRAN automatically opens all datasets for input and output, therefore IN must be coded on the LABEL parameter when a dataset read from a protected tape is input.



Example 2: Writing PL/I Output to a Non-labeled 3480 TTV

The following job writes output from a PL/I program (not shown) to the first file position on a 3480 TTV as a non-labeled file.  The optional DCB subparmater TRTCH=NOCOMP is coded to prevent the tape from being written with IDRC compression in effect.

          JOB statement
     // EXEC PLIXCLG
     //PLI.SYSIN DD *
          PL/I program
     //GO.OUT DD VOL=SER=MYTAPE,DISP=(NEW,KEEP),
     // UNIT=CTAPE,LABEL=(1,NL,,OUT,EXPDT=98000),
     // DCB=(TRTCH=NOCOMP,RECFM=FB,BLKSIZE=1200,LRECL=100)
     //
 


Example 3: SPSSX Input from a Library Tape

The following job executes an SPSSX program (not shown) and inputs the first dataset from a standard label library tape.

          JOB statement
     // EXEC SPSSX
     //INFILE DD DSN=SPSSX.DATA,VOL=SER=444444,
     // DISP=(OLD,KEEP),UNIT=CTAPE,LABEL=(1,SL,,IN)
     //SYSIN DD *
          SPSSX program
     //
 


Example 4: ASCII-coded Input from a TTV to a SAS Program

The following job executes a SAS program (not shown) and inputs raw data from a non-labeled tape (TTV) written in the ASCII character set.  The job also outputs a SAS dataset to a standard label library tape as the fifth file on tape.

          JOB statement
     // EXEC SAS
     //INTAPE DD LABEL=(3,NL,,IN,EXPDT=98000),
     // UNIT=CTAPE,VOL=SER=RAWDAT,DISP=(OLD,KEEP),
     // DCB=(RECFM=FB,LRECL=100,BLKSIZE=2000,OPTCD=Q)
     //OUTSAS DD DSN=MY.SAS.FILE,DISP=(NEW,KEEP),LABEL=(5,SL),
     // VOL=SER=444444,UNIT=CTAPE
     //SYSIN DD *
          SAS program
     //
 
NOTE: Code only the DEN subparameter in the DCB information for SAS datasets output to round tapes.



Example 5: FORTRAN Output to a TTV

The following job executes a FORTRAN program (not shown) and outputs to the third file on tape (TTV).

          JOB statement
     // EXEC FORTVCLG
     //FORT.SYSIN DD *
          FORTRAN program
     //GO.FT20F001 DD DSN=FORT.DATA,VOL=SER=MYDATA,
     // DISP=(NEW,KEEP),UNIT=CTAPE,
     // LABEL=(3,SL,,OUT,EXPDT=98000),
     // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
     //
 


Example 6: Copying a SAS V. 6 Data Library to Tape in Transport Format

The following job uses the SAS procedure CPORT to copy a SAS data library on MVS DASD to a tape in transport format.  The SAS procedure CIMPORT can be used to copy the transport file to another system or host regardless of the operating system.  CPORT and CIMPORT can process SAS data libraries and format catalogs.  The output tape file is the first file on a 3480 TTV standard-label tape cartridge.  The optional DCB subparmater TRTCH=NOCOMP is coded to prevent the tape from being written with IDRC compression in effect.

          JOB statement
     // EXEC SAS
     //DFILE DD DSN=JOHNDOE.THESIS.SAS,DISP=SHR
     //MYTAPE DD DSN=THESIS.SAS.CPORT,
     //    VOL=SER=DOE001,UNIT=CTAPE,
     //    DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000,TRTCH=NOCOMP),
     //    DISP=(NEW,KEEP),LABEL=(1,SL,,OUT,EXPDT=98000)
     //SYSIN DD *
       LIBNAME DFILE 'JOHNDOE.THESIS.SAS';  /* disk dsn optional */
       FILENAME MYTAPE 'THESIS.SAS.CPORT';   /* tape dsn required */
       PROC CPORT LIBRARY=DFILE FILE=TFILE  TAPE;
     //
 


Example 7: Copying a SAS Transport File on Tape to a DASD Data Library

The following job setup uses the SAS procedure CIMPORT to copy a SAS transport file on tape to a SAS data library on MVS DASD.  The transport file was written to the tape with PROC CPORT.  The input tape file is the third file on a standard-label 3480 TTV tape cartridge.

          JOB statement
     // EXEC SAS
     //MYDASD DD DSN=N123456.SURVEY.SAS,DISP=(NEW,CATLG,DELETE),
     //  UNIT=DASD,SPACE=(TRK,(10,2))
     //MYTAPE DD DSN=SURVEY.CPORT,VOL=SER=SMITH1,UNIT=CTAPE,
     //    DISP=(OLD,KEEP),LABEL=(03,SL,,IN,EXPDT=98000)
     //SYSIN DD *
       LIBNAME MYDASD 'N123456.SURVEY.SAS';  /* disk dsn optional */
       FILENAME MYTAPE 'SURVEY.CPORT';       /* tape dsn required */
       PROC CIMPORT LIBRARY=MYDASD INFILE=MYTAPE TAPE;
     //
 

Tape Utilities

This section discusses batch utilities which are useful in tape management.

 The batch utilities are: TAPEINFO, SCRATCH, TAPEGRP, TTVCOPY, SETDSNB, TAPELABEL, TAPECOPY, HEXLIST, TAPELIST, and IEFBR14 and are procedures available through the Statistical Analysis System (SAS).  HEXLIST, TAPELIST, SETDSNB, and TTVCOPY are locally-written tape utility programs.
TAPEINFO, SCRATCH, and TAPEGRP are features of the locally written dataset management program DSUTIL.
IEFBR14 is an IBM -supplied utility program.
More detailed information about TAPELABEL and TAPECOPY is available in the SAS User's Guide: Basics, Version 6, listed in Related Documentation.  For more information about the other utilities contact ARDC at 777-6865.
In addition to the procedures discussed in this section, the IEBGENER utility, additional DSUTIL commands, and the CMS commands LISTACC and PERMIT are useful in tape management.

IEBGENER
can be used to copy, with or without editing, data to and from tape.  IEBGENER is an IBM-supplied utility program for copying datasets from CMS, auxiliary disk storage, and tape, and is discussed in the ARDC Documentation IEBGENER and the IBM manual, OS/VS2 MVS Utilities (GC26-3902).

DSUTIL
can be used to display and change RACF security system authorizations to tape volumes.  For more information, refer to the DSUTIL documentation.

LISTACC
is a CMS exec which allows listing access and authorization levels to tape volumes.  Enter the CMS command 'HELP USC LISTACC' for details.

PERMIT
is a CMS exec which allows you to change RACF authorization levels to tape volumes.  Enter the CMS command 'HELP USC PERMIT' for details.

TTVCOPY
allows you to easily copy all datasets from a TTV to a CS library tape which has been initialized with a volume serial number (VOL=SER) by the CS tape librarian.
The JCL setup for TTVCOPY is as follows:

          Job statement
     // EXEC TTVCOPY,INVOL=ttvvol,OTVOL=nnnnnn
 
ttvvol is the volser associated with the TTV
nnnnnn is the volser of the library tape it is to be copied to.  By default, the UNIT of the input tape is assumed to be T6250, the UNIT of the output tape T6250, and the label type SL;  these parameters may be overridden by coding the parms:  INUNIT=,  OTUNIT=,  and OTLAB=  on the EXEC statement.

TAPEINFO
The DSUTIL command TAPEINFO can be used to list the tape management system's directory information for each dataset on a library tape.
The command is executed as follows:

          JOB statement
     //   EXEC DSUTIL
      TAPEINFO VOL=nnnnnn
     //
 
nnnnnn is the tape's six digit volser. For multi-volume tapes, information on all tapes associated with the volser is listed. The TAPEINFO command lists the following information associated with the volume requested: volser, IDRC information (for 3480 tapes), label type, density, userid and account number of the owner, and, for each dataset name, the file number, creation jobname, creation date, record length, blocksize, record format, block count, and occurrences of read and/or write errors. TAPEINFO does not mount the tape volume, but lists information stored by the tape management system.

SCRATCH
The DSUTIL command SCRATCH is used to 'scratch' the tape management system information associated with any library tape files before writing over them.  SCRATCH must be run before the tape management system will allow you to write over library tape files.
Following is the format of the SCRATCH command:

         JOB statement
     //   EXEC DSUTIL
      SCRATCH VOL=nnnnnn,F=fn
     //

nnnnnn is the six digit volser of the tape
fn is the file number associated with the file.  All directory information on the file number coded and those those following it on the tape is scratched from the directory.  If F=2, for example, were coded, the directory for file 2 and any subsequent files on the tape would be scratched, and a job could then be executed to write a new file(s)after the first file on the tape.

To delete all file information associated with a particular tape from the tape management system's directory, the optional parm ALL may be coded.  If the tape is part of a multi-volume set, SCRATCH cannot be used to selectively scratch particular dataset information: information on all files in the multi-volume set must be scratched (code SCRATCH VOL=nnnnnn,F=1,ALL).

SETDSNB
If at any point you check out an existing library tape and alter the tape's format on another system (add datasets), and then wish to reenter the tape as a CS library tape, the tape management's systems directory information for your tape will be inaccurate.
Upon reentering the tape into the CS tape library you must:
(1) use the DSUTIL SCRATCH command to delete the current directory information for the tape,
and then
(2) run the SETDSNB procedure to create an accurate directory for the tape in the tape management system.
NOTE: This 2 step routine should also be applied to update the TMS directory for a tape in instances when a utility like SAS PROC TAPECOPY is used to alter a tape's content.
Please note that the SETDSNB procedure does not write to the tape; only the information stored in the tape management system directory is updated.
SETDSNB is executed as follows:

       JOB statement
     //  EXEC SETDSNB,INVOL=nnnnnn
 
nnnnnn is the six digit volser of the tape. The default UNIT for the input tape is T6250, and the label type is SL; these settings can be overridden using the optional parms INUNIT= and INLAB= on the EXEC statement. NOTE: SETDSNB should always be run specifying one minute of CPU time on the JOB statement, i.e. TIME=(1,0), to allow sufficient time for the procedure to execute.

If the tape is standard label (SL), the DSN for each dataset will be stored in the tape management system directory.  If the tape is NL, the following default naming convention will be used for each file: results in the following default dataset naming convention:

  userid.Vnnnnn.FILExxxx
nnnnn is the tape's volser
xxxx is the file number.  If you want to associate more meaningful dataset names with NL tape files, you may optionally code:
          JOB statement
     // EXEC SETDSNB,INVOL=444444,INLAB=NL
     //RENAME DD *
     yourdsn.file1
     yourdsn.file2
         etc.
     //
 
yourdsn.file1 etc. are the actual dataset names you would like associated with the file(s) on your tape.
The SETDSNB may also be run against any existing CS library tapes (those created prior to May 14, 1990) to record dataset name information in the tape management system directory.
NOTE: This utility should only be executed once; afterwards, any datasets added to the tape in jobs run on the USC system will automatically be added to the tape management system directory.

TAPEGRP
TAPEGRP is a DSUTIL command which is used to group a set of tape volumes in RACF in order to write a multi-volume dataset.  The TAPEGRP command may also be used to 'ungroup' tapes.
NOTE:  TAPEGRP must be used to group library tapes which ave been entered in the tape management system directory (tapes entered into the CS tape library as of May 14, 1990, or library tapes entered prior to this date which were added to the tape management system with the SETDSNB procedure).
If any tapes to be grouped contain datasets already recorded in the tape management system, the DSUTIL SCRATCH command should be run against the tape(s) prior to grouping them with the TAPEGRP command.
Following is the format of the TAPEGRP command:

          JOB statement
     //   EXEC DSUTIL
      TAPEGRP VOL=(volser1,volser2,volser3,volser4,volser5)
     //
 
volser1, etc. are the tape volumes to be grouped.  Up to 5 tapes may be grouped in a given execution of TAPEGRP; you may rerun the TAPEGRP command to group additional tapes in a previously created group by simply including one volser in the previously created tape group.

When using TAPEGRP, the first volser coded is the primary tape:
PERMITs should be issued against this primary tape.  Any previous PERMITs for tapes other than the primary tape in the tape group are deleted, but any existing permits for the primary tape are preserved and applied to all tapes in the group created.
NOTE:  If the primary tape in the list is already a member of a tape group, the effect of the TAPEGRP command will be to add the remaining volumes to the old group.

To ungroup a volume, the syntax is:

TAPEGRP VOL=volser
'Ungrouping' a volume from a tapegroup also deletes any permits to the ungrouped tape.  The tape owner should re-issue appropriate permits for the tape after removing it from the group.
The DSUTIL STATUS command can be run against any volume in the group to determine what tapes are grouped together (refer to DSUTIL for details).

TAPELABEL
TAPELABEL is a SAS procedure to list label information from an IBM standard label tape.  The information provided by PROC TAPELABEL is shown in Table 1.  NOTE: Dataset information on library tapes created after May 14, 1990, and on library tapes with dataset information added to the tape management system directory using the SETDSNB procedure should be listed using the DSUTIL TAPEINFO command rather than SAS PROC TAPELABEL (the TAPEINFO command does not require that the tape volume be mounted).


                                                                      
   Information                             Heading                    
   -----------                             -------                    
                                                                      
   Internal tape VOL=SER                   TAPE VOLUME                
   File sequence number                    FILE NUMBER                
   Data set name                           DSNAME                     
   Record format                           RECFM                      
   Logical record length                   LRECL                      
   Block size                              BLKSIZE                    
   Number of blocks in file                BLOCK COUNT                
   Est. length of file, in feet            EST. FEET                  
   File creation date                      CREATED                    
   File expiration date                    EXPIRES                    
   Job and step names of job that          JOB NAME                   
     created the file                      STEP NAME                  
   Track recording technique               TRTCH                      
   File recording density code             DEN                        
   Password                                PSWD                       
   Number of user header labels            UHL                        
   Number of user trailer labels           UTL                        
                                                                      
Table 1. Information from TAPELABEL output for each dataset on a tape.

Use the following format to input a standard label tape to PROC TAPELABEL:


          JOB statement
     // EXEC SAS
     //ddname DD UNIT=unit,VOL=SER=serial,
     //       DISP=OLD,LABEL=(1,SL,,IN),DSN=file1.dsn
     //SYSIN DD *
     PROC TAPELABEL DDNAME=ddname;
     //
 
ddname is the DD statement name for one tape. The DD statement name and the 'ddname' in the PROC TAPELABEL are the same.
To input more than one tape the 'DDNAME' in the PROC TAPELABEL is coded:
            DDNAME=(ddname1 ddname2)
Code a DD statement for each tape using ddname1 and ddname2 as DD statement names.  'ddname' defaults to 'TAPE' on the PROC TAPELABEL statement.
The semi-colon (;) must be coded at the end of the PROC TAPELABEL statement.
unit is the type of tape drive to use.  'unit' may be: CTAPE, TAPE9, or T6250.
serial is the tape's external volume serial number.
file1.dsn dataset name of the first file on tape.

If you need to access a tape that already contains data and you do not know the VOLSER that is written to the first record on the tape, enter the tape as a TTV, and use PROC TAPELABEL with label type BLP as shown in the following example:


          JOB statement
     // EXEC SAS
     //ddname DD UNIT=unit,VOL=SER=serial,
     //       DISP=OLD,LABEL=(1,BLP,,IN,EXPDT=98000)
     //SYSIN DD *
     PROC TAPELABEL DDNAME=ddname;
     //
 
The job output will include the internal volser.  You can then reenter the tape as a TTV changing the external label to the internal VOLSER and read it using SL or NL processing, or copy the TTV to a library tape which has been properly initialized using the TTVCOPY procedure.

TAPECOPY
The SAS procedure, TAPECOPY copies the contents of one tape to another tape.  Standard-labeled or non-labeled tapes may be input to TAPECOPY.
PROC TAPECOPY has the following format:


          JOB statement
     // EXEC SAS
     //name1 DD (DD parameters for input tape)
     //name2 DD (DD parameters for output tape)
     //SYSIN DD *
     PROC TAPECOPY INDD=name1 OUTDD=name2;
     //
 
name1 is the ddname for the tape to be copied. 'name1' defaults to VOLIN in PROC TAPECOPY.
name2 is the ddname of the tape the data will be copied to. 'name2' defaults to VOLOUT in PROC TAPECOPY.

NOTE: The PROC TAPECOPY statement must end with a semi-colon (;). Optional parameters are available for PROC TAPECOPY.  See the SAS User's Guide: Basics, Version 6 for more information.

The following parameters are required in DD statements for input and output tapes using PROC TAPECOPY.


INPUT TAPE:   UNIT=      DISP=      DSN=       VOL=SER=       LABEL=
OUTPUT TAPE:  UNIT=      DISP=      DSN=       VOL=SER=      LABEL=
NOTE: the LABEL type coded on the output DD statement should correspond to the label type of the output tape. A PROC TAPECOPY option, LABEL, may be used to specify label type for the output tape in PROC TAPECOPY after the copy is completed.

Please note that not all combinations of label types are valid for input and output tapes using PROC TAPECOPY.  For instance, you cannot create an SL tape using an NL tape as input because the TAPECOPY procedure cannot create tape labels.  You also cannot specify LABEL=(,SL) on the output DD statement and use the TAPECOPY LABEL option to write a non-labeled tape; you must write over an existing label on an SL tape by specifiying LABEL=(,BLP) in the output DD statement (please note that BLP access is restricted to TTVs on the USC computer system).  For more information refer to the SAS User's Guide.

Note: after running PROC TAPECOPY you should (1) run the DSUTIL SCRATCH program against the tape to scratch old dataset information associated with it, and then (2) to run the SETDSNB procedure to add the new dataset information to the tape management system directory.  Refer to the preceding subheadings in this section on the SCRATCH and SETDSNB routines.

EXAMPLES

Following are two examples of PROC TAPECOPY.
1. Copy an SL library tape (099999), to another SL label library tape (123456).


          JOB statement
     // EXEC SAS
     //VOLIN DD UNIT=CTAPE,ABEL=(,SL),DSN=FIRST.DATA.SET,
     // VOL=SER=400000,DISP=OLD
     //VOLOUT DD UNIT=CTAPE,LABEL=(,SL),VOL=SER=444444,
     // DISP=(,KEEP),DSN=FIRST.DATA.SET
     //SYSIN DD *
     PROC TAPECOPY;
     //
 
NOTE: VOLIN is the default DD name for the input tape and VOLOUT is the default DD name for the output tape.

2. Copy a TTV (TAPE10) without labels to another TTV (TAPE11) without labels.


          JOB statement
     // EXEC SAS
     //VOLIN DD UNIT=CTAPE,DISP=OLD,VOL=SER=TAPE10,
     // LABEL=(,NL,EXPDT=98000)
     //VOLOUT DD UNIT=CTAPE,DISP=(,KEEP),VOL=SER=TAPE11,
     // LABEL=(,NL,EXPDT=98000)
     //SYSIN DD *
     PROC TAPECOPY;
     //
 

HEXLIST
dumps logical records from a sequential dataset to a system output device.  HEXLIST is used when little is known about the format of the data on tape.  HEXLIST is also used to list some of the records and get a representation of the data layout when DCB information is known.  HEXLIST displays the hexadecimal value of 'unprintable' characters, such as characters indicating line feed or tabs. HEXLIST lists logical records 100 characters per line group for as many line groups needed to display an entire logical record.  Up to 100 logical records can be listed (the default is ten records).  The output is configured (in line groups) as follows:
    Line 1 - Character representation
    Line 2 - Hexadecimal zone
    Line 3 - Hexadecimal digit
    Line 4 - Delineator line (numbered every 5 spaces)

Following is the format for the HEXLIST program:


          JOB statement
     // EXEC PGM=HEXLIST,PARM='opt1,opt2,...'
     //SYSOUT DD SYSOUT=*
     //SYSIN DD (DD parameters of the input tape)
     //
 
opt1,opt2,...is a list of optional parameters. The option list may include:
   ISAM specifies an input file organized as an indexed sequential dataset (abbreviated 'IS').
   DECIMAL specifies that HEX zones and HEX digits are not to be printed (abbreviated 'DEC').
   START=n indicates the sequence number, n of the first logical record to print; default is 1. (abbreviated 'S=n')
   LIMIT=n indicates the number of logical records to print; 'n' may be any integer from 1 to 100; default is 10 (abbreviated 'L=n').
   SELECT=xx,len,col,data indicates that only records meeting SELECT criteria are to be printed. Up to six SELECTS can be used.
    'xx' may be: 'EQ' for equal to:
      'GT' for greater than
      'LT' for less than
      'NE' for not equal to
      'LE' for less than or equal to
      'GE' for greater than or equal to
    'len' is the length of the field containing the information to base SELECT on.
    'col' is the starting column of the field.
    'data' information matched for a record to be selected.

The SYSIN DD statement defines the input tape, and the SYSOUT DD statement defines the system output device where HEXLIST results are output.  When using SYSOUT=*, the system output device must be defined on the MSGCLASS parameter of the JOB statement.  The parameters that must be coded on the SYSIN DD statement are: VOL=SER, DISP, UNIT, LABEL, and DSN.

Running HEXLIST using BLKSIZE=32760 and RECFM=U as part of the DCB information produces a HEX dump with each block printed as if it were a record.  This usually provides the necessary DCB information when the data format is completely unknown.

Following is an example of HEXLIST to output a HEX dump of the first ten blocks of the first file on a non-labeled library tape (099999).


          JOB statement
     // EXEC PGM=HEXLIST
     //SYSOUT DD SYSOUT=*
     //SYSIN DD DSN=MY.TAPE.DATA,UNIT=CTAPE,DISP=OLD,
     // VOL=SER=400000,LABEL=(1,NL,,IN),
     // DCB=(RECFM=U,BLKSIZE=32760),DSN=TAPE.DSN
     //
	 
Following is an example of HEXLIST to list the first 20 records from the third file on the TTV 'MYTAPE':

          JOB statement
     // EXEC PGM=HEXLIST,PARM='LIMIT=20'
     //SYSOUT DD SYSOUT=*
     //SYSIN DD VOL=SER=MYTAPE,DISP=OLD,UNIT=CTAPE,
     // LABEL=(3,SL,,IN,EXPDT=98000),DSN=RAW.FILE3
 
If you are coding LABEL=(n,SL) you do not need to code DCB information, but the dataset name (DSN) must be coded.  When using LABEL=(n,BLP) (BLP access is restricted to TTVs or LABEL=(n,NL) you must code DCB information.

Interpreting HEXLIST Output:
If you submitted a job coded like the first example using

DCB=(RECFM=U,BLKSIZE=32760)
and the output from HEXLIST indicates that all records are the same length (for example, 1600 characters), assume 1600 is the block size, in bytes.  If, within each block, you see a pattern of fields of equal length (for example, 80 characters) resembling records, assume this pattern is logical record length, in bytes.  With this information, attempt to read the tape with the following DD statement:

     //NAME DD UNIT=CTAPE,DISP=OLD,VOL=SER=400000,DSN=TAPE.DSN,
     // LABEL=(1,NL,,IN),DCB=(RCFM=FB,LRECL=80,BLKSIZE=1600)
 
If the tape was created unblocked or one record per block, HEXLIST output would indicate each block is 80 bytes, and the DCB information in the DD statement to input the tape is coded as:
   DCB=(RECFM=F,LRECL=80,BLKSIZE=80)
TAPELIST
The batch procedure TAPELIST can be executed to list library tapes associated with an account number.  TAPELIST has the following format:

          JOB statement
     // EXEC TAPELIST
No parameters are coded.  The procedure lists library tapes associated with the account number used on the JOB statement.
USC-funded CMS ids assigned since July '94 should use the utility TAPELST2 instead of TAPELIST; this routine will list tapes associated with the USERID on the job statement (rather than the account number since ids assigned to USC faculty, staff, and students since July '94 do not have individual batch account numbers, but are associated with a departmental batch account number).  To run TAPELST2, just plug in 'TAPELST2' instead of 'TAPELIST' in the job setup noted above.

IEFBR14
The system utility IEFBR14 is an efficient means of cataloging previously-created tape datasets, and of uncataloging tape datasets, on the RACF security system.  The following example catalogs the previously-created tape dataset 'N123456.TAPETEST' on the first label of the 6250 bpi standard label tape '654321':


          JOB statement
     // EXEC PGM=IEFBR14
     //TAPEIN DD VOL=SER=456789,LABEL=(001,SL),
     // UNIT=(T6250,,DEFER),DISP=(OLD,CATLG,CATLG),DCB=DEN=4,
     // DSN=N123456.TAPETEST
The next example uncatalogs the same dataset:

          JOB statement
     // EXEC PGM=IEFBR14
     //TAPEIN DD UNIT=(T6250,,DEFER),DISP=(OLD,UNCATLG),
     //   DSN=N123456.TAPETEST
More information on IEFBR14 can be found in the IBM manual, OS/VS2 MVS Utilities (GC26-3902).

Related Documentation

IBM manuals containing information about using tapes on the IBM mainframe include:
OS/VS2 MVS JCL (GC28-0692)- provides information on Job Control Language (JCL) and coding DD statements for input and output tapes.
OS/VS Tape Labels (GC26-3795)- provides detailed information about tape labels and reading label information.
OS/VS2 MVS Utilities (GC26-3902)- provides information about IBM-supplied utility programs, including IEBGENER used for editing, copying and moving datasets between tape, disk, and CMS.

CS maintains copies of these manuals and also produces documentation for IBM mainframe users.  The ARDC JCL documentation covers commonly used IBM Job Control Language, including JCL needed for tape access.  Other documentation related to using tapes on the USC system are: IEBGENER, JOBS, BIGJOBS, and DSUTIL.
Application software documentation like SAS and SPSSX include instructions for accessing data on tape using software commands.

Other documentation are available at the ARDC web page, at the ARS INFOHAND web page, through CMS, an OS batch cataloged procedure, and from the third-floor receptionist, Computer Services.

The tape utility programs, TAPELABEL and TAPECOPY are available as SAS procedures.  These SAS procedures are documented in: SAS User's Guide: Basics, Version 6
For more information on SAS and the user's guide see SAS.

ARDC Documentation     ARDC Home Page     USC Home Page

*SAS is the registered trademark of SAS Institute Inc., Cary, N.C. 27511, U.S.A.

This page updated March 14, 2001 by Amy W. Yarbrough, Academic Research and Data Center.
Copyright © 1999, The Board of Trustees of the University of South Carolina.
URL http://www.sc.edu/ardc/docs/tapes.htm