Once the file has been created, you can load it with data
from another file or from a program. The FCOPY subsystem is often
used to load data from one file to another. Any type of file can
be used as the input file for this process. FCOPY is executed by
entering the subsystem name. It displays a prompt (>) while
awaiting input.
:FCOPY
>
The FROM= command identifies the source file containing the data to be
copied. The TO= parameter specifies the target file to which the data
will be copied. The following example copies the existing master file records
contained in OLDMSTR to the newly created KSAM XL file,
ARMSTR.
>FROM=OLDMSTR.MGR.AR;TO=(ARMSTR.MGR.AR)
The FCOPY subsystem can also be used to copy a KSAM XL file's records in a
different sequence. The KEY= parameter identifies the relative record
location of the key to be used to establish the new sequence of records.
The following example copies records from the old master file to
the new file in alphabetical order by client name. The location
of the client name field (10) is identified in the KEY= parameter.
>FROM=OLDMSTR.MGR.AR;TO=ARMSTR.MGR.AR;KEY=10
The FCOPY subsystem can create a new KSAM XL file if the source
file is a KSAM XL file and if no file characteristics need to be
changed. To identify the type of file to be built as a KSAM XL file,
the name is enclosed in parentheses. If the parentheses are not
included, a standard file type is created.
The following example creates a new master file, duplicating the file and key
specifications from the original file ARMSTR. Note that the file name
is enclosed in parentheses, identifying the file type of the new file as a KSAM
XL file type.