DataMuseum.dk

Presents historical artifacts from the history of:

CR80 Wang WCS documentation floppies

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CR80 Wang WCS documentation floppies

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦43c7d73be⟧ Wang Wps File

    Length: 64587 (0xfc4b)
    Types: Wang Wps File
    Notes: CPS/SDS/026               
    Names: »1592A «

Derivation

└─⟦7985b6947⟧ Bits:30005810 8" Wang WCS floppy, CR 0117A
    └─ ⟦this⟧ »1592A « 

WangText

(…00……00……00……00…?…02……00……00…?
?…06…>…0a…>…0e…>…01…>…06…=…0b…=…0d…=…01…=…06…4…0c…4…0e…4…01…4…07…3…0b…3…0e…3…00…3
3…05…3…07…2…09…2…0b…2…00…2
2…06…1…08…1…86…1                                             …02…           …02…   …02…        

…02…CPS/SDS/026

…02…BMN/840105…02……02…
TABLE MANAGEMENT
DETAILED DESIGN SPECIFICATION…02…ISSUE 1…02…CAMPS








4.2.1.4.3    G̲e̲n̲e̲r̲a̲l̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲



4.2.1.4.3.1\F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         This module contains general search procedures used
         by TMP process.

         The procedures are:

         -   Find Secondary
         -   Find Key
         -   Binary Search
         -   Compare

         a)  F̲i̲n̲d̲ ̲S̲e̲c̲o̲n̲d̲a̲r̲y̲

             Cf 4.2.1.7.g.

         b)  F̲i̲n̲d̲ ̲K̲e̲y̲

             Cf. 4.2.1.7.h.

         c)  B̲i̲n̲a̲r̲y̲ ̲S̲e̲a̲r̲c̲h̲

             Cf. 4.2.1.7.i

         d)  C̲o̲m̲p̲a̲r̲e̲

             4.2.1.7.j.



4.2.1.4.3.2 G̲e̲n̲e̲r̲a̲l̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲I̲n̲t̲e̲r̲f̲a̲c̲e̲

         This module has four interfaces.

         a)  F̲i̲n̲d̲ ̲S̲e̲c̲o̲n̲d̲a̲r̲y̲

             Cf. 4.2.1.7.g.

         b)  F̲i̲n̲d̲ ̲K̲e̲y̲

             Cf. 4.2.1.7.h.

         c)  B̲i̲n̲a̲r̲y̲ ̲S̲e̲a̲r̲c̲h̲

             Cf. 4.2.1.7.i

         d)  C̲o̲m̲p̲a̲r̲e̲

             4.2.1.7.j.


4.2.1.4.3.3 G̲e̲n̲e̲r̲a̲l̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲C̲o̲m̲p̲o̲n̲e̲n̲t̲s̲

         This module consists of four procedures

         -   FIND ̲SECONDARY
         -   FIND ̲KEY
         -   BINARY ̲SEARCH
         -   COMPARE



4.2.1.4.3.4 G̲e̲n̲e̲r̲a̲l̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲a̲t̲a̲

         D̲a̲t̲a̲ ̲R̲e̲f̲e̲r̲e̲n̲c̲e̲s̲

         TMP ̲COROUTINE ̲RECORD         cf. 4.1.7.1
         TABLE ̲DESCRIPTION ̲ARRAY      cf. 4.1.4.2
         ARRAY ̲DESCRIPTION            cf. 4.1.4.1
         KEY ̲DESCRIPTION              cf. 4.1.4.1

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         TMP ̲COROUTINE ̲RECORD
         TABLE ̲DESCRIPTION ̲ARRAY

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         None



4.2.1.4.3.5 G̲e̲n̲e̲r̲a̲l̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲e̲s̲i̲g̲n̲

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         READ ̲DISK ̲BLOK               c.f. 4.1.5.7

         a)  F̲i̲n̲d̲ ̲S̲e̲c̲o̲n̲d̲a̲r̲y̲

             N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

             All RECORDS in a whole BLOCK is scanned one by
             one. Return is made if the key is found or end
             of BLOCK is reached.

             F̲l̲o̲w̲g̲r̲a̲m̲

             Cf. figure 4.2.1.4.3.5-2

         b)  F̲i̲n̲d̲ ̲K̲e̲y̲



             N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

             The KEY is found by calling BINARY ̲SEARCH or address
             of searched KEY is determined arithmetically. The
             way to find the KEY is chosen in accordance to
             table organization type. All needed parameters
             are found via TMP ̲COROUTINE ̲RECORD.

             F̲l̲o̲w̲g̲r̲a̲m̲

             None.

         c)  B̲i̲n̲a̲r̲y̲ ̲S̲e̲a̲r̲c̲h̲

             N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

             Binary search method is used until only one RECORD
             is left. ELEMENT is updated and returned to caller.
             By comparing searched KEY with a RECORD KEY the
             procedure COMPARE is called.

             F̲l̲o̲w̲g̲r̲a̲m̲

             None

         d)  C̲o̲m̲p̲a̲r̲e̲

             N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

             The BYTES are compared one by one starting at the
             lowest address. Comparison is continued until the
             two compared BYTES are not identical or end of
             strings are reached. Completion code is updated
             and returned to caller.

             F̲l̲o̲w̲g̲r̲a̲m̲

             None



4.2.1.4.4.   M̲e̲m̲o̲r̲y̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲



4.2.1.4.4.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         This procedure performs search in a memory located
         table.

         The search type to be performed is selected in accordance
         with TMP ̲OPERATION.PARAMS.FUNCTION.

         The search consists of finding specified keys and delivery
         of associated output.

         All parameters needed for a search must be located
         in, or referenced by TMP ̲COROUTINE ̲RECORD at invocation
         time.



4.2.1.4.4.2 I̲n̲t̲e̲r̲f̲a̲c̲e̲

         C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         MEMORY ̲SEARCH 

         (R4 ; " c k Pointer to TMP ̲OPERATION
          R5 ; " c k Pointer to TMP ̲COROUTINERECORD
          R6); " c d LINK
          R0-R3  - k
          R7     - d

         F̲a̲t̲a̲l̲ ̲E̲r̲r̲o̲r̲s̲

         None





4.2.1.4.4.3 M̲e̲m̲o̲r̲y̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲C̲o̲m̲p̲o̲n̲e̲n̲t̲s̲

         This module consists of the following procedures,

         - MEMORY ̲SEARCH

         - PRIMARY

         This procedure searches the keys specified in KEY ̲LIST
         and delivers the requested output from the records
         with specified key.

         The key must be described by TMP ̲COROUTINE ̲RECORD.KEY
         and the table must be described by TMP ̲COROUTINE ̲RECORD.TABLE.

         The keys in KEY ̲LIST are only searched in the field
         containing primary key.

         - NEXT ̲PRIMARY

         This procedure searches the key specified by ENTRY
         and delivers the requested number of records, starting
         with the one next to the one found.

         The key must be described by TMP ̲COROUTINE ̲RECORD.KEY
         and the table must be described by TMP ̲COROUTINE ̲RECORD.TABLE.

         COUNT specifies number of records to be delivered.

         - IN ̲RECORD

         This procedure validates if the keys in KEY ̲LIST are
         contained in the record specified by primary key pointed
         out by ENTRY.

         The keys are validated against the record fields described
         by TMP ̲COROUTINE ̲RECORD.SEARCH ̲FORMAT.

         The keys existing in record will have associated SINGLE
         ̲KEY.INFO field set to TRUE at output.



         - ONE ̲SECONDARY

         This procedure searches the keys specified in KEY ̲LIST
         and delivers the requested output from the records
         with specified key.

         The key must be described by TMP ̲COROUTINE ̲RECORD.KEY
         and the table must be described by TMP ̲COROUTINE ̲
         RECORD.TABLE.

         The keys in KEY ̲LIST are searched in the fields described
         by TMP ̲COROUTINE ̲RECORD.SEARCH ̲FORMAT.

         For each key in KEY ̲LIST only one record may be delivered.

         - ALL ̲SECONDARY

         This procedure searches the keys specified in KEY ̲LIST
         and delivers the requested output from the records
         with specified key.

         The key must be described by TMP ̲COROUTINE ̲RECORD.KEY
         and the table must be described by TMP ̲COROUTINE ̲RECORD.TABLE.

         The keys in KEY ̲LIST are searched in the fields described
         by TMP ̲COROUTINE ̲RECORD.SEARCH FORMAT.

         For each key in KEY ̲LIST all records having specified
         key will be delivered.



4.2.1.4.4.4 M̲e̲m̲o̲r̲y̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲a̲t̲a̲

         D̲a̲t̲a̲ ̲R̲e̲f̲e̲r̲e̲n̲c̲e̲s̲

         TMP ̲COROUTINE ̲RECORD         4.1.4.1
         TABLE ̲DESCRIPTION            4.1.4.1

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         TMP ̲COROUTINE ̲RECORD          (M)
         TABLE ̲DESCRIPTION
         TABLE ̲DESCRIPTION.STATISTICS  (M)

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         None


4.2.1.4.4.5 M̲e̲m̲o̲r̲y̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲e̲s̲i̲g̲n̲

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         MAP ̲PARAMS ̲IN               cf. 4.1.5.2
         SORT ̲KEYS                   cf. 4.2.1.4.2
         SEND ̲RESPONSE               cf. 4.1.5.5
         MAP ̲PARAMS ̲OUT              cf. 4.1.5.3
         FIND ̲KEY                    cf. 4.2.1.4.3
         DELIVER ̲OUTPUT              cf. 4.2.1.6.1
         COMPARE ̲FIELDS              cf. 4.2.1.6.2
         FIND ̲SECONDARY              cf. 4.2.1.4.3

         N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

         None

         F̲l̲o̲w̲g̲r̲a̲m̲s̲

         C f. figure 4.2.1.4.4.5-1




         Procedure   MEMORY ̲SEARCH

         EQUIVALENCE(RUNNING ̲COROUTINE,C:TMP ̲COROUTINE
         ̲RECORD)

         Case  MAP ̲PARAMS ̲IN : ERROR ̲OK :

             - ERROR ? - C.RESPONSE.CC = PARAMETER
         ̲ADDRESS ̲ERROR

         End   Case  MAP ̲PARAMS ̲IN

         Case  SORT ̲KEYS ( ) (SORTED ̲KEYS, CC)

             - ERROR ? - C.RESPONSE.CC = CC

         End Case  SORT ̲KEYS

         Case  C.INPUT.FUNCTION

             - SEARCH ̲PRIMARY ̲KEY       ? - P̲r̲i̲m̲a̲r̲y̲

             - SEARCH ̲NEXT ̲PRIMARY ̲KEY  ? - N̲e̲x̲t̲ ̲P̲r̲i̲m̲a̲r̲y̲

             - SEARCH ̲IN ̲RECORD         ? - I̲N̲ ̲R̲E̲C̲O̲R̲D̲

             - SEARCH ̲ONE ̲SECONDARY ̲KEY ? - O̲N̲E̲ ̲S̲E̲C̲O̲N̲D̲A̲R̲Y̲

             - SEARCH ̲ALL ̲SECONDARY ̲KEY ? - A̲L̲L̲ ̲S̲E̲C̲O̲N̲D̲A̲R̲Y̲

         End Case  C.INPUT.FUNCTION

         Update  TMP Statistics

         MAP ̲PARAMS ̲OUT

         SEND ̲RESPONSE

         Stop









              Figure 4.2.1.4.4.5-1



4.2.1.4.5    D̲i̲s̲k̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲



4.2.1.4.5.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         This module performs search in tables located at disk.

         a)  D̲i̲s̲k̲ ̲S̲e̲a̲r̲c̲h̲ ̲C̲o̲r̲o̲u̲t̲i̲n̲e̲

             One invocation will perform one search request
             and send response to caller when search is complete
             or an error has been detected.

             Depending on function code one of the following
             search procedures is executed

             - DISK ̲PRIMARY
               cf 4.2.1.4.5.1.b

             - DISK ̲NEXT ̲PRIMARY

             This procedure delivers the No. of keys specified
             by TMP ̲OPERATION.PARAMS.COUNT.

             The actual primary key must be described by TMP
             ̲COROUTINE ̲RECORD.KEY and the table must be described
             by the TABLE ̲DESCRIPTION identified by TMP ̲COROUTINE
             ̲RECORD.TD.

             The first record to be delivered is the one having
             primary key next to the key specified by the pointer
             in TMP ̲OPERATION.PARAMS.ENTRY, if this pointer
             is NIL delivery is started with first record in
             table.

             The records being delivered will have increasing
             primary keys.



             - DISK ̲IN ̲RECORD

             This procedure validates if the keys in KEY ̲LIST
             are contained in the record specified by primary
             key pointed out by ENTRY.

             The keys are validated against the record fields
             described by TMP ̲COROUTINE ̲RECORD.SEARCH ̲FORMAT.

             The keys existing in record will have associated
             SINGLE ̲KEY.INFO field set to TRUE at output.

             - DISK ̲ONE ̲SECONDARY

             This procedure searches the keys specified in KEY
             ̲LIST and delivers the requested output from the
             records with specified key.

             The key must be described by TMP ̲COROUTINE ̲RECORD.KEY
             and the records in table must be described by TMP
             ̲COROUTINE ̲RECORD.TABLE.

             The table must be described by TMP ̲COROUTINE ̲RECORD.TD.

             The keys in KEY ̲LIST are searched in the fields
             described by TMP ̲COROUTINE ̲RECORD.SEARCH ̲FORMAT.

             For each key in KEY ̲LIST only one record may be
             delivered.

             - DISK ̲ALL ̲SECONDARY

             This procedure searches the keys specified in KEY
             ̲LIST and delivers the requested output from the
             records with specified key.

             The key must be described by TMP ̲COROUTINE ̲RECORD.KEY
             and the records in table must be described by TMP
             ̲COROUTINE ̲RECORD.TABLE.

             The table must be described in TMP ̲COROUTINE ̲RECORD.TD.

             The keys in KEY ̲LIST are searched in the fields
             described by TMP ̲COROUTINE ̲RECORD.SEARCH ̲FORMAT.

             For each key in KEY ̲LIST all records having specified
             key will be delivered.



         b) D̲i̲s̲k̲ ̲P̲r̲i̲m̲a̲r̲y̲

             This procedure searches the keys specified in KEY
             ̲LIST and delivers the requested output from the
             records with specified key.

             The key must be described by TMP ̲COROUTINE ̲RECORD.KEY
             and the table must be described by TMP ̲COROUTINE
             ̲RECORD.TABLE.

             The keys in KEY ̲LIST are only searched in the field
             containing primary key.


4.2.1.4.5.2 I̲n̲t̲e̲r̲f̲a̲c̲e̲

         a)  D̲i̲s̲k̲ ̲C̲o̲r̲o̲u̲t̲i̲n̲e̲

             Cf. 4.2.3.7.1

         b)  D̲i̲s̲k̲ ̲P̲r̲i̲m̲a̲r̲y̲

             C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

             DISK ̲PRIMARY

             (R4 ; " c k Pointer to TMP ̲OPERATION
              R5 ; " c k Pointer to TMP ̲COROUTINE ̲RECORD
              R6); " c d LINK
              R0-R3  - d
              R7     - d

             F̲a̲t̲a̲l̲ ̲E̲r̲r̲o̲r̲s̲

             None

         c)  F̲i̲n̲d̲ ̲D̲i̲s̲k̲ ̲K̲e̲y̲

             Cf 4.2.1.7.f



4.2.1.4.5.3 D̲i̲s̲k̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲C̲o̲m̲p̲o̲n̲e̲n̲t̲s̲

         This module consists of the coroutine

         D̲I̲S̲K̲ ̲S̲E̲A̲R̲C̲H̲

         and the procedures

         D̲I̲S̲K̲ ̲P̲R̲I̲M̲A̲R̲Y̲

         F̲I̲N̲D̲ ̲D̲I̲S̲K̲ ̲K̲E̲Y̲

         G̲E̲T̲ ̲D̲I̲R̲E̲C̲T̲

         This procedure finds a record in a direct organized
         disk table. The table is identified by R5%TMP ̲COROUTINE
         ̲RECORD.TD and the record is identified by the key described
         in R5%TMP ̲COROUTINE ̲RECORD ̲KEY.


         At output R5%TMP ̲COROUTINE ̲RECORD.CURRENT ̲RECORD contain
         a pointer to the record identified by specified key.
         A NIL pointer means that key is not found.

         If key has been found OKAY exit is used otherwise ERROR
         exit is used.

         G̲E̲T̲ ̲I̲N̲V̲E̲R̲S̲E̲

         This procedure finds the record identified by BLOCK
         ̲NO and RECORD ̲NO. At return specified block is read
         into memory and TMP ̲COROUTINE ̲RECORD.CURRENT ̲RECORD
         will specify the address of actual record.

         G̲E̲T̲ ̲S̲E̲Q̲U̲E̲N̲T̲I̲A̲L̲

         This procedure finds a record in a sequential organized
         disk table. The table is identified by R5%TMP ̲COROUTINE
         ̲RECORD.KEY.KEY.

         If OVERFLOW ̲SEARCH is FALSE all records in overflow
         blocks will be considered not existing.

         R5%TMP ̲COROUTINE ̲RECORD.CURRENT ̲BLOCK specifies in
         which block the key might be located.

         If specified key is higher than highest key at specified
         block, search will continue in the preceding blocks
         until a key equal to or higher than specified key has
         been found or end of tables is reached. R5%TMP ̲COROUTINE
         ̲RECORD.CURRENT ̲BLOCK will always specify number of
         the block residing in memory.

         At output R5%TMP ̲COROUTINE ̲RECORD.CURRENT ̲RECORD contain
         a pointer to the record identified by key or the record
         having key next to specified key, a NIL pointer means
         that key is higher than highest key in table.

         If key has been found OKAY exit is used otherwise ERROR
         exit is used.





4.2.1.4.5.4 D̲i̲s̲k̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲a̲t̲a̲

         D̲a̲t̲a̲ ̲R̲e̲f̲e̲r̲e̲n̲c̲e̲s̲

         TMP ̲COROUTINE ̲RECORD      cf. 4.1.4.1
         TABLE ̲DESCRIPTION         cf. 4.1.4.1
         TMP ̲BUFFER                cf. 4.1.4.1
         SEARCH ̲BUFFER             cf. 4.1.4.2

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         TMP ̲COROUTINE ̲RECORD              (M)
         TABLE ̲DESCRIPTION
         TABLE ̲DESCRIPTION.STATISTICS      (M)
         SEARCH ̲BUFFER

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         N/A



4.2.1.4.4.5 D̲i̲s̲k̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲e̲s̲i̲g̲n̲

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         MAP ̲PARAMS ̲IN             cf. 4.1.5.2
         SORT ̲KEYS                 cf. 4.2.1.4.2
         SEND ̲RESPONSE             cf. 4.1.5.5
         MAP ̲PARAMS ̲OUT            cf. 4.1.5.3
         DELIVER ̲OUTPUT            cf. 4.2.1.6.1
         COMPARE ̲FIELDS            cf. 4.2.1.6.2
         FIND ̲SECONDARY            cf. 4.2.1.4.3
         READ ̲DISK ̲BLOCK           cf. 4.1.5.7
         SPECIAL ̲SEARCH            cf. 4.2.1.4.6

         N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

         The flowgrams show the high level control logic for
         a disk search. 

         F̲l̲o̲w̲g̲r̲a̲m̲s̲

         Cf. figure 4.2.1.4.5.5-(1 - 7)



         Coroutine DISK ̲SEARCH

         Initialize Data

         EQUIVALENCE(RUNNING ̲COROUTINE,C:TMP ̲COROUTINE ̲RECORD)

         FOREVER ̲Loop

             WAIT ̲OPSEM (DISK ̲SEARCH ̲SEM)

             WAIT ̲SEM (DISABLE ̲SEM)

             Case MAP ̲PARAMS ̲IN: ERROR ̲OK:

                 - ERROR? C.RESPONSE.CC = PARAMETER ̲ADDRESS
                 ̲ERROR

             End Case MAP ̲PARAMS ̲IN

             Case SORT ̲KEYS()(SORTED ̲ARRAY,CC): ERROR ̲OK

                 - ERROR? C.RESPONSE = CC

             End case SORT ̲KEYS

             P̲e̲r̲f̲o̲r̲m̲ ̲D̲i̲s̲k̲ ̲S̲e̲a̲r̲c̲h̲

             Update TMP Statistics

             SEND ̲RESPONSE

             MAP ̲PARAMS ̲OUT

             SIGNAL ̲SEM (DISABLE ̲SEM)

         End FOREVER Loop












                   Figure 4.2.1.4.5.5-1


         P̲e̲r̲f̲o̲r̲m̲ ̲D̲i̲s̲k̲ ̲S̲e̲a̲r̲c̲h̲

         Case C.INPUT.FUNCTION

             -   SEARCH ̲PRIMARY ̲KEY?       NOT SIC ̲SCD ̲TABLE
                                           ?

                                                  DISK ̲PRIMARY

                                           SPECIAL ̲SEARCH

             -   SEARCH ̲NEXT ̲PRIMARY ̲KEY?  D̲i̲s̲k̲ ̲N̲e̲x̲t̲ ̲P̲r̲i̲m̲a̲r̲y̲

             -   SEARCH ̲IN ̲RECORD?         D̲i̲s̲k̲ ̲I̲n̲ ̲R̲e̲c̲o̲r̲d̲

             -   SEARCH ̲ONE ̲SECONDARY ̲KEY? D̲i̲s̲k̲ ̲O̲n̲e̲ ̲S̲e̲c̲o̲n̲d̲a̲r̲y̲

             -   SEARCH ̲ALL ̲SECONDARY ̲KEY? D̲i̲s̲k̲ ̲A̲l̲l̲ ̲S̲e̲c̲o̲n̲d̲a̲r̲y̲

         End case C.INPUT.FUNCTION

         Stop


























                   Figure 4.2.1.4.5.5-2


         Procedure DISK ̲PRIMARY: OK

         EQUIVALENCE(RUNNING ̲COROUTINE,C:TMP ̲COROUTINE ̲RECORD)

         Not Two level?                    FOR ̲ALL ̲KEYS loop
                                           FIND ̲DISK ̲KEY
         FOR ̲ALL ̲KEYS loop                 Deliver Output
                                           Last key   EXIT
             FIND ̲DISK ̲KEY                 End FOR ̲ALL ̲KEYS
                                           loop

             Deliver Intermediate
             Output in TMP Data Area

             Last key   EXIT

         End FOR ̲ALL ̲KEYS loop

         FOR ̲ALL ̲KEYS loop

             Sort Keys In Intermediate Output

             FOR ̲ALL ̲INTERMEDIATE ̲KEYS loop

                 FIND ̲DISK ̲KEY

                 Deliver Output In Caller Data Area

                 Last Intermediate Key   EXIT

             End FOR ̲ALL ̲INTERMEDIATE ̲KEYS

             Last key   EXIT

         END FOR ̲ALL ̲KEYS loop

         Stop












                   Figure 4.2.1.4.5.5-3


         D̲i̲s̲k̲ ̲N̲e̲x̲t̲ ̲P̲r̲i̲m̲a̲r̲y̲

         Find Key Specified by C.ENTRY

         DELIVER loop

             Find Next Key

             Deliver Output

             No. Of Found Keys EQ C.COUNT  …0f…EXIT…0e…
             OR End Of Table Reached

         End DELIVER Loop

         Stop































                   Figure 4.2.1.4.5.5-4


         D̲i̲s̲k̲ ̲I̲n̲ ̲R̲e̲c̲o̲r̲d̲

         Case FIND ̲DISK ̲KEY: ERROR ̲OK

             -   ERROR? - C.RESPONSE.CC = UNDEFINED ̲KEY

         End case FIND ̲DISK ̲KEY

         COMPARE ̲FIELDS

         C.RESPONSE.CC = OK

         Stop


































                   Figure 4.2.1.4.5.5-5


         D̲i̲s̲k̲ ̲O̲n̲e̲ ̲S̲e̲c̲o̲n̲d̲a̲r̲y̲

         FOR ̲ALL ̲BLOCKS loop

             FOR ̲ALL ̲KEYS loop

                 Case FIND ̲SECONDARY (BLOCK ̲END)
                                     (DUMMY): ERROR ̲OK

                     -   ERROR?

                     -   OK?  DELIVER ̲OUTPUT

                 End case FIND ̲SECONDARY

                 Last Key   EXIT

             End FOR ̲ALL ̲KEYS loop

             All Keys Found OR Last Block   EXIT

         End FOR ̲ALL ̲BLOCKS loop

         Stop























                   Figure 4.2.1.4.5.5-6


         D̲i̲s̲k̲ ̲A̲l̲l̲ ̲S̲e̲c̲o̲n̲d̲a̲r̲y̲

         FOR ̲ALL ̲KEYS loop

             FOR ̲ALL ̲BLOCKS loop

                 FOR ̲ALL ̲RECORDS loop

                     Case FIND ̲SECONDARY (BLOCK ̲END)
                                         (DUMMY): ERROR ̲OK

                         -   ERROR?   EXIT

                         -   OK?  DELIVER ̲OUTPUT

                     End Case FIND ̲SECONDARY

                 End ALL ̲RECORDS loop

                 LAST ̲BLOCK   EXIT

             END FOR ̲ALL ̲BLOCKS loop

             LAST ̲KEY   EXIT

         End FOR ̲ALL ̲KEYS loop

         Stop


















                   Figure 4.2.1.4.5.5-7


4.2.1.4.6    S̲p̲e̲c̲i̲a̲l̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲



4.2.1.4.6.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         This module searches the SICs specified in TMP ̲OPERATION.PARAMS.BUFFER1.
         The output will not be the SDL ̲NOs which is present
         in the SIC table, but the SDLs associated to the SDL
         ̲NOs in the SDL table.

         TMP ̲OPERATION.PARAMS.MASK1 defines which fields in
         SIC record shall be used as read mask at the output
         from SIC table ( SDL ̲NO ).

         A SIC is existing if its 3 character code preceded
         by a space is found or if its first 2 characters preceded
         by 2 spaces are found or if its first character preceded
         by 3 spaces are found, the SIC version with the highest
         No. of significant characters matching with the searched
         one will be used.



4.2.1.4.6.2 S̲p̲e̲c̲i̲a̲l̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲I̲n̲t̲e̲r̲f̲a̲c̲e̲

         C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         SPECIAL ̲SEARCH: OK

         (R4 ; " c k Pointer to TMP ̲OPERATION
          R5 ; " c k Pointer to TMP ̲COROUTINE ̲RECORD
          R6); " c d LINK
          R0-R3  - k
          R7     - d

         F̲a̲t̲a̲l̲ ̲E̲r̲r̲o̲r̲s̲

         None



4.2.1.4.6.3 S̲p̲e̲c̲i̲a̲l̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲C̲o̲m̲p̲o̲n̲e̲n̲t̲s̲

         This module consists of the two procedures:

         -   SPECIAL ̲SEARCH

         -   SIC ̲SCD ̲SEARCH



         This procedure searches the SDLs associated to the
         SICs in R5%TMP ̲COROUTINE ̲RECORD.PRIVATE. The SDL ̲NO
         associated to each SIC is referenced by actual SINGLE
         ̲KEY.LINK.

         The original SINGLE ̲KEY specified by INPUT%TMP ̲OPERATION.BUFFERR1
         will be updated in accordance with TMP interface concept.



4.2.1.4.6.4 S̲p̲e̲c̲i̲a̲l̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲a̲t̲a̲

         D̲a̲t̲a̲ ̲R̲e̲f̲e̲r̲e̲n̲c̲e̲s̲

         TMP ̲COROUTINE ̲RECORD         cf. 4.1.4.1
         TABLE ̲DESCRIPTION ̲ARRAY      cf. 4.1.4.2
         TABLE ̲DESCRIPTION            cf. 4.1.4.1
         RECORD ̲DESCRIPTION           cf. 4.1.4.1

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         TMP ̲COROUTINE ̲RECORD                (M)
         TABLE ̲DESCRIPTION ̲ARRAY

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         None





4.2.1.4.6.5 S̲p̲e̲c̲i̲a̲l̲ ̲S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲e̲s̲i̲g̲n̲

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         DISK ̲PRIMARY                 cf. 4.2.1.4.5
         MODIFY ̲RECORD                cf. 4.1.5.1

         a)  S̲p̲e̲c̲i̲a̲l̲ ̲S̲e̲a̲r̲c̲h̲

             N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

             The procedure SIC ̲SCD ̲SEARCH is called.

             F̲l̲o̲w̲g̲r̲a̲m̲

             None

         b)  S̲I̲C̲ ̲S̲C̲D̲ ̲S̲e̲a̲r̲c̲h̲

             N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

             Each SIC is searched by calling DISK ̲PRIMARY.

             If it is not found third letter is changed to a
             space and DISK ̲PRIMARY is called. If it is still
             not found second letter is also changed to a space
             and DISK ̲PRIMARY is called.

             If a SIC is found requested SDLs is written in
             TMP data area. All SDLs is converted to SCDs by
             calling DISK ̲PRIMARY.

             F̲l̲o̲w̲g̲r̲a̲m̲

             None.





4.2.1.5  S̲e̲a̲r̲c̲h̲ ̲S̲u̲b̲p̲a̲c̲k̲a̲g̲e̲ ̲D̲a̲t̲a̲



4.2.1.5.1    C̲o̲r̲o̲u̲t̲i̲n̲e̲ ̲R̲e̲c̲o̲r̲d̲s̲

         Search subpackage consists of two coroutines and must
         thus have two coroutine records.

         VAR

         SEARCH ̲COMMUNICATION ̲COREC,
         DISK ̲SEARCH ̲COREC  :
                 TMP ̲COROUTINE ̲RECORD,
                 cf 4.1.4.2


4.2.1.5.2    S̲e̲a̲r̲c̲h̲ ̲S̲u̲b̲p̲a̲c̲k̲a̲g̲e̲ ̲D̲i̲s̲k̲ ̲b̲u̲f̲f̲e̲r̲

         Search subpackage has a disk buffer used when searching
         in disk located tables

         VAR
         SEARCH ̲BUFFER:               TMP ̲BUFFER;
                                      cf 4.1.4.2




4.2.1.6  C̲o̲m̲m̲o̲n̲ ̲S̲e̲a̲r̲c̲h̲ ̲S̲u̲b̲p̲a̲c̲k̲a̲g̲e̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲



4.2.1.6.1    D̲e̲l̲i̲v̲e̲r̲ ̲O̲u̲t̲p̲u̲t̲



4.2.1.6.1.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         This procedure delivers one record to the application.

         The record is written in the area specified by TMP
         ̲COROUTINE ̲RECORD.INPUT%TMP ̲OPERATION.PARAMS.BUFFER2.

         The record to be written is specified by 
         TMP ̲COROUTINE ̲RECORD.CURRENT ̲RECORD.

         The record parts to be written are specified by
         TMP ̲COROUTINE ̲RECORD.WRITE ̲FORMAT.

         TMP ̲COROUTINE ̲RECORD.INPUT%TMP ̲OPERATION.PARAMS.BUFFER2
         ̲LENGTH is decremented by size of the delivered output.

         TMP ̲COROUTINE ̲RECORD.INPUT%TMP ̲OPERATION.PARAMS.BUFFER2
         is incremented by size of the delivered output.



4.2.1.6.1.2 I̲n̲t̲e̲r̲f̲a̲c̲e̲

         C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         DELIVER ̲OUTPUT

         (R5 ; " c k Pointer to TMP ̲COROUTINE ̲RECORD
          R6); " c d LINK
          ERROR ̲OK ;
          R0-R4  - k
          R7     - k

         F̲a̲t̲a̲l̲ ̲E̲r̲r̲o̲r̲s̲

         None.





4.2.1.6.1.3 D̲a̲t̲a̲

         R̲e̲f̲e̲r̲e̲n̲c̲e̲d̲ ̲D̲a̲t̲a̲

         TMP ̲COROUTINE ̲RECORD         cf. 4.1.4.1

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         TMP ̲COROUTINE ̲RECORD

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         None.



4.2.1.6.1.4 D̲e̲l̲i̲v̲e̲r̲ ̲O̲u̲t̲p̲u̲t̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲ ̲D̲e̲s̲i̲g̲n̲

         N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

         The fields described in TMP ̲COROUTINE ̲RECORD.READ ̲FORMAT
         is written one by one until all of them have been written.

         F̲l̲o̲w̲g̲r̲a̲m̲

         None



4.2.1.6.2    C̲o̲m̲p̲a̲r̲e̲ ̲F̲i̲e̲l̲d̲s̲



4.2.1.6.2.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         This procedure compares specified fields in specified
         record, to the keys in the KEY ̲LIST specified by TMP
         ̲COROUTINE ̲RECORD.INPUT%TMP ̲OPERATION.PARAMS.BUFFER1.

         If SINGLE ̲KEY.KEY is identical to one of the specified
         record fields the SINGLE ̲KEY.INFO is set to TRUE.





4.2.1.6.2.2 I̲n̲t̲e̲r̲f̲a̲c̲e̲

         C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         COMPARE ̲FIELDS

         (R5 ; " c k Pointer to TMP ̲COROUTINE ̲RECORD
          R6); " c d LINK
          ERROR ̲OK ;
          R0-R4  - k
          R7     - k



         F̲a̲t̲a̲l̲ ̲E̲r̲r̲o̲r̲s̲

         None



4.2.1.6.2.3 D̲a̲t̲a̲

         R̲e̲f̲e̲r̲e̲n̲c̲e̲d̲ ̲D̲a̲t̲a̲

         TMP ̲COROUTINE ̲RECORD         cf. 4.1.4.1
         KEY ̲LIST                     cf. (a) 4.2

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         TMP ̲COROUTINE ̲RECORD
         KEY ̲LIST

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         None



4.2.1.6.2.4 C̲o̲m̲p̲a̲r̲e̲ ̲F̲i̲e̲l̲d̲s̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲ ̲D̲e̲s̲i̲g̲n̲

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         BINARY ̲SEARCH                cf. 4.2.1.4.3

         N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

         For each SINGLE ̲KEY the RECORD is scanned until an
         identical field is found or until end of RECORD.

         F̲l̲o̲w̲g̲r̲a̲m̲

         N/A


4.2.1.7  S̲e̲a̲r̲c̲h̲ ̲S̲u̲b̲p̲a̲c̲k̲a̲g̲e̲ ̲I̲n̲t̲e̲r̲f̲a̲c̲e̲

         a)  R̲e̲c̲e̲i̲v̲e̲ ̲R̲e̲q̲u̲e̲s̲t̲

             Requests are received from TMP Monitor via SEARCH
             ̲SYNCEL cf. 4.2.3.7.1.

         b)  R̲e̲t̲u̲r̲n̲ ̲R̲e̲s̲p̲o̲n̲s̲e̲

             Responses are returned to TMP Monitor via an ANSWER
             ̲SYNCEL cf. 4.2.3.7.2.

         c)  R̲e̲c̲e̲i̲v̲e̲ ̲D̲i̲s̲k̲ ̲S̲e̲a̲r̲c̲h̲ ̲R̲e̲q̲u̲e̲s̲t̲

             A disk search request is received from DISK ̲SEARCH
             ̲SEM OPERATION ̲SEMAPHORE. The OPERATION received
             is of TMP ̲OPERATION type cf. 4.1.4.1 TMP ̲OPERATION.DATA
             is of TMP ̲REQUEST ̲TYPE cf. 4.1.4.1.

         d)  S̲e̲n̲d̲ ̲D̲i̲s̲k̲ ̲S̲e̲a̲r̲c̲h̲ ̲R̲e̲s̲p̲o̲n̲s̲e̲

             A response after a disk search request is sent
             to SUPPORT ̲RS ̲SEM in a TMP ̲OPERATION.

             TMP ̲OPERATION.DATA is of TMP ̲RESPONSE type cf.
             4.1.4.1.

         e)  D̲i̲s̲a̲b̲l̲e̲ ̲S̲e̲a̲r̲c̲h̲

             To make it possible to suspend search, SEARCH ̲COMMUNICATION
             and DISK ̲SEARCH COROUTINES will wait at DISABLE
             ̲SEM after they receive a request and signal DISABLE
             ̲SEM when the request has been completed.

         f)  F̲i̲n̲d̲ ̲D̲i̲s̲k̲ ̲K̲e̲y̲

             F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

             This procedure finds the KEY specified by TMP ̲COROUTINE
             ̲RECORD.KEY in the TABLE specified by TMP ̲COROUTINE
             ̲RECORD.TD.

             If OVERFLOW ̲SEARCH is FALSE all records in overflow
             blocks will be considered not existing.

             If TWO ̲LEVEL ̲SEARCH is FALSE table will be considered
             a normal sequential even if it is INVERSE. i.e.
             the record being found is the one containing BLOCK
             and RECORD No. of the physical record being searched.
             TWO ̲LEVEL ̲SEARCH has only significance when searching
             in inverse tables.



             At return TMP ̲COROUTINE ̲RECORD.TABLE will describe
             the RECORDS located in the TMP ̲BLOCK located in
             the buffer associated to current coroutine. TMP
             ̲COROUTINE ̲RECORD.CURRENT ̲BLOCK will contain actual
             block number.

             TMP ̲COROUTINE ̲RECORD.CURRENT ̲RECORD will contain
             a pointer to the RECORD having specified KEY or
             a pointer to the record having KEY next to specified
             KEY if the KEY does not exist. A NIL pointer means
             that key is higher than highest key in table.

             If KEY is found OKAY EXIT is used otherwise ERROR
             EXIT is used.

             C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

             FIND ̲DISK ̲KEY

             (R2     "   c k TWO ̲LEVEL ̲SEARCH boolean specifying
                             that search in next table level
                             shall be performed. Has no meaning
                             for other tables than INVERSE tables.
             ;R3     "   c k OVERFLOW ̲SEARCH boolean specifying
                             that search in overflow block shall
                             be performed
             ;R4     "   c k Pointer to TMP ̲OPERATION
             ;R5     "   c k Pointer to TMP ̲COROUTINE ̲RECORD
             ;R6) :  "   c d LINK
                     ERROR ̲OK;
              R0-R3,R7 - d

             F̲a̲t̲a̲l̲ ̲e̲r̲r̲o̲r̲s̲

             None

         g)  F̲i̲n̲d̲ ̲S̲e̲c̲o̲n̲d̲a̲r̲y̲

             F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

             This procedure finds one record with specified
             secondary key, okay return is used when the record
             is found.

             If no record with specified key is found error
             exit is used.

             The table to be searched in is specified by TMP
             ̲COROUTINE ̲RECORD.TABLE and the key to be searched
             for is specified by TMP ̲COROURINE ̲RECORD.KEY.



             The search always starts in the record specified
             by TMP ̲COROUTINE ̲RECORD.CURRENT ̲RECORD.

             TMP ̲COROUTINE ̲RECORD.SEARCH ̲FORMAT specifies the
             record fields in which the key could be present.

             At output TMP ̲COROUTINE ̲RECORD.CURRENT ̲RECORD points
             to the record containing specified key, TMP ̲COROUTINE
             ̲RECORD.CURRENT ̲INDEX will contain index of this
             record.

             C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

             FIND ̲SECONDARY
             (R0 ; " - r FIELD ̲COUNT
              R5 ; " c k Pointer to TMP ̲COROUTINE ̲RECORD
              R6); " c d LINK
              ERROR ̲OK ;
              R1-R4  - k
              R7     - k


             F̲a̲t̲a̲l̲ ̲E̲r̲r̲o̲r̲s̲

             None


         h)  F̲i̲n̲d̲ ̲K̲E̲Y̲

             This procedure searches the primary key specified
             by TMP ̲COROUTINE ̲RECORD.KEY in the table specified
             by TMP ̲COROUTINE ̲RECORD.TABLE.

             At output a pointer to the record having specified
             key or to the record having the key next to specified
             key is delivered, a NIL pointer means that the
             key is greater than highest key in table.

             TMP ̲COROUTINE ̲RECORD.CURRENT ̲RECORD and TMP ̲COROUTINE
             ̲RECORD.CURRENT ̲INDEX are updated to actual values.

             Okay exit is used if the key is found, otherwise
             error exit is used.

             C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

             FIND ̲KEY

             (R5 ; " c k Pointer to TMP ̲COROUTINE ̲RECORD
              R2 ; " - r Pointer to record or NIL
              R6); " c d LINK
              ERROR ̲OK ;


             F̲a̲t̲a̲l̲ ̲E̲r̲r̲o̲r̲s̲

             None

         i)  B̲i̲n̲a̲r̲y̲ ̲S̲e̲a̲r̲c̲h̲

             F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

             This procedure finds the record with specified
             key in specified table.

             The key is specified by means of a KEY ̲DESCRIPTION.

             The table is specified by means of an ARRAY ̲DESCRIPTION.

             If the key is found a pointer to the record containing
             it is delivered at output, if the key is not found
             the pointer identifies the record having the key
             next to actual key.

             If the table is empty or if actual key is higher
             than the key of last record in the table a NIL
             pointer is specified at output.

             OKAY exit is only used in the case where actual
             key is found.

             This procedure works on both direct organized tables
             and on tables where the records are organized by
             means of a pointer array.


             C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

             BINARY ̲SEARCH
             (R4 ; " c k Pointer to KEY ̲DESCRIPTION
              R7 ; " c k Pointer to ARRAY ̲DESCRIPTION
              R0 ; " - k Index of current record or NIL
              R2 ; " - r Pointer to current record or NIL
              R6); " k d LINK
              ERROR ̲OK ;
              R1     - k
              R3     - k
              R5     - k


             F̲a̲t̲a̲l̲ ̲E̲r̲r̲o̲r̲s̲

             None


         j)  C̲o̲m̲p̲a̲r̲e̲

             F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

             This procedure compares two word strings and the
             exit value specifies the result of the comparison.An
             one word string is considered an INTEGER all other
             length strings are considered BYTE ARRAYs.

             The exit value will be one of the following:

             -   LOWER which means that STRING1 has a lower
                 integer value than STRING2

             -   SAME which means that STRING1 has same integer
                 value as STRING2.

             -   HIGHER which means that STRING1 has a higher
                 integer value than STRING2

             NOTE that the string must not be of 0 words length


             C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

             COMPARE 
             (R0 ; " c k COUNT
              R4 ; " c k Pointer to STRING1
              R7 ; " c k Pointer to STRING2
              R6); " c d LINK
              COMPARE ̲RESULT ;
              R1-R3  - k
              R5     - k


             F̲a̲t̲a̲l̲ ̲E̲r̲r̲o̲r̲s̲

             None


4.2.2    U̲p̲d̲a̲t̲e̲ ̲S̲u̲b̲p̲a̲c̲k̲a̲g̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲



4.2.2.1  F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         Update Subpackage performs all functions causing recoverable
         changes in TMP data.  The functions are:

         -   Insert Record
         -   Remove Record
         -   Single Change Field Position
         -   Global Change Field Position
         -   Single Change Field Value
         -   Global Change Field Value
         -   Lock Table
         -   Unlock Table
         -   Reorganize
         -   Abandon Reorganize
         -   Backup
         -   System Start Up
         -   Set GSN flags
         -   Set System Parameters

         For functional specification of a single function (b)
         4.1.

         When one of these functions except Lock Table have
         been completed, the change will always be recoverable.



4.2.2.2  U̲p̲d̲a̲t̲e̲ ̲S̲u̲b̲p̲a̲c̲k̲a̲g̲e̲ ̲S̲o̲f̲t̲w̲a̲r̲e̲ ̲S̲t̲r̲u̲c̲t̲u̲r̲e̲

         In the following, the software components of each module
         are identified.



4.2.2.2.1    U̲p̲d̲a̲t̲e̲ ̲C̲o̲m̲m̲u̲n̲i̲c̲a̲t̲i̲o̲n̲

         The Update Communication module consists of the coroutine
         UPDATE ̲COMMUNICATION.



4.2.2.2.2    S̲e̲a̲r̲c̲h̲

         The Search module consists of one procedure, SEARCH.


4.2.2.2.3    U̲p̲d̲a̲t̲e̲ ̲R̲e̲c̲o̲r̲d̲

         The Update Record module consists of nine procedures:
         
         -   PERFORM ̲UPDATE
         -   REMOVE ̲REC
         -   INSERT ̲REC
         -   SINGLE ̲FIELD ̲POS
         -   SINGLE ̲FIELD ̲VAL
         -   GLOBAL ̲FIELD ̲UPD
         -   PREP ̲TOTAL ̲REC
         -   PREP ̲FIELD ̲POS
         -   PREP ̲FIELD ̲VAL



4.2.2.2.4    U̲p̲d̲a̲t̲e̲ ̲D̲i̲s̲k̲

         The Update Disk module consists of the following procedures:

         -   WRITE ̲WORDS
         -   WRITE ̲DISK ̲BLOCK
         -   COPY ̲TABLE
         -   COPY ̲FILE
         -   SAVE ̲BLOCK
         -   WRITE ̲TABLE ̲DESCRIPTION
         -   UPDATE ̲ORIGINAL ̲TABLE
         -   GET ̲BACKUP ̲DIR
         -   INITIALIZE ̲RECOVERY ̲RECORD
         -   DISABLE ̲SEARCH
         -   ENABLE ̲SEARCH
         -   MEMORY ̲RECOVER
         -   DISK ̲RECOVER



4.2.2.2.5    S̲u̲p̲p̲o̲r̲t̲

         The Support module consists of one coroutine and two
         procedures:

         -   SUPPORT Coroutine

         -   REORGANIZE Procedure
         -   BACKUP Procedure





4.2.2.2.6    S̲t̲a̲r̲t̲ ̲U̲p̲

         Start Up module consists of five procedures:

         -   SYSTEM ̲START ̲UP
         -   INITIALIZE ̲TMP
         -   INITIAL ̲START
         -   BACK ̲UP ̲START
         -   RECOVERY ̲START



4.2.2.3  U̲p̲d̲a̲t̲e̲ ̲S̲u̲b̲p̲a̲c̲k̲a̲g̲e̲ ̲C̲o̲n̲t̲r̲o̲l̲ ̲L̲o̲g̲i̲c̲

         Fig. 4.2.2.3-1 shows the control logic of Update Subpackage.

         Requests are received from UPDATE ̲SYNCEL.

         The request may be processed by UPDATE ̲COMMUNICATION
         coroutine itself or passed on to PERFORM ̲UPDATE procedure
         or SUPPORT ̲RQ ̲SEM.

         PERFORM ̲UPDATE performs an update by means of the procedures
         shown.

         SUPPORT receives a request from SUPPORT ̲RQ ̲SEM and
         performs it by means of the procedures shown.  UPDATE
         ̲COMMUNICATION and SUPPORT coroutines share a common
         buffer by waiting at BUFFER ̲SEM for reserving the buffer
         and signalling BUFFER ̲SEM by releasing buffer.  UPDATE
         ̲COMMUNICATION will also pass an abandon reorganize
         request on via BUFFER ̲SEM.

         Search coroutines are deactivated by waiting for DISABLE
         ̲LOCK semaphore and then waiting twice for DISABLE ̲SEM
         and activated again by signalling DISABLE ̲SEM twice
         and then signalling DISABLE ̲LOCK semaphore.

         REORGANIZE procedure requests Disk searches by signalling
         DISK ̲SEARCH ̲SEM, and receives response from SUPPORT
         ̲RS ̲SEM.








                      Fig. 4.2.2.3-1


4.2.2.4  U̲p̲d̲a̲t̲e̲ ̲S̲u̲b̲p̲a̲c̲k̲a̲g̲e̲ ̲M̲o̲d̲u̲l̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲s̲



4.2.2.4.1    U̲p̲d̲a̲t̲e̲ ̲C̲o̲m̲m̲u̲n̲i̲c̲a̲t̲i̲o̲n̲ ̲M̲o̲d̲u̲l̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲



4.2.2.4.1.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         This module awaits requests to the Update Subpackage.

         The action to be taken when a request is received depends
         on the function referenced by the request.

         -   Requests requiring much time are passed on to the
             Support Module.

         -   Table Update requests are passed on to the Update
             Module.

         -   Simple Update requests are performed by this module
             itself.

             Access rights are checked and if they are accepted
             function is performed.  Completion Code is returned
             to caller.



4.2.2.4.1.2 U̲p̲d̲a̲t̲e̲ ̲C̲o̲m̲m̲u̲n̲i̲c̲a̲t̲i̲o̲n̲ ̲I̲n̲t̲e̲r̲f̲a̲c̲e̲

         This module has following interfaces:

         a)  R̲e̲c̲e̲i̲v̲e̲ ̲R̲e̲q̲u̲e̲s̲t̲

             c.f. 4.2.2.7.1

         b)  S̲e̲n̲d̲ ̲R̲e̲s̲p̲o̲n̲s̲e̲

             c.f. 4.2.2.7.2

         c)  U̲p̲d̲a̲t̲e̲

             The procedure UPDATE is called c.f. 4.2.2.4.3.2.

         d)  P̲a̲s̲s̲ ̲O̲n̲ ̲T̲o̲ ̲S̲u̲p̲p̲o̲r̲t̲ ̲M̲o̲d̲u̲l̲e̲

             TMP ̲COROUTINE ̲RECORD.INPUT is sent to SUPPORT ̲RQ
             ̲SEM in an INPUT ̲OPERATION c.f. 4.2.2.4.5.2.



         e)  A̲b̲a̲n̲d̲o̲n̲ ̲R̲e̲o̲r̲g̲a̲n̲i̲z̲e̲

             An ABANDON ̲REORGANIZE request is sent to BUFFER
             ̲SEM operation semaphore in a TMP ̲OPERATION.



4.2.2.4.1.3 U̲p̲d̲a̲t̲e̲ ̲C̲o̲m̲m̲u̲n̲i̲c̲a̲t̲i̲o̲n̲ ̲C̲o̲m̲p̲o̲n̲e̲n̲t̲s̲

         This module consists of the coroutine UPDATE ̲COMMUNICATION.



4.2.2.4.1.4 U̲p̲d̲a̲t̲e̲ ̲C̲o̲m̲m̲u̲n̲i̲c̲a̲t̲i̲o̲n̲ ̲D̲a̲t̲a̲

         D̲a̲t̲a̲ ̲R̲e̲f̲e̲r̲e̲n̲c̲e̲s̲

         TMP ̲COROUTINE ̲RECORD         cf. 4.1.4.1
         TMP ̲OPERATION                cf. 4.1.4.1
         TMP ̲REQUEST                  cf. 4.1.4.1
         TABLE ̲DESCRIPTION ̲ARRAY      cf. 4.1.4.2
         GSN ̲ARRAY                    cf. 4.1.4.6
         SYSTEM ̲PARAMETER ̲ARRAY       cf. 4.1.4.5
         WORKING ̲STORAGE              (a) 11
         RECOVERY ̲RECORD              cf. 4.2.2.5

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         TABLE ̲DESCRIPTION ̲ARRAY       (M)
         GSN ̲ARRAY                     (M)
         SYSTEM ̲PARAMETER ̲ARRAY        (M)
         WORKING ̲STORAGE               (M)
         RECOVERY ̲RECORD               (M)

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         None


4.2.2.4.1.5 U̲p̲d̲a̲t̲e̲ ̲C̲o̲m̲m̲u̲n̲i̲c̲a̲t̲i̲o̲n̲ ̲D̲e̲s̲i̲g̲n̲

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         DEFINE ̲SERVICE ̲SYSTEM        (b) 3.2.6.6
         AWAIT ̲SYNCEL                 (b) 3.2.6.7
         MAP ̲PARAMS ̲IN                cf. 4.1.5.2
         MAP ̲PARAMS ̲OUT               cf. 4.1.5.3
         CHECK ̲ADDRESSES              cf. 4.1.5.4
         SIGNAL ̲OPSEM                 (b) 3.2.5.7
         SEND ̲RESPONSE                cf. 4.1.5.5
         PERFORM ̲UPDATE               cf. 4.2.2.4.3

         N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

         External requests are awaited at UPDATE ̲SYNCEL.

         A TMP ̲REQUEST function invokes the UPDATE procedure.

         The functions   TMP ̲LOCK ̲TABLE
                         TMP ̲UNLOCK ̲TABLE
                         TMP ̲SET ̲GSN ̲FLAGS
                         TMP ̲SET ̲SYSTEM ̲PARAMETERS

         are performed by this module itself.

         Other functions are passed on to support module via
         an OPERATION ̲SEMAPHORE.

         F̲l̲o̲w̲g̲r̲a̲m̲

         c.f. fig. 4.2.2.4.1.5-1


         Start


         EQUIVALENCE(RUNNING ̲COROUTINE,C:TMP ̲COROUTINE
         ̲RECORD)

         Coroutine UPDATE ̲COMMUNICATION


         Initialize Data


         DEFINE ̲SERVICE ̲SYSTEM (UPDATE ̲SYNCEL, OBJECT)


         FOREVER LOOP


         WAIT ̲OPSEM (POOL ̲SEM)


         AWAIT ̲SYNCEL(UPDATE ̲SYNCEL)(C.INPUT, COUNT,
         CC):  OK

         FUNCTION = TABLE FUNCTION ?  CHECK TABLE ID


         Case C.INPUT.FUNCTION

              TMP ̲REQUEST                ? - PERFORM
         ̲UPDATE

              TMP ̲LOCK ̲TABLE             ? - Lock Table

              TMP ̲UNLOCK ̲TABLE           ? - Unlock
         Table

              TMP ̲SET ̲GSN ̲FLAGS          ? - Set GSN
         Flags

              TMP ̲SET ̲SYSTEM ̲PARAMETERS  ? - Set System
         Parameter

              TMP ̲ABANDON ̲REORGANIZE     ? - Signal
         BUFFER ̲SEM

              OTHERWISE                  ? - Pass On
         To Support

         End case C.INPUT.FUNCTION







               Fig. 4.2.2.4.1.5-1


         L̲o̲c̲k̲ ̲T̲a̲b̲l̲e̲

         If TABLE ̲DESCRIPTION.ATTRIBUTES.LOCK in TABLE ̲DESCRIPTION
         of specified table is FALSE, it is set to TRUE and
         TMP ̲COROUTINE ̲RECORD.RESPONSE.INPUT.CC is set to ALREADY
         ̲LOCKED.

         Finally, the procedure SEND ̲RESPONSE is always called.



         U̲n̲l̲o̲c̲k̲ ̲T̲a̲b̲l̲e̲

         If TABLE ̲DESCRIPTION.ATTRIBUTES.LOCK in TABLE ̲DESCRIPTION
         of specified table is TRUE, it is set to FALSE and
         TMP ̲COROUTINE ̲RECORD.RESPONSE.INPUT.CC is set to OK.
          If LOCK field is FALSE TMP ̲COROUTINE ̲RECORD.RESPONSE.INPUT.CC
         is set to NOT ̲LOCKED.

         Finally, the procedure SEND ̲RESPONSE is always called.


         S̲e̲t̲ ̲G̲S̲N̲ ̲F̲l̲a̲g̲s̲

         If access rights are accepted and GSN ̲ID is known,
         requested update is performed and TMP SYSTEM DATA are
         written to disk.


         S̲e̲t̲ ̲S̲y̲s̲t̲e̲m̲ ̲P̲a̲r̲a̲m̲e̲t̲e̲r̲s̲

         If access rights are accepted and PARAMETER ̲ID is known,
         the data area of caller is mapped in by calling MAP
         ̲PARAMS ̲IN and specified parameter is updated and TMP
         ̲SYSTEM ̲DATA is written to disk.


         S̲i̲g̲n̲a̲l̲ ̲B̲U̲F̲F̲E̲R̲ ̲S̲E̲M̲

         A TMP ̲OPERATION is received from BUFFER ̲SEM. If TMP
         ̲OPERATION.FUNCTION is equal to REORGANIZE it is changed
         to ABANDON ̲REORGANIZE and the Operation is returned
         to BUFFER ̲SEM operation semaphore. Then an OK completion
         code is returned to caller.

         If TMP ̲OPERATION .FUNCTION is not equal to REORGANIZE
         no reorganization is going on and a response with CC
         set to REJECTED is returned to caller. Final the OPERATION
         is returned to BUFFER ̲SEM.



         P̲a̲s̲s̲ ̲O̲n̲ ̲T̲o̲ ̲S̲u̲p̲p̲o̲r̲t̲

         The request is passed on by signalling the TMP ̲OPERATION
         identified by TMP ̲COROUTINE ̲RECORD.INPUT to SUPPORT
         ̲RQ ̲SEM operation semaphore.



4.2.2.4.2    S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲



4.2.2.4.2.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         The record identified by primary key specified by TMP
         ̲OPERATION.PARAMS.ENTRY is searched in the table specified
         by TMP ̲COROUTINE ̲RECORD.TD.

         The search procedures work in UPDATE ̲COMMUNICATION
         ̲COREC so all fields in this record describing actual
         data being searched in will be updated on return. Cf.TMP
         ̲COROUTINE ̲RECORD 4.1.4.1.

         OKAY EXIT is used if the record is found otherwise
         ERROR EXIT is used.



4.2.2.4.2.2 S̲e̲a̲r̲c̲h̲ ̲I̲n̲t̲e̲r̲f̲a̲c̲e̲

         C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         SEARCH
         (R2 ; " c k      TWO ̲LEVEL ̲SEARCH : BOOLEAN Specifying
                          if search shall be performed in second
                          level table if it exists.
          R3 ; " c k      OVERFLOW ̲SEARCH : BOOLEAN Specifying
                          is search shall be performed in overflow
                          block.
          R4 ; " c k Pointer to TMP ̲OPERATION
          R5 ; " c k      Pointer to TMP ̲COROUTINE ̲RECORD
          R6); " c d LINK
          ERROR ̲OK ;
          R0-R1  - k
          R7     - d


         F̲a̲t̲a̲l̲ ̲E̲r̲r̲o̲r̲s̲

         None


4.2.2.4.2.3 S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲C̲o̲m̲p̲o̲n̲e̲n̲t̲s̲

         This module consists of the procedure SEARCH:



4.2.2.4.2.4 S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲a̲t̲a̲

         D̲a̲t̲a̲ ̲R̲e̲f̲e̲r̲e̲n̲c̲e̲s̲

         TMP ̲COROUTINE ̲RECORD                  cf. 4.1.4.1.1
         TABLE ̲DESCRIPTION                     cf. 4.1.4.1.2

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         TMP ̲COROUTINE ̲RECORD     (M)
         TABLE ̲DESCRIPTION

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         None



4.2.2.4.2.5 S̲e̲a̲r̲c̲h̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲e̲s̲i̲g̲n̲

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         FIND ̲KEY                     cf. 4.2.1.7.h
         FIND ̲DISK ̲KEY                cf. 4.2.1.7.f

         N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

         If the table to be searched in is a memory located
         table FIND ̲KEY is called otherwise FIND ̲DISK ̲KEY is
         called.

         The search will go on until:

         -   Record is found
         -   A Record with higher key is found
         -   End of table is reached

         F̲l̲o̲w̲g̲r̲a̲m̲

         N.A


4.2.2.4.3    U̲p̲d̲a̲t̲e̲ ̲R̲e̲c̲o̲r̲d̲ ̲M̲o̲d̲u̲l̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲



4.2.2.4.3.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         This procedure perform update of one or more records
         in one table, if records in an associated table are
         affected by the update these records will also be updated.

         This procedure maintain execution of the functions
         descriped by the 6 TMP UPDATE INTERFACES refer ICD/009
         sec. 4.1.1.2.

         After a succeeded update TMP ̲STATISTICS is updated.



4.2.2.4.3.2 I̲n̲t̲e̲r̲f̲a̲c̲e̲

         C̲a̲l̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         PERFORM ̲UPDATE

         (R4;    "C K    Pointer to TMP ̲OPERATION

          R5;    "C K    Pointer to TMP ̲COROUTINERECORD

          R0 - R3 - K    LINK

          R7      - D



4.2.2.4.3.3 U̲p̲d̲a̲t̲e̲ ̲R̲e̲c̲o̲r̲d̲ ̲M̲o̲d̲u̲l̲e̲ ̲C̲o̲m̲p̲o̲n̲e̲n̲t̲s̲

         This module consists of the nine procedures:

         -   PERFORM ̲UPDATE

         -   REMOVE ̲REC

             This procedure removes the record specified by
             primary key referenced by
             TMP ̲OPERATION.PARAMS.ENTRY from the table specified
             by TMP ̲COROUTINE ̲RECORD.TD



         -   INSERT ̲REC

             This procedure inserts the record specified by
             TMP ̲OPERATION.PARAMS.ENTRY in the table specified
             by TMP ̲COROUTINE ̲RECORD.TD, in accordance to its
             primary key.

         -   SINGLE ̲FIELD ̲POS

             In the table specified by TMP ̲COROUTINE ̲RECORD.TD
             the record identified by the primary key specified
             by TMP ̲OPERATION.PARAMS.ENTRY is found.

             Then the fields specified by TMP ̲COROUTINE ̲RECORD.WRITE
             ̲FORMAT having the value specified by TMP ̲COROUTINE
             ̲RECORD.PARAMS.BUFFER1 are substituted with the
             value specified by
             TMP ̲OPERATION.PARAMS.BUFFER2.

             If actual fields are repeated fields BUFFER1 or
             BUFFER2 may be a NIL pointer. This means respectively
             that a new simple field shall be inserted or a
             simple field shall be removed.

         -   GLOBAL ̲FIELD ̲UPD

             In the table specified by TMP ̲COROUTINE ̲RECORD.TD
             all records will be scanned and possibly updated.

             The kind of update depends on function code.

             -   Function code equal to GLOBAL ̲FIELD ̲POS causes
                 record updates as in SINGLE ̲FIELD ̲POS

             -   Function code equal to GLOBAL ̲FIELD ̲VAL causes
                 record updates as in SINGLE ̲FILED ̲VAL

         -   PREP ̲TOTAL ̲REC

             Input parameters for the function REMOVE RECORD
             or INSERT ̲RECORD are checked and prepared for actual
             function.

             The pointer in TMP ̲OPERATION.PARAMS.ENTRY is converted
             to TMP address and it is checked that it points
             to an area big enough to contain the expected input
             parameter.

             If function is INSERT ̲RECORD actual RECORD-DESCRIPTION
             is copied into TMP ̲COROUTINE ̲RECORD.WRITE ̲FORMAT.



         -   PREP ̲FIELD ̲POS

             Input parameters for the function SINGLE ̲CHANGE
             ̲FIELD ̲POSITION or GLOBAL ̲CHANGE ̲FIELD ̲POSITION
             are checked and prepared for actual function.

             The pointer in TMP ̲OPERATION.PARAMS.BUFFERl is
             converted to TMP address and it is checked that
             it points to an area big enough to contain the
             expected input parameter.

             If function is SINGLE ̲CHANGE ̲FIELD ̲POSITION the
             pointer in TMP ̲COROUTINE ̲RECORD.ENTRY is checked
             and converted in same way as BUFFER1 pointer.

             It is checked that MASK1 does not reference primary
             key or an organized secondary key.

             Actual RECORD ̲DESCRIPTION is modified in accordance
             with MASK1 and copied into TMP ̲COROUTINE ̲RECORD.WRITE
             ̲FORMAT.

         -   PREP ̲FIELD ̲VAL

             Input parameters for the function SINGLE ̲CHANGE
             ̲FIELD ̲VALUE or GLOBAL ̲CHANGE ̲FIELD ̲VALUE are checked
             and prepared for actual functions.

             The pointers in TMP ̲OPERATION.PARAMS.BUFFER1 and
             BUFFER2 are converted to TMP addresses and it is
             checked that they points to areas big enough to
             contain the expected input parameters.

             If function is SINGLE ̲CHANGE ̲FIELD ̲VALUE pointer
             in TMP ̲COROUTINE ̲RECORD.ENTRY is checked and converted
             in same way as BUFFER1 and BUFFER2 pointers.

             It is checked that MASK1 does not reference primary
             key or an organized secondary key.

             Actual RECORD ̲DESCRIPTION is modified in accordance
             with MASK1 and copied into TMP ̲COROUTINE ̲RECORD.WRITE
             ̲FORMAT.



4.2.2.4.3.4 U̲p̲d̲a̲t̲e̲ ̲R̲e̲c̲o̲r̲d̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲a̲t̲a̲

         D̲a̲t̲a̲ ̲R̲e̲f̲e̲r̲e̲n̲c̲e̲s̲

         TMP ̲COROUTINE ̲RECORD         cf. 4.1.4.1.17
         TABLE ̲DESCRIPTION ̲ARRAY      cf. 4.1.4.2.2
         TMP ̲BLOCK                    cf. 4.1.4.1.4


         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         TMP ̲COROUTINE ̲RECORD       (M)
         TABLE ̲DESCRIPTION ̲ARRAY    (M)

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         None



4.2.2.4.3.5 U̲p̲d̲a̲t̲e̲ ̲R̲e̲c̲o̲r̲d̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲e̲s̲i̲g̲n̲

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         MAP ̲PARAMS ̲IN                cf. 4.1.5.2
         MAP ̲PARAMS ̲OUT               cf. 4.1.5.3
         SEARCH                       cf. 4.2.2.4.2
         SAVE ̲BLOCK                   cf. 4.2.2.4.4
         DISK ̲RECOVER                 cf. 4.2.2.4.4
         MEMORY ̲RECOVER               cf. 4.2.2.4.4
         READ ̲DISK ̲BLOCK              cf. 4.1.5.7
         CHECK ̲ADDRESSES              cf. 4.1.5.4
         MODIFY ̲RECORD                cf. 4.1.5.1
         FIND ̲SECONDARY               cf. 4.2.1.4.3
         INSERT                       cf. 4.1.5.6
         BINARY ̲SEARCH                cf. 4.2.1.4.3

         N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

         The UPDATE procedure performs one update request at
         a time.

         When a single disk block has been updated, it is moved
         to WORKING ̲AREA file by the procedure SAVE ̲BLOCK.

         The update is effective after one of the procedures
         MEMORY ̲RECOVER or DISK ̲RECOVER have been called.

         F̲l̲o̲w̲g̲r̲a̲m̲s̲

         c.f. fig. 4.2.2.4.3.5-1


         Start


         Procedure UPDATE ̲RECORD:  OK


         EQUIVALENCE(RUNNING ̲COROUTINE,C:TMP ̲COROUTINE
         ̲RECORD)

         WAIT ̲OPSEM(BUFFER ̲SEM)(BUFFER ̲HANDLE)

         BUFFER ̲HANDLE.FUNCTION EQ REORGANIZE? C.RESPONSE.CC
         = REJECTED

         Case MAP ̲PARAMS ̲IN:  ERROR ̲OK:

           - ERROR?

         End case MAP ̲PARAMS ̲IN

         Case C.INPUT.FUNCTION

            - REMOVE ̲RECORD                       
          ? - REMOVE ̲RECORD

            - INSERT ̲RECORD                       
          ? - INSERT ̲RECORD

            - SINGLE ̲CHANGE ̲FIELD ̲POSITION        
          ? - One Field Pos.

            - GLOBAL ̲CHANGE ̲FIELD ̲POSITION        
          ? - All Field Pos.

            - SINGLE ̲CHANGE ̲FIELD ̲VALUE           
          ? - One Field Value

            - GLOBAL ̲CHANGE ̲FIELD ̲VALUE           
          ? - All Field Value


         End C.INPUT.FUNCTION

         INCREMENT (TABLE ̲DESCRIPTION(C.INPUT.TABLE
         ̲ID).STATISTICS.
  UPDATE ̲REQUESTS) AND UPDATE TIME STAMP

         MAP ̲PARAMS ̲OUT

         SIGNAL ̲OPSEM(BUFFER ̲SEM,BUFFER ̲HANDLE)

         MOVE ̲WORKING ̲STORAGE

         SEND ̲RESPONSE

         Stop





               Fig. 4.2.2.4.3.5-1


4.2.2.4.4    U̲p̲d̲a̲t̲e̲ ̲D̲i̲s̲k̲ ̲M̲o̲d̲u̲l̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲



4.2.2.4.4.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         This module consist of procedures used for updating
         data on disk

         a)  WRITE ̲WORDS

             This procedure copies COUNT words from memory to
             specified file.

         b)  WRITE ̲DISK ̲BLOCK

             This procedure copies the TMP ̲BLOCK located in
             the TMP ̲BUFFER specified by TMP ̲COROUTINE ̲RECORD.BUFFER
             to its original location in the file specified
             by TMP ̲BUFFER.FILE.

             TMP ̲BUFFER.BLOCK ̲COUNT specifies no of actual block;

         c)  COPY ̲TABLE

             Table identified by TMP ̲COROUTINE ̲RECORD.TD%TABLE
             ̲
             DESCRIPTION is copied to specified output file.

             The table is copied to same block numbers in output
             file as they where read from in input file.

         d)  COPY ̲FILE

             INPUT FILE is copied to OUTPUT FILE.

             The copying are performed via the TMP ̲BUFFER specified
             by TMP ̲COROUTINE ̲RECORD.BUFFER.

             If an disk operation returns in error exit and
             completion code is not EOF got by a 'read' command,
             error exit is used and the IO system completion
             code is returned, otherwise okay exit is used.

         e)  SAVE ̲BLOCK

             This procedure copies the TMP ̲BUFFER specified
             by TMP ̲COROUTINE ̲RECORD.BUFFER to UPD ̲RECOVERY
             file.

             UPD ̲RECOVERY.COMPLETE1 and UPD ̲RECOVERY.COMPLETE2
             are set to the value of COMPLETE.

             If COMPLETE is TRUE, UPD ̲RECOVER is written to
             disk.



         f)  WRITE ̲TABLE ̲DESCRIPTION

             This procedure copies RECOVERY ̲RECORD.ATTRIBUTES
             into ATTRIBUTES of the TABLE ̲DESCRIPTION identified
             by TMP ̲COROUTINE ̲RECORD.TD and into all TABLE ̲DESCRIPTIONS
             associated to this one.

             All affected TABLE ̲DESCRIPTIONS are written to
             disk in both memory files. First in MEMORY ̲SAVE
             and then in MEMORY ̲WORK.

         g)  UPDATE ̲ORIGINAL ̲TABLE

             This procedure copies a table from UPD ̲WORK ̲AREA
             into its original file.

             The table to be copied is identified by TMP ̲COROUTINE
             ̲RECORD.TD 

         h)  GET ̲BACK ̲UP ̲DIR

             This procedure opens the directory containing backup
             of TMP files. If LAST ̲ISSUE is TRUE the latest
             backup version is opened, otherwise the oldest
             version is opened.

             If a disk access command returns a completion code
             different from OK ERROR ̲EXIT is used and the completion
             code is passed on.

         i)  MEMORY ̲RECOVER

             This procedure copies the updated parts of memory
             to disk into both memory files.

             If SINGLE ̲ENTRY is TRUE only TMP ̲COROUTINE ̲RECORD.CURRENT
             ̲RECORD is copied. Otherwise the whole table is
             copied.

             TABLE ̲DESCRIPTION.ATTRIBUTES identified by TMP
             ̲COROUTINE ̲RECORD.TD is timestamped and copied to
             disk.

         j)  DISK ̲RECOVER

             This procedure copies the updated blocks of a disk
             table into the file containing actual table.



             TABLE ̲DESCRIPTION.ATTRIBUTES identified by TMP
             ̲COROUTINE ̲RECORD.TD and its associated TABLE ̲ATTRIBUTES
             is timestamped and copied to disk.

             UPD ̲RECOVER.COUNT specifies no of blocks to be
             copied. UPD ̲RECOVER.R ̲TYPE specifies if the whole
             table shall be copied or if only a number of single
             blocks shall be copied.

         k)  INITIALIZE ̲RECOVERY ̲RECORD

             This procedure initializes the specified RECOVERY
             ̲RECORD so that it is ready for a new update of
             a disk table or a support function.

         l)  DISABLE ̲SEARCH

             This procedure disables all search functions untill
             the procedure ENABLE ̲SEARCH are called.

         m)  ENABLE ̲SEARCH

             This procedure enables search functions.

             It must only be called when the procedure DISABLE
             ̲SEARCH has been called.



4.2.2.4.4.2 U̲p̲d̲a̲t̲e̲ ̲D̲i̲s̲k̲ ̲M̲o̲d̲u̲l̲e̲ ̲I̲n̲t̲e̲r̲f̲a̲c̲e̲

         a)  WRITE ̲WORDS

             (R0     "C D    COUNT specifying no. of words to
                             be written
             ;R1     "C D    WORDS pointer the first word to
                             be written
             ;R2     "C D    FILE ̲WORD ̲ADDRESS address of first
                             word in file to be modified
             ;R4     "C D    FILE:TMP ̲FILE ̲ID ̲TYPE specifying
                             output file
             ;R5     "C K    Pointer to TMP ̲COROUTINE ̲RECORD

             ;R6);   "C D    LINK

              R3, R7  - D




         b)  WRITE ̲DISK ̲BLOCK

             (R5     "C K    Pointer to TMP ̲COROUTINE ̲RECORD

             ;R7     "- R    CC

             ;R6);   "C D    LINK

              R0-R4  - D

         c)  COPY ̲TABLE

             (R4     "C D    Pointer to file description of
                             OUTPUT FILE
              R5;    "C K    Pointer to TMP ̲COROUTINE ̲RECORD

              R6);   "C D    LINK

              R0 - R3, R7 - D

         d)  COPY ̲FILE

             (R3     "C D    Pointer to file description of
                             INPUT FILE
              R4;    "C D    Pointer to file description of
                             OUTPUT FILE
              R5;    "C K    Pointer to TMP ̲COROUTINE ̲RECORD

              R7;    - R     CC

              R6;    "C D    LINK

             ERROR ̲OK ;

             R0 - R2, R7 - D

         f)  WRITE ̲TABLE ̲DESCRIPTION

             (R4     "C D    Pointer to RECOVERY ̲RECORD

             ;R5     "C K    Pointer to TMP ̲COROUTINE ̲RECORD

             ;R6) ;  "C D    LINK

              R0-R3  - D



         g)  UPDATE ̲ORIGINAL ̲TABLE

             (R5     "C K    Pointer to TMP ̲COROUTINE ̲RECORD

             ;R6);   "C D    LINK

              R0-R4  - D

         h)  GET ̲BACK ̲UP ̲DIR

             (R3     "C D    LAST ̲ISSUE : BOOLEAN

             ;R4     "- R    FDCB INDEX of searched directory

             ;R7     "- R    CC completion code returned from
                             a system call
              R6):   "C K    LINK

             ERROR ̲OK ;

              R0-R2, R5 - D

         i)  MEMORY ̲RECOVER

             (R3     "C D    SINGEL ̲ENTRY : BOOLEAN specifying
                             if more than one record shall be
                             written
             (R5     "C K    Pointer to TMP ̲COROUTINE ̲RECORD

              R6);   "C D    LINK

             R0 - R2, R4, R7 - D

         j)  DISK ̲RECOVER

             (R5     "C K    Pointer to TMP ̲COROUTINE ̲RECORD

              R6);   "C D    LINK

             R0 - R4, R7 - D

         k)  INITIALIZE ̲RECOVERY ̲RECORD

             (R4     "C K    Pointer to TMP ̲OPERATION

             ;R5     "C K    Pointer to TMP ̲COROUTINE ̲RECORD

             ;R7     "C K    Pointer to RECOVERY ̲RECORD

              R6);   "C D    LINK

              R0-R5  - D



         l)  DISABLE ̲SEARCH

             (R5     "C K    Pointer to TMP ̲COROUTINE ̲RECORD

             ;R6);   "C D    LINK

              R0-R4, R7 - D

         m)  ENABLE ̲SEARCH

             (R5     "C K    Pointer to TMP ̲COROUTINE ̲RECORD

             ;R6);   "C D    LINK

              R0-R4, R7 - D



4.2.2.4.4.3 U̲p̲d̲a̲t̲e̲ ̲D̲i̲s̲k̲ ̲M̲o̲d̲u̲l̲e̲ ̲C̲o̲m̲p̲o̲n̲e̲n̲t̲s̲

         This module consists of the thirteen export procedures
         described in 4.2.2.4.4.(1-2).



4.2.2.4.4.4 U̲p̲d̲a̲t̲e̲ ̲D̲i̲s̲k̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲a̲t̲a̲

         D̲a̲t̲a̲ ̲R̲e̲f̲e̲r̲e̲n̲c̲e̲s̲

         TMP ̲COROUTINE ̲RECORD         cf. 4.1.4.1
         TMP ̲BLOCK                    cf. 4.1.4.1
         TABLE ̲DESCRIPTION ̲ARRAY      cf. 4.1.4.2
         FILE ̲DESCR ̲ARRAY             cf. 4.1.4.2
         All TMP Files                (a) 11
         RECOVERY ̲RECORD              c.f. 4.2.2.5.1

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         TMP ̲COROUTINE ̲RECORD            (M)
         TABLE ̲ARRAY                     (M)
         FILE ̲DESCR ̲ARRAY                (M)
         All TMP Files                   (M)
         RECOVERY ̲RECORD                 (M)

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         None





4.2.2.4.4.5 U̲p̲d̲a̲t̲e̲ ̲D̲i̲s̲k̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲e̲s̲i̲g̲n̲

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         READ ̲BYTES            (d) 4.3.6.1
         MODIFY ̲BYTES          (d) 4.3.6.2



4.2.2.4.5    S̲u̲p̲p̲o̲r̲t̲ ̲M̲o̲d̲u̲l̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲



4.2.2.4.5.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         This module performs reorganization and backup of TMP
         data.

         -   Reorganize

             A reorganization means that all tables not reorganized
             after each update is reorganized e.g. unused table
             entries are removed and entries from overflow areas
             are inserted at their proper positions.

             Index tables and secondary key organized tables
             are also reorganized.

             After a completed reorganization every disk block
             will contain the number of entries defined at system
             generation.

         -   Backup

             Backup means that all TMP data are copied from
             online to SYS ̲GEN offline volume.

         -   SYSTEM ̲START ̲UP

             From initialization time until this command has
             been received, memory table updates will only effect
             the memory version (i.e. no update of disk version
             is performed).



4.2.2.4.5.2 S̲u̲p̲p̲o̲r̲t̲ ̲M̲o̲d̲u̲l̲e̲ ̲I̲n̲t̲e̲r̲f̲a̲c̲e̲

         The support module receives requests from BUFFER ̲SEM
         or SUPPORT ̲RQ ̲SEM operation semaphores in an operation
         of TMP ̲OPERATION type. Function code is REORGANIZE
         or BACKUP or SYSTEM ̲START ̲UP.

         The support module requests disk searches by sending
         a TMP ̲OPERATION to DISK ̲SEARCH ̲SEM and awaits associated
         response by SUPPORT ̲RS ̲SEM.



         Support module reserves UPDATE ̲BUFFER by receiving
         a TMP ̲OPERATION from BUFFER ̲SEM before it uses it.

         Same TMP ̲OPERATION is returned to BUFFER ̲SEM after
         each completed request and after each reorganized table.

         During reorganization, the TMP ̲OPERATION received from
         BUFFER ̲SEM may contain an ABANDON ̲REORGANIZE request,
         all other requests are received from SUPPORT ̲RQ ̲SEM.



4.2.2.4.5.3 S̲u̲p̲p̲o̲r̲t̲ ̲M̲o̲d̲u̲l̲e̲ ̲C̲o̲m̲p̲o̲n̲e̲n̲t̲s̲

         This module consists of four components.

         -   SUPPORT Coroutine
         -   REORGANIZE TABLE

             This procedure reorganize a table.

             TMP ̲COROUTINE ̲RECORD.TD points to TABLE ̲DESCRIPTION
             of actual table.

             If an abandon request is received error exit is
             used.

         -   REORGANIZE ̲INVERSE ̲TABLE

             This procedure reorganizes an inverse table.

             At call all the new inverse ref records must reside
             in SUPPORT ̲RECOVERY file, with first record starting
             in address null.

             TMP ̲COROUTINE ̲RECORD.TD%TABLE ̲DESCRIPTION.INVERSE
             ̲TABLE shall point at TABLE ̲DESCRIPTION of inverse
             table.

             No of records must be MAX ̲ENTRIES-ATTRIBUTES.LOAD.

         -   BACKUP

             This procedure copies all TMP files with, KIND
             = K ̲
             BACKUP, from the mirroed disk to the ofline volume
             named SYSGEN.



4.2.2.4.5.4 S̲u̲p̲p̲o̲r̲t̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲a̲t̲a̲

         D̲a̲t̲a̲ ̲R̲e̲f̲e̲r̲e̲n̲c̲e̲s̲

         TMP ̲COROUTINE ̲RECORD         cf. 4.1.4.1
         FILE ̲DESCR ̲ARRAY             cf. 4.1.4.2
         SUBPROCESS ̲DESCR ̲ARRAY       cf. 4.1.4.2
         TMP ̲FILES                    (a) 11

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         FILE ̲DESCR ̲ARRAY            (M)
         SUBPROCESS ̲DESCR ̲ARRAY
         TMP ̲FILES                   (M)

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         None



4.2.2.4.5.5 S̲u̲p̲p̲o̲r̲t̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲e̲s̲i̲g̲n̲

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         READ ̲BYTES                   (d) 4.3.6.1
         MODIFY ̲BYTES                 (d) 4.3.6.2
         WAIT ̲OPSEM                   (c) 3.2.5.7
         SIGNAL ̲OPSEM                 (c) 3.2.5.8
         SEND ̲RESPONSE                cf. 4.1.5.5

         a)  S̲u̲p̲p̲o̲r̲t̲ ̲c̲o̲r̲o̲u̲t̲i̲n̲e̲

             N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

             SUPPORT coroutine awaits requests at 
             SUPPORT ̲RQ ̲SEM when it is inactive.

             If a reorganize request is received, the procedure
             REORGANIZE is called.

             If a backup request is received, the procedure
             BACKUP is called.

             After return from these procedures SEND ̲RESPONSE
             is called and a new request is awaited.



             F̲l̲o̲w̲g̲r̲a̲m̲

             None

         b)  R̲e̲o̲r̲g̲a̲n̲i̲z̲e̲

             N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

             During reorganization a copy of the table to be
             reorganized is made. The tables in this file which
             requires reorganization are reorganized one by
             one.

             S̲i̲m̲p̲l̲e̲ ̲T̲a̲b̲l̲e̲s̲

             The records in table are reorganized by requesting
             SEARCH ̲NEXT ̲PRIMARY from the DISK ̲SEARCH coroutine.
              In this way, the records will be delivered in
             sorted order independent of if they are located
             in overflow area.

             The number of keys requested at a time is the same
             as keys per block read from TABLE ̲DESCRIPTION.

             For each block associated index in index table
             is updated to the value of last key in block.

             These steps are repeated for all blocks in a table
             and finally TABLE ̲DESCRIPTION is updated with LOAD
             and OVERLOAD.

             When all tables in a file are reorganized FILE
             ̲DESCRIPTIONs are changed so the reorganized copy
             is referenced instead of the original file.

             Now the copy is copied to its original file and
             FILE ̲DESCRIPTIONS are changed to their original
             versions.

             During manipulation with FILE ̲DESCRIPTION Search
             will be disabled.

             After manipulation, Search is enabled.

             I̲n̲v̲e̲r̲t̲e̲d̲ ̲T̲a̲b̲l̲e̲s̲

             A special problem is when the table to be reorganized
             is referenced by an organized secondary key.



             In this case each block will require additional
             manipulation as follows.

             The pointer array referencing the records is initialize
             for each block.

             A list of all secondary keys and their associated
             (block,record number) references is created.

             The copy of the secondary key table is sorted and
             formatted in blocks and its index table is updated.

             A̲b̲a̲n̲d̲o̲n̲ ̲R̲e̲o̲r̲g̲a̲n̲i̲z̲e̲

             Each time a table has been reorganized, a TMP ̲OPERATION
             is signalled to BUFFER ̲SEM and a new TMP ̲OPERATION
             is received.

             Before the TMP ̲OPERATION is signalled to BUFFER
             ̲SEM,
             TMP ̲OPERATION.FUNCTION is set to REORGANIZE.

             If the new TMP ̲OPERATION requests an ABANDON ̲REORGANIZE
             function, reorganization is stopped and a response
             is sent.

         c)  B̲a̲c̲k̲u̲p̲

             N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

             All TMP files at On Line volume are copied to associated
             files at SYS ̲GEN Of Line volume by using the procedure
             COPY ̲FILE.

             The SYS ̲GEN volume contains two incarnations of
             TMP files. A time stamp in MEMORY ̲SAVE ̲FILE tells
             which of them is the oldest Back-up copy.

             The new Back-up copy to be made is always written
             at the oldest incarnation.

             After Backup is completed CPS ̲HEADER file at SYS
             ̲
             GEN volume is updated with time for this backup.

             F̲l̲o̲w̲g̲r̲a̲m̲

             None.





4.2.2.4.6    S̲t̲a̲r̲t̲ ̲U̲p̲ ̲M̲o̲d̲u̲l̲e̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲



4.2.2.4.6.1 F̲u̲n̲c̲t̲i̲o̲n̲a̲l̲ ̲S̲p̲e̲c̲i̲f̲i̲c̲a̲t̲i̲o̲n̲

         This module performs functions related to Start Up
         and Initialization.

         Three Start Up types are supported.

         -   Current Start
         -   Backup Start
         -   Initial Start

         a)  C̲u̲r̲r̲e̲n̲t̲ ̲S̲t̲a̲r̲t̲

             Current Start is performed by the Start Up types
             COLD, WARM1, WARM2.

             Memory is reloaded from On Line volume.  If TMP
             RECOVERY ̲FILE contains consistent data, these are
             copied to appropriate locations.  Memory resident
             data will be copied both to disk and into memory.

         b)  B̲a̲c̲k̲u̲p̲ ̲S̲t̲a̲r̲t̲

             The Backup Start is performed by the Start Up type
             DEAD2.

             Online volume is reloaded from Of Line volume using
             Last Backup version of TMP data.

             Then memory is reloaded from online volume.

         c)  I̲n̲i̲t̲i̲a̲l̲ ̲S̲t̲a̲r̲t̲

             The Initial Start is performed by the Start Up
             type DEAD1.

             On Line volume is reloaded from SYS ̲GEN volume
             using Initial TMP data.

             Memory is reloaded from On Line volume.

         d)  I̲n̲i̲t̲i̲a̲l̲i̲z̲a̲t̲i̲o̲n̲

             The TMP process is initialized.



             The components to initialize are:

             -   Coroutines
             -   Coroutine Semaphores
             -   Coroutine Operations
             -   Synchronization Elements
             -   File Descriptions
             -   SUBPROCESS ̲DESCR ̲ARRAY



4.2.2.4.6.2 S̲t̲a̲r̲t̲ ̲U̲p̲ ̲M̲o̲d̲u̲l̲e̲ ̲I̲n̲t̲e̲r̲f̲a̲c̲e̲

         SYSTEM ̲START ̲UP

         (R0;    "C D  MODE : START ̲UP ̲TYPE

          R6);   "C D  LINK

          R0 - R3, R5 - D

          R7     - D

         F̲a̲t̲a̲l̲ ̲E̲r̲r̲o̲r̲s̲

         None.



4.2.2.4.6.3 S̲t̲a̲r̲t̲ ̲U̲p̲ ̲M̲o̲d̲u̲l̲e̲ ̲C̲o̲m̲p̲o̲n̲e̲n̲t̲s̲

         This module consists of four procedures:

         -   INITIAL ̲START

         -   This procedure reloads TMP initial data from SYS
             ̲GEN volume and loads system parameters and memory
             table data into memory.

         -   BACKUP ̲START

             This procedure reloads TMP backup data from SYS
             ̲GEN volume and loads system parameters and memory
             table data into memory.



         -   RECOVERY ̲START

             If UPD ̲RECOVER saved on disk specifies that an
             update was going on and possibly was not completed
             before the TMP process was stopped, this procedure
             copies the updated blocks of a disk table into
             the file containing actual table.

             If SUPPORT ̲RECOVERY saved on disk specifies that
             an reorganization was going on and one or more
             tables may be inconcistent, this tables will be
             made consistent, but it is not garantied that all
             tables are reorganized.

             If an error occur the TMP process is retired.

         -   INITIALIZE ̲TMP

             First SUBPROCESS ̲DESCR ̲ARRAY is initialized with
             data got from TMP ̲LOAD ̲TABLE.

             Then data and code associated to the COROUTINE
             ̲MONITOR are initialized.

             After this initialization TMP will await its requests
             as specified in TMP interface specification.

             Note that no requests can be received before the
             procedure START ̲TMP has been called.

         -   RELOAD

             This procedure copies all TMP files with, KIND
             = K ̲BACKUP, from the ofline volume SYSGEN to the
             mirrored disks

         -   READ ̲SYSTEM ̲PARAMETERS

             This procedure reads an consistent version of system
             parameters and global number series (system data)
             into memory, and ensures that both copies on mirrored
             disks contain this version.

             An version having identical timestamps in start
             and end will be considered consistent.

             If RECOVERY is TRUE both memory save and memory
             work may contain a version of system data.



             If RECOVERY is FALSE only memory save version may
             contain a version of system data.

             If an disk read error occur or no consistent version
             is found the TMP process will be retired.

         -   READ ̲MEMORY ̲DATA

             This procedure reads an consistent version of memory
             data into memory, initializes it and saves it in
             both memory save and memory work files. If RECOVERY
             is TRUE the data must be checked, otherwise the
             data in memory save file will be considered consistent.

             If RECOVERY is TRUE and data shall be checked it
             is checked that time stamp in TABLE ̲DESCRIPTION.ATTRIBUTES
             are identical with the associated one in memory
             work file.

             If they are not identical it is checked that all
             associated tables in memory save file has identical
             time stamp. If they have, memory save version is
             used, otherwise memory work version is used.

             If an error occur the TMP process is retired.

         -   OPEN ̲FILES

             This procedure opens all TMP files descriped by
             FILE ̲DESCR ̲ARRAY. The FDCB index received when
             opening the files are saved in associated FILE
             ̲
             DESCRIPTION.FILE.

             If an disk access error occur the TMP PROCESS is
             retired;



4.2.2.4.6.4 S̲t̲a̲r̲t̲ ̲U̲p̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲a̲t̲a̲

         D̲a̲t̲a̲ ̲R̲e̲f̲e̲r̲e̲n̲c̲e̲s̲

         TMP ̲COROUTINE ̲RECORD      c.f. 4.1.4.1
         FILE ̲DESCR ̲ARRAY          c.f. 4.1.4.2
         GENERAL ̲OPERATIONS        c.f. 4.1.4.2
         Coroutine Semaphores      c.f. 4.1.4.2
         SUBPROCESS-DESCR ̲ARRAY    c.f. 4.1.4.2
         UPDATE ̲BUFFER             c.f. 4.1.4.2



         E̲x̲t̲e̲r̲n̲a̲l̲ ̲D̲a̲t̲a̲

         FILE ̲DESCR ̲ARRAY                      (M)
         GENERAL ̲OPERATION                     (M)
         Coroutine Operations                  (M)
         SUBPROCESS ̲DESCR ̲ARRAY                (M)
         UPDATE ̲BUFFER                         (M)

         L̲o̲c̲a̲l̲ ̲D̲a̲t̲a̲

         None



4.2.2.4.6.5 S̲t̲a̲r̲t̲ ̲U̲p̲ ̲M̲o̲d̲u̲l̲e̲ ̲D̲e̲s̲i̲g̲n̲

         E̲x̲t̲e̲r̲n̲a̲l̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         READ ̲BYTES                   (d) 4.3.6.1
         MODIFY ̲BYTES                 (d) 4.3.6.2
         LOOK ̲UP                      (d) 4.3.5.2
         INIT ̲COMON                   (c) 3.2.5.10
         INIT ̲COROUTINE               (c) 3.2.5.11
         INIT ̲COROUTINE ̲SEMAPHORE     (c) 3.2.5.12
         SIGNAL ̲OPSEM                 (c) 3.2.5.13
         SEND ̲RESPONSE                cf 4.1.5.5

         a)  S̲t̲a̲r̲t̲ ̲U̲p̲

             N̲a̲r̲r̲a̲t̲i̲v̲e̲ ̲D̲e̲s̲c̲r̲i̲p̲t̲i̲o̲n̲

             The procedure OPEN ̲FILES is called.

             The procedure INITIALIZE ̲TMP is called.

             Then selected processing depends on MODE.  If MODE
             is DEAD1, INITIAL ̲START is called.

             If MODE is DEAD2, BACK ̲UP ̲START is called.

             If MODE is COLD, WARM1 or WARM2 RECOVERY ̲START
             is called.

             F̲l̲o̲w̲g̲r̲a̲m̲

             None





4.2.2.5  U̲p̲d̲a̲t̲e̲ ̲S̲u̲b̲p̲a̲c̲k̲a̲g̲e̲ ̲D̲a̲t̲a̲

         Refer TMP.D*UPD.D*VAR.D



4.2.2.6  C̲o̲m̲m̲o̲n̲ ̲U̲p̲d̲a̲t̲e̲ ̲S̲u̲b̲p̲a̲c̲k̲a̲g̲e̲ ̲P̲r̲o̲c̲e̲d̲u̲r̲e̲s̲

         N/A



4.2.2.7  U̲p̲d̲a̲t̲e̲ ̲S̲u̲b̲p̲a̲c̲k̲a̲g̲e̲ ̲I̲n̲t̲e̲r̲f̲a̲c̲e̲



4.2.2.7.1    R̲e̲q̲u̲e̲s̲t̲ ̲F̲r̲o̲m̲ ̲T̲M̲P̲ ̲M̲o̲n̲i̲t̲o̲r̲

         The Update Subpackage receives requests from TMP Monitor
         subpackage via the synchronization element UPDATE ̲SYNCEL.
          The requests received are:

         -   TMP Request
         -   Lock Table
         -   Unlock Table
         -   Reorganize
         -   Abandon Reorganize
         -   Backup
         -   System Start Up
         -   Set GSN Flags
         -   Set System Parameter

         The info received from synchronization element is for
         each request type described in 4.2.3.7.1.

         The interface specifications are given in (b) 4.1.



4.2.2.7.2    R̲e̲s̲p̲o̲n̲s̲e̲ ̲T̲o̲ ̲T̲M̲P̲ ̲M̲o̲n̲i̲t̲o̲r̲

         When a function is completed, a response is sent to
         TMP Monitor.

         The response is sent to the synchronization element
         associated to the subprocess specified by the request.

         The response will contain SOCB ̲INDEX and Completion
         Code in a RESPONSE ̲INFO record c.f. 4.1.4.1.2.





4.2.2.7.3    S̲e̲a̲r̲c̲h̲ ̲R̲e̲q̲u̲e̲s̲t̲

         The Support module requests disk search by Search Subpackage
         by sending operations to DISK ̲SEARCH ̲SEM.

         Response is received from SUPPORT ̲RS ̲SEM.



4.2.2.7.4    D̲i̲s̲a̲b̲l̲e̲ ̲S̲e̲a̲r̲c̲h̲

         The Update Subpackage may disable search by waiting
         for DISABLE ̲LOCK semaphore and then twice at DISABLE
         ̲SEM. The search is enabled again by signalling twice
         to DISABLE ̲SEM and then signalling DISABLE ̲LOCK semaphore.