ISN after update

We know that the ISN can change when the record is updated. How can you get the new isn? I tried putting a Label on an update statement and received an error.

So how does one find the new ISN on an update?

Thanks!

The ISN does NOT change upon update. In Natural this is an UPDATE statement; in ADABAS, this is an A1 command.

Perhaps you are deleting the old record (DELETE/E1) and creating a new record (STORE/N1). In that case the “updated” record will have a new ISN.

R.
READ (1) EMP PHYSICAL           
  UPDATE (R.)                   
  WRITE 'Updated ISN' *ISN (R.) 
  ASSIGN PERSONNEL-ID = '987'   
  S.                            
  STORE EMP                     
  WRITE '    New ISN' *ISN (S.) 
END-READ                        
BACKOUT TRANSACTION             
Updated ISN           1
    New ISN        1141

Thank you Ralph for that information.

What happens when you update a record that changes the record size and this record will no longer fit in the Adabas block. In this case if Adabas has to delete and store behind the scenes, how do we get the new ISN number?

Thank you for your prompt answer!

The ISN remains the same, pointing to the new block (RABN - Relative Adabas Block Number).

Adabas splits the block’s contents in two. The records are not deleted/added, they are moved. Some records get the new RABN, but all records keep their ISNs. Natural programmers don’t see the RABNs.

Ralph, Once again, thank you for your knowledge. This clarifies the situation. The ISN never changes on an UPDATE.

:smiley:

Just to add to the discussion, Adabas works very much like a library as shown below

 Library  --    Adabas

 Books  --  Records
 Dewey Decimal Number  --  ISN
 Card Catalogue   --   Inverted Tables
 Library Map  --   Address Converter Table
 Library Shelf  --   Block

Records are variable length; books are variable width. Records can be updated, changing their length. Books (e.g. looseleaf books) can be updated, changing their width.

Differences include:

Library books are typically maintained in DDN order; Adabas records are maintained in “arbitrary” sequence; no value of any field, or the ISN, are used to determine physical placement.

Address Converter Table “translates” ISNs into Block numbers. Library Map “translates” ranges of DDNs into physical areas (further refined by ranges posted on shelves).

One more note; if a record changed its ISN when it was moved physically, and if there were 15 descriptor fields, all 15 tables would have to be modified. Instead, since the ISN does not change, all that Adabas has to do is change an entry in the Address Converter Table. Further note; you could physically re-organize a library without changing the card catalogues. This is because the card catalogues (inverted tables) have only logical information. The Library Map (Address Converter Table) has physical information.

steve