COPYFILE When yoa use the COPYFILE command, you can specify particular columns of
data to be manipulated or particular characters to be translated.
Again, how you specify the file identifier determines how many file$ are
copied or modified. When you use the SPECS option on the COPYFILE command, you receive
the message: DMSCPY601R ENTER SPECIFICATION LIST: and a read is presented to your virtual machine and you may enter a
specification list. If you do not wish to receive this message, use the NOPROMPT option. The specification list you enter may consist of one or
more pairs of operands in the following format:
{
nn-mm }
/string/ hxx ••• col
nn-mm specifies the start and end columns of the input file that are to
be copied to the output file. If mm exceeds the length of the
input record, the end of the record is the assumed ending
position.
string is any string of uppercase and lowercase characters or numbers ielimited by any non-alphameric character.
hxx .•. is an even number of hexadecimal digits prefixed with an h.
col is the column in the output file at which the copy operation is
to begin. You can enter as many as 20 pairs of specifications. If you want to
enter more than one line of specifications, enter two plas signs (++? as
continuation indicators.
A specification list may contain any combination of specification
pairs; for example:
copyfile sorted list a (specs DMSCPY601R ENTER SPECIFICATION LIST: 11/ 1 1-8 3 III 12 1***1 14 ++ 18
After this command is executed, each record in the file SORTED LIST will look like the following: I 00000000 I *** 0000 •••• where the a's in columns 3 through 10 indicate information originally in
columns 1 through 8; the o's following the asterisks indicate the
remainder of each record, columns 9 through 80. When you enter a specification list, you are actually constructing a
file column by column. If you specify multiple input or output files,
the same copy operation is performed for each record in each output file.
42 IBM VM/370 eMS Command and Macro Reference
COPYFILE Those columns for which you do not specify any data are filled with
blanks or, if you use the FILL option, the fill character of your
choice. For example:
coPvfile sorted list a (specs noprompt lrecl 20 fill $
1-15 6
copies columns 1 through 15 beginning in column 6 and writes dollar
signs ($) in columns 1 through 5.
If you do want to modify data in particular columns of a file but
want to leave all of the rest of each record unchanged, you can use the OVLY (overlay) option. For example, the sequence: COPYFILE * bracket a (specs ovly noprompt had 1 hbd 80 overlays the characters [ (X' AD') and ] (X' BD') in columns 1 and 80 of
all the files with a filetype of BRACKET on your A-disk. When you copy fixed-length files, records
the record length; variable-length files
specified.
are padded or truncated to
are always written as You can perform conversion on particular characters in CMS files or
groups of files with the TRANS option of the COPYFILE command. When you enter the TRANS option, you receive the message: DMSCPY602R ENTER TRANSLATION LIST:
and a read is presented to your virtual machine. You may enter the
translation list. If you do not wish to receive this message, use the NO PROMPT option.
A translation list consists of one or more pairs of characters or hex
digits, each pair representing the character you want to translate and
the character you want to translate it to, respectively. For example:
copy test file a (trans DMSCPY602R ENTER TRANSLATION LIST:
* -A fO 00 ff
specifies that all occurrences of the character * are to be translated
to -, all A's are to be translated to X'FO' and all X'OO's are
to be translated to X'FF's. If any translation specifications you enter conflict with the LOWCASE, EBCDIC, or OPCASE options specified on the same command line,
the translation list takes precedence. In the preceding example, if LOWCASE had also been specified, all A's would be translated to X'FO's, :not "to a's. You can enter translation pairs on more than one line if you enter a
++ as a continuation indicator.
Section 2. CMS Commands 43
Previous Page Next Page