FCOPY Reference Manual (32212-90008)

28 Chapter3
FCOPY Applications and Examples
Copying Files
Copying Files
You can use FCOPY to create new files, append one or more files onto an existing file, or
extract portions from files.
New Disk Files
To create a new disk file as you copy information to it, use the NEW function. For example,
>FROM=OLDDATA;TO=NEWDATA;NEW
In this example, the new file called NEWDATA has the default file characteristics described
in appendix B and exists in the current account and group.
Appending Files
Often you need to string several files together. Use FCOPY to append a file to another as
follows:
1. Use the MPE FILE command to give the tofile append access (ACC=APPEND), and set its
limit large enough to hold the contents of all the files you are appending to it.
For example,
>:FILE INFO3;REC=-80,10,F,ASCII;ACC=APPEND;DISC=500,2
Refer to the MPE File System Reference Manual (30000-90236) for MPE V/E or the
Accessing Files Programmers Guide (32650-90017) for MPE XL for instructions on
calculating the amount of file space you would require.
2. Copy the first file you want to append to the tofile. Type an asterisk in front of the tofile
name to use the file characteristics described in the preceding FILE command instead
of the default file characteristics. If the tofile is new, use the NEW function. For example,
>FROM=INFO1;TO=*INFO3;NEW
The system responds with the following message:
EOF FOUND IN FROMFILE AFTER RECORD 19
20 RECORDS PROCESSED * * * 0 ERRORS
3. Copy any subsequent files in the order you want to append them. Use an asterisk alone
to reuse the tofile in the previous command. For example,
>FROM=INFO2;TO=*
EOF FOUND IN FROMFILE AFTER RECORD 24
25 RECORDS PROCESSED * * * 0 ERRORS