Chapter Contents

Previous

Next
TAPECOPY

TAPECOPY



Copies an entire tape volume or files from one or more tape volumes to a single output tape volume

CMS specifics: all


Syntax
Details
PROC TAPECOPY Statement
Site-specific Limitations
Using Default Values
Using the FILENAME Statement with the TAPECOPY Procedure
Printed Output
INVOL Statement
Copying Multiple Files from Multiple Tapes
FILES Statement
Specifying Individual Files
Specifying a Range

Syntax

PROC TAPECOPY <options>;
<INVOL <options> </'CMSmount'>;>
<FILESfile-numbers>;


Details

The TAPECOPY procedure copies an entire tape volume or files from one or more tape volumes to a single output tape volume. Use the TAPECOPY procedure to copy standard labeled or nonlabeled 9-track tapes and 18-track tape cartridges under CMS. PROC TAPECOPY always begins writing at the beginning of the output tape volume.

CAUTION:
Any files that exist on the output tape prior to the copy operation are destroyed.   [cautionend]
You can specify, within limits, whether the output tape will be standard labeled (SL) or nonlabeled (NL). You cannot create an SL tape using an NL input tape because PROC TAPECOPY cannot manufacture tape labels. However, you can create a nonlabeled output tape volume from a labeled input tape. Under CMS, PROC TAPECOPY writes over any existing labels on the output tape.


PROC TAPECOPY Statement


Syntax

PROC TAPECOPY <options>;

The PROC TAPECOPY statement accepts the following options.

COPYVOLSER
specifies that the output tape should have a standard label with the same volume serial as the first input tape. This option is effective only when the output tape volume is to be standard labeled, that is, LABEL=SL. This option is the default. Use the NEWVOLSER option to specify a different volume serial.

DEN=density
specifies the density of the output tape. (The DEN= option should not be specified for cartridge tapes.) If the DEN= option appears in the PROC TAPECOPY statement, it overrides any density specification in the FILEDEF for the output tape volume. If you do not specify a density in the PROC TAPECOPY statement, the tape is written at the highest density possible for that tape.

Valid density values are given by the following table.

Tape Density Value Tape Volume Type
DEN=2 800 bpi
DEN=800


DEN=3 1600 bpi
DEN=1600


DEN=4 6250 bpi
DEN=6250


DEN=5 38K bpi
DEN=38K

DETACH
requests that all tape drives that are used by PROC TAPECOPY be detached after the procedure has executed.

INDD=fileref
specifies the fileref of the first input tape volume. The default INDD= value is VOLIN.

INVOL=volume-serial
specifies the volume serial of the first input tape. This option is valid only when the input tape is standard labeled.

LABEL=SL|NL|BLP
specifies whether the output tape volume is to be standard labeled (LABEL=SL) or nonlabeled (LABEL=NL), or that all label processing should be bypassed (LABEL=BLP). The default LABEL= option value is BLP.

Note:   Do not specify SL if you intend to copy any nonlabeled tapes.  [cautionend]

If SL is specified, the output tape is SL; if NL is specified, the output tape is NL. When BLP is specified, all files are treated as physical files and the distinction between data files and label files is irrelevant; therefore, the output tape has the label status of the input tape.

In the following example an unlabeled output tape is created from a standard labeled input tape using PROC TAPECOPY:

proc tapecopy label=nl nolist;
run;

After PROC TAPECOPY has executed, the output tape volume is a nonlabeled tape. In this example, specifying LABEL=NL was necessary. If it were not specified, the default of LABEL=BLP would have been used, and all files, including data and labels, would have been copied.

NEWVOLSER=new-volume-serial
specifies a new volume serial for the output tape. NEWVOLSER is effective only if the output tape is to be standard labeled.

NOFSNRESEQ
specifies that file sequence numbers in the file labels should not be resequenced when a standard labeled output tape volume is being produced. PROC TAPECOPY normally resequences these numbers and updates the label to reflect the ordinal position of the file on the output tape as it is copied and the actual density at which the output tape is written. NFR is an alias for the NOFSNRESEQ option.

NOLIST
suppresses printing of the tape characteristics and the summary of copied files in the log. Regardless of whether you specify NOLIST, the SAS log contains a brief summary of the action produced by PROC TAPECOPY; this summary is usually sufficient to verify proper functioning of the TAPECOPY procedure if you are familiar with the contents of the input tape(s).

OUTDD=fileref
specifies the fileref of the output tape. The default OUTDD= value is VOLOUT.

TAP1
specifies tape drive 181 as the input tape device. There is no need for an input tape FILEDEF if this option is used, as TAP1 is the default. If INDD= is not specified and there is no FILEDEF for VOLIN, TAP1 is the default.

Note:   Do not specify both the INDD= and TAP1 options.  [cautionend]

TAPn
specifies a CMS tape symbolic name as the output device, where n can be a value of 0, 2-9, or A-F. See Symbolic Names for CMS Tape Output Devices for a table listing the symbolic names and the corresponding virtual addresses for CMS tape output devices.

A corresponding FILENAME statement or CMS FILEDEF command is unnecessary if the TAPn option is used. If the OUTDD= option has not been specified and there is no FILEDEF for VOLOUT, the TAPn value defaults to TAP2.

Note:   Do not specify both the OUTDD= and TAPn options.  [cautionend]


Site-specific Limitations

Some CMS sites do not have CMS tape mount commands but do allow you to mount tapes by contacting the computer operator. If your installation does not support CMS tape mount commands, you can still use PROC TAPECOPY, but you cannot specify deferred tape mounting for input tapes. If your installation has CMS tape mount commands, you can specify deferred tape mounting with an option in the INVOL statement.

Note:   PROC TAPECOPY supports deferred mounting of input tapes only.  [cautionend]

Using Default Values

If you do not specify any options in the PROC TAPECOPY statement (and there are no FILEDEF commands for the VOLIN and VOLOUT options), PROC TAPECOPY defaults to TAP1 for input and TAP2 for output. The output tape volume is labeled with the same label as the input tape. All files, including labels, are copied because LABEL=BLP is assumed.

Using the FILENAME Statement with the TAPECOPY Procedure

You can use the FILENAME statement to associate filerefs with your input and output tapes. For example, the following code copies a tape to a 1600 bpi tape. LABEL=BLP is assumed as the default for the label status of both tapes.

filename intape tape 'tap1';
filename outtape tape 'tap2';

proc tapecopy indd=intape outdd=outtape den=1600 nolist;
run;


Printed Output

The TAPECOPY procedure prints a listing to the SAS log of the input and output tape characteristics and a summary of the files copied.


INVOL Statement


Syntax

INVOL <options> </'CMS-mount-command'>;

The INVOL statement defines an input tape volume from which some or all files are to be copied to the output tape volume. The INVOL statement is not necessary if you are using only one input tape or if it is the first of several input tapes. For either of the previous cases, you should use the INDD= and INVOL= options in the PROC TAPECOPY statement instead. However, when you are using several input tapes, use an INVOL statement for each tape after the first input tape.

If you want to use deferred mounting for an input tape, you must use an INVOL statement with the /'CMS-mount-command' option.

Note:   You cannot use deferred mounting for an output tape.  [cautionend]

The following options can appear in the INVOL statement:

BLP
specifies that label processing is to be bypassed. BLP is the default if neither SL nor NL is specified.

Note:   Be sure that you know the contents of any tape for which you specify BLP in an INVOL statement to avoid copying labeled and nonlabeled tapes to the same output tape.  [cautionend]

/'CMS-mount-command'
specifies the site-specific tape mount command that your installation uses to mount a tape. Follow the slash with the text of the mount command enclosed in single quotes. This option causes deferred mounting of the input tape; it must be used if you want deferred mounting. If this option is used, it must be specified as the last option in the INVOL statement.

The mount request is executed via the standard CMS function call (SVC 204). If the return code is not zero (for example, if PROC TAPECOPY cannot find the specified mount command), SAS prints a message on the SAS log and the procedure stops processing. Some mount commands require that the tape drive be detached before the mount is issued. If this is a requirement, then you must specify DETACH in the INVOL statement.

Note:   At installations that do not have any mount commands, this option is invalid; therefore, you cannot use deferred mounting.  [cautionend]

DETACH
specifies that the tape drive be detached before issuing a mount command.

INDD=fileref
specifies the fileref of the current input tape. The default INDD= value is the fileref already in effect for the previous input tape volume, as specified in the PROC TAPECOPY statement or the last INVOL statement.

INVOL=volume-serial
specifies the volume serial of the current input tape. This option is valid only when the input tape is standard labeled.

NL
defines the input tape as nonlabeled. If the input tape is actually standard labeled, specifying the NL option causes the tape to be treated as if it were nonlabeled. In this case, any file numbers specified in FILES statements must be physical file numbers, not logical file numbers.

If you specify LABEL=SL in the PROC TAPECOPY statement (for the output tape), do not specify NL on a subsequent INVOL statement. In other words, do not copy labeled and nonlabeled tapes onto the same output tape unless the labeled tapes are to be treated as nonlabeled.

SL
specifies that the input tape is standard labeled. Do not specify SL unless the tape is actually standard labeled.

TAPn
specifies the tape drive to use, where n can be a value of 0, 2-9 or A-F.

The default value is the TAPn in effect from the PROC TAPECOPY statement or previous INVOL statement.

Do not use both the INDD= and TAPn options.


Copying Multiple Files from Multiple Tapes

In the following example, files are copied from four standard labeled input tapes to one output tape (which becomes standard labeled):

proc tapecopy tap1 nolist tap2 copyvolser label=sl;
   invol sl /'mount t13794 on 181 noring';
   file 3;
   invol sl /'mount txxxxx on 181 noring';
   files 4 5-7;
   invol sl /'mount tyyyyy on 181 noring';
   files 2 4 1 9-eov;
run;

An INVOL statement is used for each input tape to specify that the tapes are standard labeled and to provide the deferred tape mount command. Each tape must be standard labeled, or PROC TAPECOPY fails.


FILES Statement


Syntax

FILES file-numbers;

Use the FILES statement when you want to copy individual files from an input tape. The FILES statement allows you to specify the files you want to copy. You can use as many FILES statements as you need to specify particular files. Depending on the kind of tape (labeled or nonlabeled) being copied, and the intended label status of the output tape, you specify either physical or logical file numbers in the FILES statement. The following table shows the correspondence between the type of input and output tape you are using and the kind of file numbers you should specify.

Input Tape LABEL= Value from PROC TAPECOPY Statement Output Tape File Numbers
SL NL NL logical
SL SL SL logical
NL NL NL physical
NL BLP NL physical
SL BLP SL physical

Note:   A physical file is defined as the information on a tape between two tape marks. A logical file actually consists of three physical files; the first contains a header label, the second contains the data, and the third contains a trailer label. The term logical file in this context implies a standard labeled tape.  [cautionend]

When you select specific files from the first input tape, the FILES statement(s) directly follows the PROC TAPECOPY statement. When you use several input tape volumes, follow each INVOL statement with its associated FILES statement(s).

Specifying Individual Files

File numbers in a FILES statement can be specified in any order. If, for example, you want to copy file 5 and follow it by file 2 and then file 1, you can specify the following:

proc tapecopy;
   files 5 2;
   files 1;
run;

Or, you can specify the following:

proc tapecopy;
   files 5 2 1;
run;

Specifying a Range

You can specify a range of files by putting a dash between the two files, as in the following example:

proc tapecopy;
   files 1-7;
run;

In a range, the second number must be greater than the first. The keyword EOV can be used as the second file in a range. PROC TAPECOPY copies all files on the input tape until the end of the volume is reached, which is, in most cases, indicated by a double tape mark.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.