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

24 Chapter2
Creating a KSAM File
Loading Data to a KSAM XL File
Figure 2-6. Building the AR Master KSAM64 File
Specifying an Indirect File
To reduce errors, the characteristics for key data fields can be contained in an indirect file
and referred to in the BUILD command. Such a file can be created using an editor, such as
HP EDIT. The information is structured as it would be if it were included in the command.
The format of the key data in the indirect file is shown in the following example.
(N,4,6;&
B,10,25,RDUP;&
N,65,5,RDUP;&
B,70,3,RDUP)
Figure 2-7. shows the command for setting up the same accounts receivable master file as
in Figure 2-5.. The KEY= parameter, however, refers to the indirect file named KEYDATA for
the key data specifications. The character ^ specifies that an indirect file contains the data.
Figure 2-7. Using a Key Data File to Create a KSAM XL File
Figure 2-8. Using a Key Data File to Create a KSAM 64 File
Loading Data to a KSAM XL File
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
:BUILD ARMSTR64.MGR.AR;REC=-80,,F,ASCII;&
DEV=DISC;DISC=100;KSAM64;&
KEY=(N,4,6;& Specifies account number (primary) key
B,10,25,RDUP;& Defines the last name key
N,65,5,RDUP;& Defines the zip code key
B,70,3,RDUP);& Defines the branch ID key
FIRSTREC=1;REUSE ;LANG=5 Specifies that the first record is
identified by number 1,
that deleted record space can be reused,
and that the native language is English.
:BUILD ARMSTRXL.MGR.AR;REC=-80,,F,ASCII;DEV=DISC;&
DISC=100;KSAMXL;KEY=^KEYDATA;&
FIRSTREC=1;REUSE ;LANG=5
:BUILD ARMSTR64.MGR.AR;REC=-80,,F,ASCII;DEV=DISC;&
DISC=100;KSAMXL;KEY=^KEYDATA;&
FIRSTREC=1;REUSE ;LANG=5