You can use the following commands with the COPYV2A utility:
-
COPY or ADD
-
DIR
Syntax diagrams follow for each of these statements.
COPY or ADD Command
Use the COPY statement to copy files from a specified tape to a specified family. Use the ADD statement to copy only files from a specified tape that do not already exist on the specified family.
Syntax
COPY or ADD
──┬─ COPY ─┬─<file spec>── FROM ──<tape spec>─┬───────────────────┬────┤ └─ ADD ──┘ └─ TO ──<pack spec>─┘
<file spec>
──<filename>─┬──────────────────────┬─┬────────────────────────┬───────┤ └─ EXCEPT ──<filename>─┘ └─ AS ──<directory name>─┘
<filename>
Any valid V Series filename. The name can include masks. For example, filename ABCDEF can also be specified as AB=, A==DEF, or =====F.
<tape spec>
──<tapename>─┬──────────┬──────────────────────────────────────────────┤ └─ (TAPE) ─┘
<pack spec>
──<familyname>─┬──────────┬─┬──────────────────┬───────────────────────┤ └─ (PACK) ─┘ └─ : ──<file type>─┘
<file type>
A unique identification of a file type. The following table shows the list of valid file types and their minimum abbreviations:
FILEKIND Type |
Abbreviation |
---|---|
ALGOLSYMBOL |
A |
BINDERSYMBOL |
B |
COBOL |
C |
COBOL74 |
C74 |
COBOL85 |
C85 |
FORTRAN77 |
F77,F |
PASCAL |
P |
DASDL |
D |
TEXT |
T |
SEQDATA |
S |
RPG |
R |
JOB |
J,W,WFL |
DATA |
DAT (default) |
Explanation
COPY <filename> FROM <tapename>(TAPE)
Copies files from a specified tape.
ADD <filename> FROM <tapename>(TAPE)
Copies only specified files from the specified tape.
COPY <filename> FROM <tapename>(TAPE) TO <familyname>(PACK)
COPY <filename> FROM <tapename>(TAPE) TO <familyname>(PACK): <type>
Copies files from a specified tape to a specified family. You also have the ability to specify the FILEKIND with the <type> option.
ADD <filename> FROM <tapename>(TAPE) to <familyname>(PACK)
ADD <filename> FROM <tapename>(TAPE) to <familyname>(PACK): <type>
Copies only files from the specified tape that do not already exist on the specified family. You also have the ability to specify the FILEKIND with the <type> option.
COPY <filename> EXCEPT <filename> FROM <tapename>(TAPE)
Copies files other than those in the exception parameter from a specified tape to your default family.
ADD <filename> EXCEPT <filename> FROM <tapename>(TAPE)
Copies only specified files other than those in the exception parameter from the specified tape.
COPY <filename> AS <directory name> FROM <tapename>(TAPE)
Copies files from a specified tape to your default family. If the directory name ends in a hyphen(-), refer to “Considerations for Use.”
ADD <filename> AS <directory name> FROM <tapename>(TAPE)
Copies only specified files that are not already resident from a specified tape to your default family. If the directory name ends in a hyphen(-), refer to “Considerations for Use.”
COPY <filename> EXCEPT <filename> AS <directory name> FROM <tapename> (TAPE)
Copies other than those in the exception parameter from the specified tape to your default family. If the directory name ends in a hyphen(-), refer to “Considerations for Use.”
ADD <filename> EXCEPT <filename> AS <directory name> FROM <tapename> (TAPE)
Copies only specified files other than those in the exception parameter that are not already resident from the specified tape to your default family. If the directory name ends in a hyphen(-), refer to “Considerations for Use.”
COPY <filename> EXCEPT <filename> FROM <tapename>(TAPE) TO <familyname>(PACK): <type>
Copies files other than those in the exception parameter from a specified tape to a specified family. You also have the ability to specify the FILEKIND with the <type> option.
COPY <filename> AS <directory name> FROM <tapename>(TAPE) TO <familyname>(PACK): <type>
Copies files as <directory name>/<file name> from a specified tape to a specified family. You also have the ability to specify the FILEKIND with the <type> option. If the directory name ends in a hyphen(-), refer to “Considerations for Use.”
COPY <filename> EXCEPT <filename> AS <directory name> FROM <tapename>(TAPE) TO <familyname>(PACK): <type>
Copies files other than those in the exception parameter as <directory name>/<file name> from a specified tape to a specified family. You also have the ability to specify the FILEKIND with the <type> option. If the directory name ends in a hyphen(-), refer to “Considerations for Use.”
ADD <filename> EXCEPT <filename> FROM <tapename>(TAPE) TO <familyname>(PACK)
ADD <filename> EXCEPT <filename> FROM <tapename>(TAPE) TO <familyname>(PACK): <type>
Copies only files other than those in the exception parameter from the specified tape that do not already exist on the specified family. You also have the ability to specify the FILEKIND with the <type> option.
ADD <filename> AS <directory name> FROM <tapename>(TAPE) TO <familyname>(PACK)
ADD <filename> AS <directory name> FROM <tapename>(TAPE) TO <familyname>(PACK): <type>
Copies only specified files as <directory name>/<file name> from the specified tape that do not already exist on the specified family. If the directory name ends in a hyphen(-), refer to “Considerations for Use.” You also have the ability to specify the FILEKIND with the <type> option.
ADD <filename> EXCEPT <filename> AS <directory name> FROM <tapename>(TAPE) TO <familyname>(PACK)
ADD <filename> EXCEPT <filename> AS <directory name> FROM <tapename>(TAPE) TO <familyname>(PACK): <type>
Copies only files other than those in the exception parameter as <directory name>/<file name> from the specified tape that do not already exist on the specified family. If the directory name ends in a hyphen(-), refer to “Considerations for Use.” You also have the ability to specify the FILEKIND with the <type> option.
Example 1
This example shows two methods for copying the file CRES01 as SRC/C74/CRES01 from the tape SOURCE to the pack USERS. The file KIND is COBOL74SYMBOL.
U *SYSTEM/EVA/COPYV2A COPY C= AS SRC/C74 FROM SOURCE(TAPE) TO USERS(PACK): C74 RUN *SYSTEM/EVA/COPYV2A ("COPY C= AS SRC/C74 FROM SOURCE(TAPE) TO USERS(PACK): C74")
Example 2
This example shows two methods for copying the file AP0001 as DAT/ACCTS/AP0001 from the tape DATA to the pack USERS. The file KIND is DATA.
U *SYSTEM/EVA/COPYV2A COPY AP= AS DAT/ACCTS FROM DATA(TAPE) TO USERS(PACK) RUN *SYSTEM/EVA/COPYV2A ("COPY AP= AS DAT/ACCTS FROM DATA(TAPE) TO USERS(PACK)")
Example 3
This example shows two methods for copying the file AP0001 as DAT/ACCTS/AP0001 but not the file AP0032 from the tape DATA to the pack USERS. The file KIND is DATA.
U *SYSTEM/EVA/COPYV2A COPY AP= EXCEPT AP==3= AS DAT/ACCTS FROM DATA(TAPE) TO USERS(PACK) RUN *SYSTEM/EVA/COPYV2A ("COPY AP= EXCEPT AP==3= AS DAT/ACCTS FROM DATA(TAPE) TO USERS(PACK)")
Example 4
This example shows two methods for copying files beginning with the letter A, except for those beginning with the letters AB, to a directory named DAT and a subdirectory named ACCTS from the tape DATA to the pack USERS. These files have not previously been copied to an MCP disk pack. The file KIND is DATA.
U *SYSTEM/EVA/COPYV2A ADD A= EXCEPT AB= AS DAT/ACCTS FROM DATA(TAPE) TO USERS(PACK) RUN *SYSTEM/EVA/COPYV2A ("ADD A= EXCEPT AB= AS DAT/ACCTS FROM DATA(TAPE) TO USERS(PACK)")
Considerations for Use
COPY <filename> AS <directory name> Considerations
If the directory name ends in a hyphen(-), the file name is appended to the directory name. For example, if you enter COPY FILE1 as AB/C-, the utility creates a file structure named AB/C-FILE1 instead of AB/C/FILE1.
Duplicate File Names
Occasionally you might create a tape that contains two files with the same name. The utility handles this situation by adding a numeric extension to the end of the file name. The first file is named <filename>/1, the second file name is named <filename>/2, and so on.
Special Characters in File Names
The V Series file management system permits numerous special characters within file names. Lower case characters are frequently used. MCP file names allow some special characters such as hyphens (-) and underscores (_), but other special characters such as lower case characters, require that the file name be enclosed in quotation marks ("), and the quotation marks become part of the file name.
To avoid the use of quotation marks when you migrate files from the V Series system to the MCP system, the utility translates lower case characters to upper case characters. Other special characters such as the colon (:), plus sign (+), and percent sign (%), are translated to an underscore. In some cases, this process can result in the creation of duplicate file names.
When you generate a directory of the tape by using the DIR/SPO or DIR/PRN syntax, the utility displays the original V Series file name. The translation occurs during the selection process and when the file is actually copied.
Blocksize Differences
V series supports a greater block size for files than does MCP. If you use the COPYV2A utility to copy a V series file that has a larger block size than the maximum allowed in MCP, the block size of the file being copied will be reduced to the first possible multiple of the file's record size below the MCP maximum block size, and the following message will be displayed:
BLOCKSIZE TOO LARGE FOR <file name>; REDUCED TO <blocksize> BYTES
DIR Command
Use the DIR statement to display or print a directory of file names.
Syntax
DIR
── DIR ─┬─ /PRN ─┬─<directory file spec>── ON ──<tape spec>────────────┤ └─ /SPO ─┘
<directory file spec>
──<filename>─┬──────────────────────┬──────────────────────────────────┤ └─ EXCEPT ──<filename>─┘
<tape spec>
──<tapename>─┬──────────┬──────────────────────────────────────────────┤ └─ (TAPE) ─┘
Explanation
DIR/PRN <filename> ON <tapename>(TAPE)
Prints a directory of the specified file names that are on the specified tape.
DIR/SPO <filename> ON <tapename>(TAPE)
Displays a directory of the specified file names that are on the specified tape.
DIR/PRN <filename> EXCEPT <filename>(TAPE)
Prints a directory of the specified file names except for the specified file names that are on the specified tape.
DIR/SPO <filename> EXCEPT <filename> on <tapename>(TAPE)
Displays a directory of the specified file names except for the specified file names that are on the specified tape.
Example
This example shows two ways to display on the screen all files that have s as the second character on the tape SOURCES.
U *SYSTEM/EVA/COPYV2A DIR/SPO =s= SOURCES(TAPE) RUN *SYSTEM/EVA/COPYV2A ("DIR/SPO =s= SOURCES(TAPE)")