The steps required to reorganize a KSAM ￿le are:

1.Use KSAMUTIL to build a new KSAM ￿le with new k ey ￿elds.

2.Use FCOPY to copy the old KSAM ￿le to the new one, specifying whic hever key in the old ￿le is the primary k ey in the new ￿le.

3.Use KSAMUTIL to purge the old ￿le and rename the new cop y to the old ￿le name. Figure 7-3 shows an example of reorganizing a KSAM ￿le.

Figure 7-3. Reorganizing a KSAM File

KSAM procedures

KSAM procedures allow y ou to programmatically add, delete, read, and update KSAM ￿les. The procedures vary depending on the language in whic h the program is written. Y ou can access KSAM ￿les through KSAM procedures in the nativ e languages that run on the 900 Series HP 3000:

HP C/iX

COBOL II/XL

HP FORTRAN 77/iX, through calls to in trinsics (for example, HPFOPEN and FOPEN).

HP Pascal/iX, through calls to in trinsics (for example, HPFOPEN and FOPEN).

For detailed information on using KSAM procedures in HP C/iX, HP P ascal/iX, HP COBOL II/XL, and HP FORTRAN 77/iX, refer to KSAM/V Reference Manual (30000-90079).

Data Management 7-5