BOI Software Entwicklung und Vertrieb GmbH

Phone: +43 (0) 732 / 736423 - 0

Spazgasse 4

Email: office@boi.at

4040 Linz, Austria

www.boi.at

How to read the newly overwritten table from the database?

General

If the TABEX/4 database is not a random database and has not been reorganized, the overwritten table versions can still be read by using the database number.

Identifying the database number

In the TABEX/4 SSL interface $TAB4PTINF a module $TAB4_INTF with the entry getDDNbr exists which returns the database number of the extended table ID.

Integration of the TABEX/4 SSL interface

The TABEX/4 SSL interface must be integrated into the own SSL program by using %use-Command:

%use $TAB4PTINF

 

Calling the module entry

By using $TAB4_INTF.get DNbr (tabid, ddr, rc, nbrdisp) the database number ddnbr is determined for the extended table ID tabid.

nbrdisp can be specified, wif not the database number of tabid but the database number of an entry with the same table name and version date before (negative ddnbr value) or after (positive ddnbr value) shall be retrieved. nbrdisp = -1 for example can be used to retrieve the database number of the version that was overwritten with tabid.

Meaning of the parameters

the module entry $TAB4_INTF.getDDNbr is defined as follows:

tabid    char(40)  / Inp ... Extended tableID (see below)
ddnbr   char(10)  / Out ... Data base number as &&nnnnnnnn
rc        char(1)   / Out ... Return code (see below)
nbrdisp fixed       / Inp ... Version displacement (see above)

 

The extended table ID tabid has the following structure::

dcl tabnam  char(10)  def tabid unal /* table name    */
dcl tabver   char(08)  def tabid unal /* table version */
dcl tabdd    char(08)  def tabid unal /* database      */
dcl tabcdat  char(08) def tabid unal /* creation date */
dcl tabctim  char(06) def tabid unal /* creation time */

The database number ddnbr is returned in format &&nnnnnnnn (n ... a number between 0 and 9).

The return code rc can have the following values:

  rc = ' ':  ddnbr contains the database number acording to tabid and nbrdisp in the format &&nnnnnnnn
  rc = 'U':  tabid is not unique and ddnbr contains the database number in the format &&nnnnnnnn according to nbrdisp of the last entry that corresponds to tabid
  rc = 'N':  the tabid was not found in the database
  rc = 'E':  system error

Example

The table CONTRACT with version date 00000000 as saved 12:32:51 on 28/10/2011 in the database TABVSAM.

The overwritten version of this tabe should be found.

By using the following code fragment, the database number of the version overwritten now (nbrdisp = -1) of the table CONTRACT-00000000(TABVSAM) is determined:

  %use $TAB4PTINF

  dcl tabid      char(40)
  dcl ddnbr      char(10)
  dcl rc         char(1)
  dcl nbrdisp    fixed

  dcl tabnam     char(10) def tabid unal
  dcl tabver     char(08) def tabid unal
  dcl tabdd      char(08) def tabid unal
  dcl tabcdat    char(08) def tabid unal
  dcl tabctim    char(06) def tabid unal

  tabnam  = 'CONTRACT'
  tabver  = '00000000'
  tabdd   = 'TABVSAM'
  tabcdat = '20111028'
  tabctim = '123251'
  nbrdisp = -1

  $TAB4_INTF.getDDNbr(tabid,ddnbr,rc,nbrdisp)
  select
  when rc = ' ' then
     /* tabid is unique and was found: ddnbr is not BLANK*/
  when rc = 'U' then
     /* tabid is not unique: ddnbr = last found tabid*/
  when rc = 'N' then
     /* tabid was not found: ddnbr = ' ' */
  otherwise
     /* system error: ddnbr = ' ' */
  end

Valid from

TABEX/4 Version 4.2.0

Migration Packages

BOI GmbH offers migration packages for the table management systems SPITAB, TABSYS and VTAS.

 

» Migrations Packages

Success Stories

AirPlus has been using TABEX for 20 years.

Now TABEX/4 JAVA APPLICATION ENGINE has additionally been launched for audit-proof logging of the business processes by Java applications.

 

» read this success story

» more success stories