Top
NetCOBOL V11.0 COBOL File Access RoutinesUser's Guide
FUJITSU Software

3.6 cobfa_indexinfo()

Get the file attributes or key structure of an indexed file.

long  cobfa_indexinfo  (
  long  fd,                    /* file descriptor                 */
  struct fa_keydesc  *buffer,  /* acquisition result storage area */
  long  funccode               /* function code                   */
);

Description

Information on the indexed file indicated by the file descriptor <fd> is set in the acquisition result storage area <buffer>. The file be open prior to execution of this function.

Select the type of information to be acquired by specifying it in the function code <funccode>.

Retrieving File Attributes

To retrieve the attributes of an indexed file, specify 0 for funccode. The struct fa_dictinfo type file attribute is stored in the acquisition result storage area. For the struct fa_dictinfo type, see "4.1.3 struct fa_dictinfo".

Retrieving Key Structures

To retrieve the key structure of an indexed file, specify 1 or greater for funccode. Keys are numbered sequentially, starting with 1 for the primary key. The struct fa_keydesc type is stored in the area pointed to by the acquisition result storage area.

If 1 is specified as the funccode value, the primary record key list is acquired. If 2 or greater is specified, the alternate record key list is acquired. This list order corresponds to the order in which alternate record keys were declared when the indexed file was created. For the struct fa_keydesc type, see "4.1.1 struct fa_keydesc".

Execution Conditions

File Organization

Sequential file

-

Record sequential file

-

Relative file

-

Indexed file

Executable

Open Mode

INPUT mode

Executable

OUTPUT mode

Executable

I-O mode

Executable

EXTEND mode

Executable

Access Mode

Sequential

Executable

Random

Executable

Dynamic

Executable

Return Values

0: Successful

Function executed successfully

-1: Failed

Function failed. To get extended error information, call the cobfa_errno or cobfa_stat functions

Generated Status

Return value of cobfa_errno ()

Return value of cobfa_stat ()

Successful

FA_ENOERR

0

Function executed successfully

Failure (not all)

FA_ENOTOPEN

90

An invalid file descriptor is specified

FA_EBADACC

90

The specified file is not an indexed file