Using KSAM/XL and KSAM 64 (32650-90886)

Chapter 2 25
Creating a KSAM File
Loading Data to a KSAM64 File
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.
>FROM=ARMSTR.MGR.AR;TO=(ARMBACK.MGR.AR)
Loading Data to a KSAM64 File
The FCOPY utility is also used to load data to a KSAM64 file. In order to copy data to a
KSAM64 file, a file equation must first be referenced which specifies the KSAM64 file type
For example:
:FILE NEWKSM64; KSAM64
:FCOPY FROM=OLDKSMXL; TO=(*NEWKSM64)
In the example above, the file equation overrides the FCOPY default of creating a KSAM
XL file.
This example also could be used to copy data from a CM KSAM file, or any other FROM file
type.
The FCOPY utility can also be used to retrieve data from a KSAM64 file (use the KSAM64
file as the FROM file) and to copy to a KSAM64 file with different attributes. The following
example shows how a new larger KSAM64 file can be created from an existing, smaller
KSAM64 file
:FILE DATANEW; KSAM64; DISC=1000000000