HP 3000 Manuals

WRITING TO A KSAM FILE [ KSAM/3000 Reference Manual ] MPE/iX 5.0 Documentation


KSAM/3000 Reference Manual

WRITING TO A KSAM FILE 

Once a KSAM file has been created and opened for output access, you can
write to the file with a call to FWRITE or a call to CKWRITE. You may
choose to write records in primary key sequence and have that sequence
checked.  To do this, you can open the file for sequential access with
CKOPEN or else call FOPEN with bit 13 of the flagword in ksamparam set to
1.  If the sequence in which records are written doesn't matter, you can
open the file for random access in COBOL or open the file by calling
FOPEN with bit 13 of the ksamparam flagword cleared to zero.

The example in Figure 5-1 uses FWRITE to write records to the KSAM file
in the order in which they are read from the standard input device; they
are not written in primary key order.

Since duplicate primary keys are never allowed by the COBOL KSAM
procedures, you should use the file system intrinsics if you want to
allow duplicate primary keys.  Duplicate alternate keys are allowed by
both the file system and COBOL if so specified when the file was created.



MPE/iX 5.0 Documentation