The COPY command copies the specified records from one or more input files to an output file. The files can reside on different devices or on multifile tapes.
You can use a single copy command to create several different output files. Each output file is created with copies of records from the input files you specify for it. This multiple output file form of the COPY command is almost equivalent to executing several individual COPY commands in sequence. However, you must use the multiple output file form of the COPY command if you want to create a multifile output tape. No more than 10000 input and output files can be specified in one COPY command.
Syntax
── COPY ─────────────────────────────────────────────────────────────────────────► ┌◄─────────────────────────────────── THEN ──────────────────────────────────┐ │ ┌◄───────────────────────────── THEN ─────────────────────────────┐ │ │ │ ┌◄─────────┬──────┬──────────┐ │ │ │ │ │ └◄─ , ─┘ │ │ │ ►─┴─┴─/10000\─┬─<file title>─────────┬─┴─┬────────────────────────┬─┴─┴─<dest>─┴─┤ ├─<long file title>────┤ ├─ (<file attributes>) ──┤ ├─ UL ──<old specs>────┤ ├─<record specification>─┤ └─ FR ──<manual input>─┘ ├─<skip specification>───┤ ├─ SKIPTM ──<integer>────┤ ├─ MULTIFILE ────────────┤ └─/1\─<key>──────────────┘
<dest>
┌◄─────────┬──────┬─────────┐ │ └◄─ , ─┘ │ ── TO ─┬─<file title>──────┬─┴─┬───────────────────────┬─┴─┬──────────────────┬──┤ ├─<long file title>─┤ ├─ (<file attributes>) ─┤ └─ : ── DONTPRINT ─┘ ├─ UL <old specs> ──┤ ├─ MULTIFILE ───────────┤ └─ FR <old specs> ──┘ └─ CRUNCH ──────────────┘
──<record range list>─┬───────┬────────────────────────────────────────┤ └─<key>─┘
Explanation
COPY <file title>
COPY <long file title>
Specifies the first or only input file from which DUMPALL is to copy records. If the file title does not include an ON <family name> clause and the file attributes you specify do not include KIND or FAMILYNAME, DUMPALL searches for one of the following matching files:
-
For a disk file with a matching file name
-
For a tape file with a matching file name
-
For a card file with a matching file name
Note: | If the title is a long file title, you must specify that the kind is DISK by using an ON clause, or by specifying KIND or FAMILYNAME. |
THEN <file title>
THEN <long file title>
Specifies the name of a subsequent input file from which DUMPALL is to copy records. If you do not specify the KIND or FAMILYNAME (in the case of disk files) for each input file, DUMPALL uses the same KIND and FAMILYNAME as that of the previous input file. Suppose you enter the following command:
COPY F/A ON XPACK THEN (UC)ONE TO TFILE
DUMPALL searches for the input file (UC)ONE on the disk family XPACK. DUMPALL creates the new output file TFILE on XPACK as well.
TO <file title>
TO <long file title>
Specifies the name of the output file that DUMPALL is to create and to which DUMPALL is to copy the records from the preceding input files. If you do not specify file attributes such as FRAMESIZE, MAXRECSIZE, BLOCKSIZE, KIND, FILEKIND, and FAMILYNAME for the output file, DUMPALL uses the attribute values of the first input file that you specified to be copied to the file.
UL
UL <old specs>
Specify that an input or output file has a KIND attribute of TAPE and has no label. You can use UL with a labeled tape; UL merely specifies that the tape be treated as unlabeled.
Specify UL only for magnetic tape files. When you use UL, it is not necessary to specify a KIND attribute value of TAPE. UL is ignored for disk and pack files.
The default INTMODE file attribute value is EBCDIC, and the default MAXRECSIZE and BLOCKSIZE attribute values are 1500. You can specify other values for these attributes with the <old specs> variable or with the (<file attributes>) syntax.
Note: | The default FRAMESIZE is 48 (that is, words). If you want to specify the MAXRECSIZE and BLOCKSIZE attributes in bytes, you must include FRAMESIZE=8 as a file attribute specification. |
When you use UL in an output file specification, the system creates an unlabeled tape as described in “Unlabeled Tapes” later in this section. The operating system demands as many tapes as are required to hold the data being copied to the tape. UL and FR perform the same functions for output files.
When you use UL for an input file whose options do not include SKIPTM or MULTI, DUMPALL can read more than one physical tape. When DUMPALL reads a tape mark from the tape, it closes that volume and attempts to open the next volume. This action causes the system to generate the following RSVP message:
NO FILE UL (UNLABELED MT) #nn
You must reply to this message with either the UL (Unlabeled) or the FR (Final Reel) system command.
When you use UL in an input file specification that includes SKIPTM or MULTI, UL is equivalent to FR—that is, DUMPALL uses only one physical tape. In the latter case, when DUMPALL reads a tape mark from the tape, DUMPALL does not try to proceed to the next volume.
If you need to copy a file from a multivolume unlabeled set of tapes, and if you need to use the SKIPTM or MULTI option, use the THEN clause of the COPY command to copy the various parts of the file from the separate tape volumes. For example, suppose the fifth file on the first tape was split into two parts by a volume switch operation that occurred while the file was being copied to the tapes. Then you could copy the entire file from the tapes by using a command of the following form:
COPY UL SKIPTM 4 (<file attributes>) THEN UL (<file attributes>) TO <file title>
<old specs>
Use old specs with unlabeled or nonstandard labeled tape files to assign values to the attributes INTMODE, MAXRECSIZE, and BLOCKSIZE. Refer to “Old Specs” later in this section for more information about <old specs>.
FR
FR <old specs>
For input files, specify an unlabeled tape file that has only one reel. As in the case of UL, the tape used need not be an unlabeled tape.
Specify FR only for magnetic tape files. When you use FR, it is not necessary to specify a KIND attribute value of TAPE. DUMPALL ignores FR for disk and pack files.
The default INTMODE file attribute value is EBCDIC, and the default MAXRECSIZE and BLOCKSIZE attribute values are 1500. You can specify other values for these attributes with old specs or with the (<file attributes>) syntax.
Note: | The default FRAMESIZE is 48 (that is, words). If you want to specify the MAXRECSIZE and BLOCKSIZE attributes in bytes, you must include FRAMESIZE=8 as a file attribute specification. |
When used in an output file specification, FR specifies that the output tape is to be unlabeled and formatted as described under “Unlabeled Tapes” later in this section. The operating system uses as many tapes as are required to hold the data to be copied.
The use of FR instead of UL is important for input files only. That is, when you use FR in an input file specification, it indicates that only one physical tape is to be used. The benefit of using FR is that when DUMPALL reads a tape mark from the tape, it closes the input file and does not need an operator response. Refer to “Input Files from Unlabeled Tapes” later in this section.
(<file attributes>)
Specifies how the file is to be written or read. Except for the file attributes you specify, DUMPALL obtains the file attribute information for each input file from the disk file header or the tape label. Except for the file attributes you specify and the FILESTRUCTURE, SERIALNO and HOSTNAME attributes, DUMPALL obtains the file attribute information for each output file from the first input file copied to that output file.
DUMPALL determines the value of the KIND attribute for input files and output files by one of the following processes:
-
If you specified either UL or FR, then KIND is TAPE.
-
If you specified a file title with an explicit ON family name clause, then KIND is TAPE or DISK depending on whether or not you specified the family name ON TAPE.
-
If you explicitly specify a value for the KIND in the <file attributes> syntax, then DUMPALL uses that value.
-
Otherwise DUMPALL determines the value for KIND automatically as follows:
-
For the first input file in the command, DUMPALL searches for the file on disk and tape.
-
For all subsequent input files in the command for which you have not explicitly or implicitly specified a value for KIND, DUMPALL uses the same value of KIND as the preceding input file.
-
For the first output file in the command DUMPALL uses the same KIND value as the first input file in the command.
-
For all subsequent output files in the command for which you have not explicitly or implicitly specified a value for KIND, DUMPALL uses the same value of KIND as the preceding output file.
-
If you do not specify a value for SAVEFACTOR for an output file, DUMPALL assigns the output file the same SAVEFACTOR value as the first input file. If that value is 0, DUMPALL uses 999 instead.
Note: | A tape file with a SAVEFACTOR of zero expires the day it is created. The system treats tapes containing expired tape files as scratch tapes unless you remove the write ring from the reel or switch the write-protection knob on the tape cartridge. |
If you specify the HOSTNAME file attribute, DUMPALL accesses the file on a remote host system. In this case, distributed system services (DSS) requires that you also explicitly specify the KIND file attribute.
The file attribute equation specifies how the file is to be written or read. If no file attributes are specified for the input file, DUMPALL opens the input file with the following logic:
-
Labeled tape files are opened with DEPENDENTSPECS set to TRUE, INTMODE set to EBCDIC, and EXTMODE set to the physical mode of the file.
-
Disk files are opened with DEPENDENTSPECS set to TRUE and with INTMODE and EXTMODE set to the physical mode of the input file.
The logical input file resembles the physical input file for disk files, and resembles the physical file for tape files if the tape file has a physical mode of EBCDIC.
The record and block structures of the output file are the same as those of the first input file if you do not specify any file attributes for either the input file or the output file, and if the input file is either a tape file with a physical mode of EBCDIC or a disk file. In this case, no data translations occur, so DUMPALL does not alter the records it copies from the input file or files to the output file.
Specifying input file attributes such as DEPENDENTSPECS, EXTMODE, and INTMODE might cause data translation and the alteration of other file attributes (for example, MAXRECSIZE). Specification of such attributes might also avoid data translation if the input file is a not an EBCDIC tape file. If data translation does occur, the output file might not directly resemble the input file.
Refer to “Understanding Structural File Attributes” earlier in this section for an explanation of the file structure, record size, block size, the DEPENDENTSPECS attribute, and their effects on DUMPALL.
Refer to “Specifying Data or Character Set Translations” earlier in this section for an explanation of the effects of the EXTMODE and INTMODE file attributes on DUMPALL.
Causes only the specified portion of the file to be copied. If you do not supply a record specification or a skip specification, DUMPALL copies the entire file. If you use the <key> option in the record specification, all records with matching arguments are copied. Refer to “Key Option” and “Record Range List” later in this section for more information about <key> and <record range list>.
<skip specification>
Causes only the specified portion of the file to be copied. If you do not supply a record specification or a skip specification, DUMPALL copies the entire file. Refer to “Skip Specification” later in this section for more information about <skip specification>.
SKIPTM <integer>
Causes DUMPALL to skip past the number of tape marks specified and to bypass any records encountered between tape marks. Use SKIPTM to position an input tape at the first record of a file to be read. You can use SKIPTM only with an input file that you specify as UL or FR. SKIPTM 0 is equivalent to omitting the SKIPTM option.
Refer to “Description of Tape Formats” later in this section for an explanation of where tape marks appear on a tape.
MULTIFILE
MULTI
Specify that an input or output file is part of a multifile labeled or unlabeled tape. After DUMPALL finishes copying the file with the MULTIFILE specification to or from a tape, the tape does not rewind. The operating system positions the tape so that DUMPALL can read or write to a subsequent file on the same volume. In other words, MULTIFILE leaves the tape assigned and positioned so that DUMPALL can copy a subsequent file to or from the tape. DUMPALL ignores the MULTIFILE option if the file is not a tape file.
You must use MULTIFILE to copy a file from a multifile tape if the following conditions are met:
-
The file has a nonstandard name. Normally, a tape file has a two-level name of the following form: volumeid/fileid. A nonstandard tape file name is a name with only one level, such as F1 or MYFILE.
-
The tape is a standard labeled tape.
-
The file is not the first file on the tape.
In such a case, when DUMPALL tries to open the file, the system produces a “NO FILE <filename> (MT)” RSVP message. You must reply with the IL (Ignore Label) system command to select the tape unit on which the tape with the requested file is mounted.
Normally, when DUMPALL finishes copying a file or several files to a tape, it closes the tape with the LOCK option. So, depending on the kind of tape unit involved, the system either unloads the tape volume or marks the unit as locked. However, if you specify MULTIFILE on the last or only output file that you want copied to tape, DUMPALL does not close the tape with the LOCK option, and the tape simply rewinds. When the rewinding finishes, the system leaves the tape online and ready for use in subsequent DUMPALL commands or subsequent programs.
Allows you to select records based in part on the data in the records. Refer to “Key Option” later in this section for an explanation of <key>.
CRUNCH
When the output disk or pack file is closed, DUMPALL returns the unused portion of the last row of disk space to the system. DUMPALL ignores the CRUNCH option if the file is not a disk or pack file.
DONTPRINT
Suppresses the printed report of the file attributes of the input files and output files.
Examples of the COPY Command
This discussion provides three types of examples:
-
General examples that illustrate various features of the COPY command.
-
Examples that illustrate how to copy files from tapes to disk. These examples include labeled, nonstandard labeled, and unlabeled tapes for single and multifile tapes.
-
Examples that illustrate how to copy files to and from tapes.
General Examples
The examples that follow illustrate various features of the COPY command.
Example 1
Example 1 copies the file INFILE to the file OUTFILE. The attributes of OUTFILE are the same as those for INFILE. DUMPALL searches for an online tape file with the name INFILE and for a disk file named INFILE on the family DISK. If INFILE is on tape, DUMPALL writes OUTFILE to tape. If INFILE is on disk, DUMPALL writes OUTFILE to disk.
COPY INFILE TO OUTFILE;
Example 2
Example 2 creates a new file named F3 and copies to it all the records from file F1 followed by all the records from file F2:
COPY F1 THEN F2 TO F3;
Example 3
Example 3 copies files F1 and F2 to the file F3, closes F3, and then copies files F4 and F5 to the file F6:
COPY F1 THEN F2 TO F3 THEN F4 THEN F5 TO F6;
Example 4
Example 4 creates two new files: OUTFILE1 and OUTFILE2. OUTFILE1 has the same file attributes and KIND as the input file FILE1 and receives copies of records 20 through 49 of FILE1. OUTFILE2 is a disk file. Its other file attributes match those of input FILE2. OUTFILE2 receives copies of records 1 through 5 of FILE2 and is closed with CRUNCH.
COPY FILE1 REC 20 THRU 49 TO OUTFILE1 THEN FILE2 REC 1 THRU 5 TO OUTFILE2 (DISK) CRUNCH;
Example 5
Example 5 creates a single-file labeled tape with a standard tape name—that is, a volume identifier of T and a file identifier of FILEONE:
COPY FILEONE TO T/FILEONE (KIND=TAPE);
Example 6
Example 6 copies three files to a multifile labeled tape. This example generates a tape with nonstandard filenames, because the output filename does not include a volume name; it contains only file identifiers. Notice that it is necessary to specify KIND = TAPE for only for the first output file. Each DUMPALL output file assumes the same KIND as the previous output file unless you specify otherwise. The files are separated by the standard tape header and trailer records (HDR1, HDR2, EOF1, EOF2).
COPY F1 TO FONE (KIND = TAPE), MULTIFILE THEN F2 TO FTWO, MULTIFILE THEN F3 TO FTHREE;
Example 7
Example 7 copies file F2 to disk from the tape generated by Example 6. The MULTIFILE option is necessary because the tape does not use standard tape names of the form volumeid/fileid and because F2 is not the first file on the tape. The operator must reply to the RSVP message “NO FILE F2 (MT #1)” with the IL (Ignore Label) system command to direct DUMPALL to the tape unit that contains the requested tape volume.
COPY FTWO MULTIFILE (KIND=TAPE) TO F2 ON MYPACK;
Example 8
Example 8 creates a new file named B and copies the records from file A to it. The new file has the same file attributes as file A. DUMPALL does not print a report showing the file attributes.
COPY A TO B: DONTPRINT;
Example 9
Example 9 copies lines 5 through 30 that have "TH" in columns 9-10 in FILE1, and lines 14460 through the end that have a character with a value greater than or equal to "I" in column 5 in FILE2, to FILE3.
COPY FILE1 REC 5 THRU 30 KEY 8 = "TH" THEN FILE2 REC 14460 THRU END KEY 4 GEQ "I" TO FILE3
Example 10
Example 10 Copies all lines that have a character with a value less than "E" in column 2 in FILE1 to FILE2, and all lines that have a character with a value less than or equal to "F" in column 9 in FILE3 to FILE4.
COPY FILE1 KEY 1 LSS "E" TO FILE2 THEN FILE3 KEY 8 LEQ "F" TO FILE4;
Examples of Copying Files from Tapes to Disk
The following are examples of copying single and multiple files from labeled tapes, unlabeled tapes, and nonstandard labeled tapes to disk.
Example 1
Example 1 copies a tape file named TX/DATA from a labeled tape to DISK. It gives the copy on DISK the file name NEW/TX/DATA. The disk file automatically inherits file attributes such as MAXRECSIZE, BLOCKSIZE, FRAMESIZE, and EXTMODE from the tape file.
COPY TX/DATA (TAPE) TO NEW/TX/DATA (DISK);
Example 2
Example 2 copies a file from an unlabeled tape to the disk family named PACK. It gives the file on PACK the file name CD/FILE. You must specify file attributes of the input file such as BLOCKSIZE and EXTMODE, because DUMPALL cannot determine the proper values from the tape itself.
COPY UL (FRAMESIZE=8, MAXRECSIZE=80, BLOCKSIZE=240, EXTMODE=EBCDIC) TO CD/FILE ON PACK;
Example 3
Example 3 copies a file from a tape with nonstandard labels to the disk family named DPPACK. The copy of the file on disk is given the name F/XFILE. Because the tape has nonstandard labels, DUMPALL cannot copy the file from tape by its name. Instead, you must use the UL option. Because DUMPALL cannot determine the proper values for file attributes such as record size from the nonstandard tape labels, you must specify them in the command. And finally, use SKIPTM to skip over the tape mark that separates the labels from the first file on the tape.
COPY UL SKIPTM 1 (FRAMESIZE=8, MAXRECSIZE=120, BLOCKSIZE=720, EXTMODE=EBCDIC) TO F/XFILE ON DPPACK;
Example 4
Example 4 copies three named files from a labeled tape to a disk. The name of the tape is XTAPE and the names of the three files to be copied are XTAPE/DATA, XTAPE/SYM, and XTAPE/DOC. These tape files are to be copied to DISK with the file names PROG/DATA, PROG/SYMBOL, and PROG/DOC respectively. Each copy automatically inherits the specific values of file attributes such as record size and EXTMODE from the corresponding tape file. The copy of the symbol is given the FILEKIND of COBOLSYMBOL. The other two files receive the default FILEKIND of DATA. Tape files do not have a FILEKIND attribute, so when you copy from tape, DUMPALL uses the default DATA for disk copies unless you specify an explicit value for the FILEKIND attribute. For efficiency purposes, you should list the files to be copied in the order they appear on the input tape unless you do not know the order. It is not necessary to repeat the kinds TAPE and DISK for each input and output file, because DUMPALL automatically assumes that each input or output file has the same KIND as the first input or output file unless otherwise specified.
COPY XTAPE/DATA MULTIFILE (TAPE) TO PROG/DATA (DISK), THEN XTAPE/SYM MULTIFILE TO PROG/SYMBOL (FILEKIND=COBOLSYMBOL), THEN XTAPE/DOC TO PROG/DOC;
Example 5
Example 5 copies three files from an unlabeled tape to disk. The input tape actually has four files on it, but only the first, second, and fourth files are to be copied. The input files do not have names, but the disk files receive the names T/F1, T/F2, and T/F4. You must specify file attributes such as record size and EXTMODE for the tape files, because DUMPALL cannot automatically determine the actual values for files on unlabeled tapes. The second and fourth files have the same attributes, so you do not have to repeat the values in the command.
COPY UL MULTIFILE (FRAMESIZE=8, MAXRECSIZE=100, BLOCKSIZE=900, EXTMODE=EBCDIC) TO T/F1 ON DISK THEN UL MULTIFILE (FRAMESIZE, MAXRECSIZE=80, BLOCKSIZE=80, EXTMODE=EBCDIC) TO T/F2 THEN UL SKIPTM 1 TO T/F4;
Example 6
Example 6 copies three files from a tape with nonstandard labels. Because the system cannot understand the labels, you must use the UL or FR specification instead of file names in the COPY command to locate the tape files. You must use MULTIFILE, or the COPY command copies the first file from three separate tapes. You must use SKIPTM to skip labels: the first SKIPTM skips over the beginning labels for the first file; the second SKIPTM skips over the ending labels of the first file and the beginning labels of the second file; and the third SKIPTM skips over the ending labels of the second file and the beginning labels of the third file. You must specify file attribute values for the input files, because DUMPALL cannot interpret the file attributes recorded in nonstandard labels. To change the block size of the first file to a larger size on disk, you must also specify this file attribute for the first output file.
COPY UL SKIPTM 1, MULTIFILE, (FRAMESIZE=8, MAXRECSIZE=450, BLOCKSIZE=450) TO FT/FILE1 ON DISK (BLOCKSIZE=900) THEN UL SKIPTM 2, MULTIFILE, (FRAMESIZE=8, MAXRECSIZE=70, BLOCKSIZE=770) TO FT/FILE2 ON DISK THEN UL SKIPTM 2, (FRAMESIZE=8, MAXRECSIZE=98, BLOCKSIZE=98) TO FT/FILE3 ON DISK;
Examples of Copying Files to and from Tapes
The examples that follow illustrate how to copy files to and from tapes.
Example 1
Example 1 creates a single-file labeled tape.
COPY FILEONE TO T/FILEONE (KIND=TAPE);
You create a single-file labeled tape by specifying a file title instead of UL or FR in the output file portion of the COPY command and by specifying a KIND value of TAPE in the output file attribute list. Many of the disk file attributes, such as BLOCKSIZE and MAXRECSIZE are written into the tape labels so that they are preserved on tape. This process makes it easier to copy the file back to disk with DUMPALL and makes it easy for programs to read the file directly from tape.
Note: | Some programs that read the disk file sequentially from disk could use the tape file T/FILEONE directly. Simply enter label equation statements in those programs to reference the tape file so you do not have to copy the file back to disk to use it. |
DUMPALL reads a single-file labeled tape when you specify a file title in the input file portion of the COPY command corresponding to a file on the tape. KIND must equal TAPE in the input file attribute list.
If multiple physical tape volumes are required to contain the copied file, the I/O subsystem automatically requests the extra volumes as they are needed.
Example 2
Example 2 copies T/FILEONE back to disk:
COPY T/FILEONE (KIND=TAPE) TO FILEONE(KIND=PACK, PACKNAME=MYPACK);
When the file is copied, some of the file attributes, such as the BLOCKSIZE and MAXRECSIZE, of the original disk file are preserved when the file is copied. Other attributes, such as CREATIONDATE and TIMESTAMP, acquire new values. Some attributes, such as USERINFO, are lost. And some attributes, such as AREASIZE and FILEKIND, are given default values when the file is copied from tape to disk.
Example 3
Example 3 creates a single-file labeled tape:
COPY FILEONE THEN FILETWO THEN FILETHREE TO T/FIRSTSET (KIND=TAPE);
The file T/FIRSTSET is a single file that contains the records in FILEONE, followed by the records in FILETWO, followed by the records in FILETHREE. To copy the file T/FIRSTSET back to disk, use the following command:
COPY T/FIRSTSET (KIND=TAPE) TO FIRSTSET (KIND=PACK,PACKNAME=MYPACK);
The separate files used to create the tape can be retrieved only by using a record range list. If the identity of the separate files is to be maintained, create a multifile tape.
Example 4
Example 4 controls the output tape selection by specifying a serial number list.
COPY BIG/FILE TO T/FILEONE(KIND=TAPE, SERIALNO=("SN1","SN2","SN3"));
When you create a labeled tape and the file that is being written to the tape requires more than one tape, the operating system takes appropriate action as each additional tape is required.
Example 5
Example 5 creates a multifile labeled tape containing the files T/FILEONE, T/FILETWO, and T/FILETHREE:
COPY FILEONE TO T/FILEONE (KIND=TAPE) MULTI THEN FILETWO TO T/FILETWO (KIND=TAPE) MULTI THEN FILETHREE TO T/FILETHREE (KIND=TAPE);
You can create a multifile labeled tape by using the word MULTI instead of UL or FR in the specification for each output file that is to be followed by another input file. If multiple physical tapes are required to contain the set of files written, tapes are selected automatically. Similarly, DUMPALL reads a multifile-labeled tape if you use the word MULTI in each input file specification that is to be followed by another input file from the same tape.
Example 6
Example 6 copies a selected file back to disk:
COPY T/FILETWO (KIND=TAPE) TO FILETWO(KIND=PACK, PACKNAME=MYPACK);
Example 7
Example 7 copies multiple files back to disk:
COPY T/FILEONE (KIND=TAPE) MULTI TO FILEONE (KIND=PACK, PACKNAME=MYPACK) THEN T/FILETHREE TO FILETHREE (KIND=PACK, PACKNAME=MYPACK);
Example 8
Example 8 creates a multifile labeled tape containing the files T/FIRSTSET and T/SECONDSET:
COPY FILEONE THEN FILETWO THEN FILETHREE TO T/FIRSTSET (KIND=TAPE) MULTI THEN FILEFOUR THEN FILEFIVE THEN FILESIX TO T/SECONDSET (KIND=TAPE);
T/FIRSTSET consists of the records of FILEONE, FILETWO, and FILETHREE. T/SECONDSET consists of the records of FILEFOUR, FILEFIVE, and FILESIX. You can copy either or both files back from the tape by using the following commands:
COPY T/SECONDSET (KIND=TAPE) TO SECONDSET(KIND=PACK, PACKNAME=MYPACK); COPY T/FIRSTSET (KIND=TAPE) MULTI TO FIRSTSET (KIND=PACK, PACKNAME=MYPACK) THEN T/SECONDSET (KIND=TAPE) TO SECONDSET (KIND=PACK, PACKNAME=MYPACK);
You can retrieve individual files that comprise FIRSTSET and SECONDSET only if you specify a record range list.
Example 9
Example 9 creates a single-file unlabeled tape.
COPY FILEONE TO FR;
You might want to copy files to unlabeled tapes if you need to take those tapes to systems other than ClearPath MCP systems that might not be able to read the tape labels produced by ClearPath MCP systems. You can create an unlabeled tape by specifying UL or FR in the output file specification of the COPY command.
If you want DUMPALL to read files from an unlabeled tape, specify UL or FR in the input file portion of the COPY command. FR causes DUMPALL to use only one input tape volume, while UL permits DUMPALL to use more than one input tape volume.
The use of unlabeled input tapes requires greater user involvement, because the only information available to DUMPALL is data separated by tape marks. You cannot use file names to locate the proper input file or files. You might have to use SKIPTM to position the tape to the proper file. You must specify structural file attributes such as FRAMESIZE, MAXRECSIZE, and BLOCKSIZE for each unlabeled input tape file.
If all of FILEONE fits on a single tape volume, use a command in the following format to copy it from tape back to disk:
COPY FR (<file attributes>) TO FILEONE (KIND=PACK, PACKNAME=MYPACK);
If FILEONE is so large that it requires more than one tape volume, use a command in the following format to copy it from tape back to disk:
COPY UL (<file attributes>) TO FILEONE (KIND=PACK, PACKNAME=MYPACK);
In the previous two examples, you must specify file attributes such as FRAMESIZE, MAXRECSIZE, and BLOCKSIZE.
Example 10
Example 10 copies the records of three files to one or more unlabeled tapes:
COPY FILEONE THEN FILETWO THEN FILETHREE TO FR;
When the command has been executed, the file on the tape or tapes contains the records in FILEONE, followed by the records in FILETWO, followed by the records in FILETHREE. To copy the concatenated file back to disk, use the following command:
COPY UL TO ONETWOTHREE (KIND=PACK, PACKNAME=MYPACK);
Example 11
Example 11 creates a multifile, unlabeled tape containing three files:
COPY FILEONE TO UL MULTI THEN FILETWO TO UL MULTI THEN FILETHREE TO UL;
Example 12
Label information is not available when you copy files back from unlabeled tapes. Therefore, you must position the tape at the file or files to be copied. You can copy any number of files from the tape in succession by using one of the following commands:
COPY UL TO FILEONE (KIND=PACK, PACKNAME=MYPACK); COPY UL MULTI TO FILEONE (KIND=PACK, PACKNAME=MYPACK) THEN UL TO FILETWO (KIND=PACK, PACKNAME=MYPACK); COPY UL MULTI TO FILEONE (KIND=PACK, PACKNAME=MYPACK) THEN UL MULTI TO FILETWO (KIND=PACK, PACKNAME=MYPACK) THEN UL TO FILETHREE (KIND=PACK, PACKNAME=MYPACK);
To copy a specific file, you must use the SKIPTM option to position the tape to the desired file. DUMPALL executes the SKIPTM option before it reads the file. To copy the second file on the tape for the previous example, use the following command:
COPY UL SKIPTM 1 TO FILETWO (KIND=PACK, PACKNAME=MYPACK);
At the time DUMPALL executes this command, the operating system has positioned the unlabeled tape so that DUMPALL can read the first record of the first file on the tape. DUMPALL first skips one tape mark. Because the first tape mark is located between the first and second files on the tape, skipping one tape mark positions the tape so that DUMPALL can read the first record of the second file on the tape.
The following example copies files one and three:
COPY UL MULTI TO FILEONE (KIND=PACK, PACKNAME=MYPACK) THEN UL SKIPTM 1 TO FILETHREE (KIND=PACK, PACKNAME=MYPACK);
At the time DUMPALL executes this command, the operating system has positioned the unlabeled tape so that DUMPALL can read the first record of the first file on the tape. DUMPALL reads the first input file—that is, the first file on the tape—and creates the first output file, FILEONE. MULTI indicates that there is a subsequent file to be copied, and so the tape does not rewind. DUMPALL then proceeds to the second input file. Currently, the tape is positioned to read the second file on the tape. The SKIPTM 1 syntax causes DUMPALL to bypass this file to skip one tape mark between files two and three. This action positions the tape at the first record of the third file on the tape. DUMPALL then creates FILETHREE.
Example 13
Example 13 creates a multifile unlabeled tape containing two files:
COPY FILEONE THEN FILETWO THEN FILETHREE TO UL MULTI THEN FILEFOUR THEN FILEFIVE THEN FILESIX TO UL;
The first file is a concatenated file containing the records of FILEONE, followed by those in FILETWO, followed by those in FILETHREE. To copy either or both files back to disk, you can use one of the following three commands:
COPY UL TO ONETWOTHREE (KIND=PACK, PACKNAME=MYPACK); COPY UL TO ONETWOTHREE (KIND=PACK, PACKNAME=MYPACK) MULTI THEN UL TO FOURFIVESIX (KIND=PACK, PACKNAME=MYPACK); COPY UL SKIPTM 1 TO FOURFIVESIX (KIND=PACK, PACKNAME=MYPACK);
You can retrieve the individual files that comprise each of the files on the tape only if you specify a record range list.
Example 14
Example 14 copies the first, fourth, and fifth files from an unlabeled multifile tape, and is limited to a single physical tape:
COPY FR MULTI TO FILEONE (KIND=PACK, PACKNAME=MYPACK) THEN FR MULTI SKIPTM 2 TO FILEFOUR (KIND=PACK, PACKNAME=MYPACK) THEN FR TO FILEFIVE (KIND=PACK, PACKNAME=MYPACK);
Example 15
Example 15 copies the first, fourth, and fifth files from an unlabeled multifile tape. Although UL is used, the tape is limited to a single physical tape, because MULTI and SKIPTM are used.
COPY UL MULTI TO FILEONE (KIND=PACK, PACKNAME=MYPACK) THEN UL MULTI SKIPTM 2 TO FILEFOUR (KIND=PACK, PACKNAME=MYPACK) THEN UL TO FILEFIVE (KIND=PACK, PACKNAME=MYPACK);
Example 16
If you need to copy a file that spans more than one tape volume from unlabeled tapes, and if you need to use SKIPTM to position the input tape to the start of the file, specify the input tape file as though it were two or more input files. Suppose you have copied several files to a two-volume multifile unlabeled tape set. Suppose that while DUMPALL is copying the third file to the tapes, the end of the first volume is reached, and the system switches to the second volume. Then the first part of the third file is on the first volume and the second part of the third file is on the second volume. To copy the entire third file from those tapes to disk, use a command in the following format:
COPY UL SKIPTM 2 (<file attributes>) THEN UL (<file attributes>) TO FILETHREE (DISK);
Example 17
Example 17 copies a file that is contained on one or more tapes to a disk:
COPY UL TO FILEONE (KIND=PACK, PACKNAME=MYPACK);
As each end of tape is reached, the system asks the operator if there are more input tapes.
Example 18
Example 18 duplicates one file from a labeled tape containing the file T/FILEONE:
COPY T/FILEONE (KIND=TAPE) TO T/FILEONE (KIND=TAPE);
To duplicate all or part of a labeled tape, you must specify each input file from the input tape and each output file. The tape can be single-file or multifile.
Example 19
Example 19 duplicates a multifile labeled tape containing the files T/FILEONE, T/FILETWO, and T/FILETHREE:
COPY T/FILEONE (KIND=TAPE) MULTI TO T/FILEONE (KIND=TAPE) MULTI THEN T/FILETWO (KIND=TAPE) MULTI TO T/FILETWO (KIND=TAPE) MULTI THEN T/FILETHREE (KIND=TAPE) TO T/FILETHREE (KIND=TAPE);
Example 20
Example 20 duplicates the first file of an unlabeled tape:
COPY UL (<file attributes>) TO UL;
File attributes include FRAMESIZE, MAXRECSIZE, and BLOCKSIZE. The use of UL for the input file indicates that the input file can be a multivolume file.
To duplicate all or part of an unlabeled tape, you must specify an input file and an output file for each file on the tape to be copied. The tape can be single-file or multifile.
Example 21
Example 21 duplicates the third, fourth, and fifth files of a multifile unlabeled tape:
COPY UL SKIPTM 2 MULTI (<file attributes>) TO UL MULTI THEN UL MULTI (<file attributes>) TO UL MULTI THEN UL (<file attributes>) TO UL;
The use of the SKIPTM 2 option causes the first two files on the tape to be skipped. The file attributes for each input file must include the FRAMESIZE, MAXRECSIZE, and BLOCKSIZE for the file. The use of MULTI in the input file specification causes a subsequent file to be copied from the tape being duplicated; the use of MULTI in the output file specification causes a subsequent file to be copied to the duplicate tape being created. For this example, UL for the input files functions as if it were FR, because MULTI and SKIPTM are being used.
Example 22
Example 22 shows a COPY statement that results in a compressed output tape (as long as the tape drive is compression-capable).
COPY FILEONE (KIND=PACK,PACKNAME=MYPACK) TO T/FILEONE (KIND=TAPE,COMPRESSIONCONTROL=USER, COMPRESSIONREQUESTED=TRUE);
Example 23
Example 23 shows a COPY statement that results in a noncompressed output tape.
COPY FILEONE (KIND=PACK,PACKNAME=MYPACK) TO T/FILEONE (KIND=TAPE,COMPRESSIONCONTROL=USER, COMPRESSIONREQUESTED=FALSE);
Considerations for Use
Except for file attributes you explicitly specify for the output file, the attributes for the output file are determined as follows:
-
Some of the file attributes, such as BLOCKSIZE and MAXRECSIZE, of the output file are set to the same values as those of the input file.
-
Other file attributes, such as CREATIONDATE and TIMESTAMP, receive new values.
-
Some attributes, such as USERINFO, FILESTRUCTURE, and CRUNCHED, are not preserved in the output file; these attributes get default values.
-
Some attributes, such as AREASIZE and FILEKIND of disk files, are given default values unless the input file is being copied from disk.
-
You can copy these input files to an output file with a FILEORGANIZATION attribute value of INDEXED or INDEXEDNOTRESTRICTED if the system option KEYEDIOII is reset to FALSE.
If you use the COPY command to copy a code file, the resulting file has a FILEKIND attribute equal to DATA.
You can use the COPY command to copy certain ISAM files, but many restrictions exist.
-
You cannot use DUMPALL to copy files with a FILEORGANIZATION attribute equal to KEYEDIOII or KEYEDIOIISET. To copy KEYEDIOII and KEYEDIOIISET files, use the KEYEDIOII Copy Utility described in the KEYEDIOII Reference Manual.
-
You can use DUMPALL to copy an input file with a FILEORGANIZATION attribute value equal to INDEXED or INDEXEDNOTRESTRICTED. DUMPALL does not copy any records that have been marked as deleted from these files. You can copy these files to output files that have the FILEORGANIZATION value equal to NOTRESTRICTED, INDEXED, or INDEXEDNOTRESTRICTED. You can copy such input files to files that are not ISAM files by
-
Specifying that the output file has a FILEORGANIZATION attribute value equal to NOTRESTRICTED.
-
Copying the files to media other than disk. For example, you can copy them to tape.
-