MemCom Reference Manual > MemCom (Old) Fortran77 API > Database Manager Functions > lgtdb

Name

lgtdb — Inquire attributes of dataset

Synopsis

subroutine lgtdb(handle,name,idiv,woffset,ndiv,ldiv,size)
integer*4 handle
integer*4 idiv
integer*4 woffset
integer*4 ndiv
integer*4 ldiv
integer*4 size

subroutine lgtdb64(handle,name,idiv,woffset64,ndiv,ldiv,size)
integer*4 handle
integer*4 idiv
integer*8 woffset64
integer*4 ndiv
integer*4 ldiv
integer*4 size

Description

lgtdb returns the size attributes of a dataset described by name and sub-division index. It returns the file offset, the dataset size, the number of sub-divisions, and the length of a sub-division of the dataset described by its name. If the set has no sub-divisions, number of sub-divisions is returned as 0, and the length of a sub-division is set to the set size. The argument idiv is ignored and remains for compatibility with version 6. To get the dataset type, use prpdb.

lgtdb64 is equivalent to lgtdb, except that the file offset is returned in an integer*8 variable. prdpdb64 also works in a 32bit environment.

To check if a dataset exists on the database, make use of inqsdb.

[Warning]Warning

(1) For compatibility reasons with MemCom 6, lgtdb works with addresses counted in integer*4 words (not bytes!) and starting at word count 1. (2) For compatibility reasons with older versions of the F77 API the offset returned by this function is a 32 bit entity (integer*4) and therefore may give wrong results for 64 bit operating system. To remedy this, a 64bit version lgtdb64 has been added.

Parameters

handle

Database handle (input). The file handle handle may not exceed the maximum number of simultaneously open databases.

name

Name of dataset (input). The string may not exceed the maximum dataset name length.

idiv

Sub-division number (input). idiv must be greater than or equal to 0.

woffset

File offset of dataset (output), expressed in number of integer*4 word units, the file offset count starting at 1. A value of -1 is returned if the set or the sub-set does not exist.

woffset64

File offset of dataset (output), expressed in number of integer*4 word units, the file offset count starting at 1. A value of -1 is returned if the set or the sub-set does not exist.

ndiv

Number of sub-divisions of the set (output). If the dataset is sub-divided, ndiv > 0 is returned. Otherwise ndiv = 0 is returned. A value of 0 is returned if the dataset or the sub-set does not exist.

ldiv

Size of a sub-division of the set (output). The size is expressed in data elements, except for relational tables (datasets of type $), where ldiv is expressed in integer*4 words. ldiv is set to size if the set is not sub-divided. A value of 0 is returned if the set or the sub-set does not exist.

size

Total size of the set in data elements (output). The size is expressed in data elements, except for relational tables (datasets of type $), where size is expressed in integer*4 words. A value of -1 is returned if the dataset or the sub-set does not exist.