The KSAMUTIL command BUILD requires the follo wing parameters: Data ￿le name. Key ￿le name. One or more key types, with corresponding k ey location, and k ey size.

The ￿rst key speci￿ed becomes the primary k ey. Each subsequent key speci￿ed becomes an alternate key. Notice in the example that the ￿rst alternate k ey allows records to ha ve duplicate values in that ￿eld. The fourth subparameter of the KEY ￿eld is the key blocking factor. Default bloc king is one record per bloc k, which usually results in w asted disc space. You can ￿nd the bloc king factor by dividing the sector size (256) b y the record length and then rounding do wn.

FCOPY (KSAM Options)

You can use FCOPY with KSAM options that mak e it perform correctly for a KSAM ￿le instead of an MPE/iX ￿le. F COPY provides many ￿le manipulation services. F or example, you can use it to:

Load a KSAM ￿le by copying data from an MPE/iX or a KSAM ￿le in to a KSAM ￿le.

Reorganize a KSAM ￿le b y building another KSAM ￿le with k eys speci￿ed in a di￿eren t order and copying the old KSAM ￿le in to the newly built one.

Convert an ISAM (Indexed Sequen tial Access Method) ￿le to a KSAM ￿le b y building a KSAM ￿le and copying the magnetic tape con taining the ISAM ￿le data to the newly built KSAM ￿le.

Copy only active KSAM records (data records that are not logically deleted b y having a ￿ag in the ￿rst word). This feature allo ws you to physically delete KSAM records from a ￿le and compact the ￿le size. F COPY defaults to cop ying only active records unless y ou specify otherwise.

Recover logically deleted records b y using the :NOKSAM option.

Write logically deleted records to a separate ￿le b y using the :NOKSAM option and specifying ;SUBSET=#%377,%377#,1 .

Write any KSAM ￿le to $STDLIST or a line printer. Thus, during a session, y ou can either display the ￿le on the terminal or list it out on a line prin ter. During a job, y ou can list it on a line printer.

Copy data in a KSAM ￿le to an MPE/iX ￿le in c hronological, primary , or alternate k ey sequence.

Recover corrupt key ￿les or ￿les with missing k ey ￿les.

Recover anomalies resulting from system in terrupts by specifying ;KEY=0 . The FCOPY utility has three KSAM options:

;KEY=nn

-if omitted, copies in primary k ey sequence, retaining old k ey trees.-if nn=0, copies in chronological sequence and rebuilds k ey trees.

-if nn>0, copies in sequence b y key number nn, where the key numbers are assigned in order of occurrence.

Data Management 7-3