HPlogo KSAM/3000 Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 5 USING KSAM FILES IN FORTRAN PROGRAMS

WRITING TO A KSAM FILE

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

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 “Creating and Writing to KSAM File in FORTRAN” 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.

Feedback to webmaster