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

FILETABLE

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

previous operation

A code in the right byte of word 8 of the file table indicating the previous successful operation:

  • 0 = previous operation unsuccessful or there has been no previous operation on this file

  • 1 = CKOPEN successful

  • 2 = CKSTART successful

  • 3 = CKREAD successful

  • 4 = CKREADBYKEY successful

  • 5 = CKDELETE successful

  • 6 = CKWRITE successful

  • 7 = CKREWRITE successful

  • 8 = CKCLOSE successful

  • 9 = CKOPENSHR

This field should be set to zero when the file table is initially defined and thereafter should not be altered by the programmer. It must be defined as a COMPUTATIONAL item.

lock/unlock

A code in the left byte of word 8 of the file table that indicates whether a CKLOCK or CKUNLOCK has been performed successfully since the operation specified in previous operation:

  • 10 = CKLOCK successful

  • 11 = CKUNLOCK successful

EXAMPLE

A sample file table definition might be:

   WORKING-STORAGE SECTION. 



   01 KSAM FILE. 

   02 FILENUMBER     PIC S9(4) COMP VALUE 0. 

   02 FILENAME       PIC X(8) VALUE "KSAMFILE". 

   02 I-O-TYPE       PIC S9(4) COMP VALUE 0. 

   02 A-MODE         PIC S9(4) COMP VALUE 0. 

   02 PREV-0P        PIC S9(4) COMP VALUE 0. 

The file table identifies a file created with the name KSAMFILE as a file to be opened for sequential input only. The values of I-O-TYPE and A-MODE can be changed following a call to CKCLOSE for the file.

Feedback to webmaster