COPYFILE If you want to copy all the files on a particular disk to another
disk, you could enter:
copyfile * * b = = a
All the files on the B-disk are copied to the A-disk. The filenames and
filetypes remain unchanged. You can also copy a group of files and change all the filenames or
all the filetypes. For example:
copy file * assemble b = test a
copies all ASSEMBLE TEST on the A-disk.
files in the B-disk into files with a filetype of
The filenames are not changed. You can use the SINGLE option to override multiple output mode. For
example:
copyfile * test a = = B (single
copies all files on the A-disk with a filetype of TEST to the B-disk as
one combined file, with the filename and filetype equal to the first
input file found. Whenever an asterisk appears, it indicates that all files are to be
copied; whenever an equal sign (=) appears, it indicates that the same
files are to be copied. For example:
copyfile x * al = file =
combines all files with a filename of X on the A-disk into a single file
named X FILE Al. Whenever an equal sign appears in the output fileid in a position
corresponding to an asterisk in an inputfileid, multiple input files
produce multiple output files. When you perform copy operations of this
nature you might wish to use the TYPE option, which displays the names
of files being copied. For example:
copvfile * test a = output a = summary = (type
might result in the display: COpy I ALPHA TEST A l' TO 'ALPHA SUMr!ARY A" (NEW FILE) COPY 'ALPHA OUTPUT A' COPY 'BETA TEST A 1 I TO 'BETA SUJ!IIJ!IIARY A" (NEW FILE) COPY 'BETA OUTPUT A.'
which indicates that files ALPHA TEST A and ALPHA OUTPUT A were copied
into a file named ALPHA SUr!MARY A and that files BETA TEST A and BETA OUTPUT A were copied into a file named BETA SUMMARY A. You can use the RECFM and LRECL options to change the record format of a
file as you copy it. For example:
copyfi1e data file a (recfm f lrec1 130 converts the file DATA FILE Al to fixed-length 130-character records. 40 IBM VM/370 eMS Command and Eacro Reference
COPYFILE If you specify an output fileid r for example:
copyfile data file a fix data file a (recfm f lrecl 130 the original file remains unchanged. The file FIXDATA FILE A contains
the converted records. -
If the records in a file being copied are variable-length, each
output record is padded with blanks to the specified record length. If any records are longer than the record length, they are truncated. When vou convert files from fixed-length records to variable-length
records, you can specify the TRUNC option to ensure that all trailing
blanks are truncated:
copyfile data file a (recfm v trunc
If you specify the LRECL option and RECFM V, the LRECL option is
ignored and the output record length is taken from the longest record in
the input file.
When you convert a file from variable-length to fixed-length records,
you may also specify a fill character to be used foe padding instead of
a blank. If you specify: copvfile short recs a (recfm f fill *
then each record recoed length.
variable-length existinq record. not altered.
in the file SHORT RECS is padded with asterisks to the
Assuming that SHORT RECS was originally a
file, the record length is taken from the longest
Note that if SHORT RECS is already fixed-length, it is Similarly, when you are converting back to variable-length a file
that was padded with a character other than a blank, you must specify
the FILL option to indicate the pad character, so that character is
truncated.
The FILL option can also be used to specify the packing character
used with the PACK option. When you use the PACK option, a file is
compressed as follows: all occurrences of two or more blanks are
encoded as one character, and four or more occureences of any other
character are written as three characters. If you use the FILL option
to specify a fill character, then that character is treated as a blank
when records are compressed. You do not need to specify the fill
character when you unpack the file since this is determined from the
filels pack record. If the fill character is specified, it is ignored. Since most fixed-length files are blank-padded to the record length, you
do not need to specify the FILL option unless you know that some other
character appears more frequently.
When you convert record formats on packed files with the COPYFILE command vou can specify single or multiple output files, in accordance with the procedures outlined under "Modifying Record Formatse" For
example: copyfile * assemble a (pack
compresses all ASSEMBLE files in the A-disk without changing any file
identifiers. The command:
copyfile * assemble a = script = (recfm trunc
converts all ASSEMBLE files to variable-length, and changes their
filetypes to SCRIPT. section 2. eMS Commands 41
Previous Page Next Page