kgetpos -- Return Position Information for VSAM File

SYNOPSIS

 #include <lcio.h>

 int kgetpos(FILE *f, fpos_t *pos);
 

DESCRIPTION

The kgetpos function determines the file position of the current record of the keyed stream associated with the FILE object addressed by f and stores it in the object addressed by pos. This object is of type fpos_t, which is defined in <stdio.h>. If no current record is defined when kgetpos is called, kgetpos fails.

The fpos_t type is composed of two fields, _recaddr and _offset. The file position returned by kgetpos has the control interval number for the current record in _recaddr, and the offset of the record in the control interval in _offset.

RETURN VALUES

The kgetpos function returns 0 if successful, or a negative number if an error occurred.

CAUTION

The position of a record changes due to file updates. Therefore, you should not record file positions for later use, unless the file contents are not subject to change.

RELATED FUNCTIONS

fgetpos

SEE ALSO


Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.