ASMB,L,C,R
      HED RBDEL SUBROUTINE OF RDBA-IMAGE/1000 
      NAM RBDEL,7 92069-16222 REV.1912 790130 
* 
* 
******************************************************************* 
* (C) COPYRIGHT HEWLETT-PACKARD COMPANY 1979. ALL RIGHTS RESERVED.
* NO PART OF THIS PROGRAM MAY BE PHOTOCOPIED, REPRODUCED, OR
* TRANSLATED TO ANOTHER PROGRAM LANGUAGE WITHOUT THE PRIOR WRITTEN
* CONSENT OF HEWLETT-PACKARD COMPANY. 
******************************************************************* 
* 
* 
*     SOURCE:    92069-18222
*     RELOC:     92069-16222
* 
*     PRGMR:     CEJ
* 
* 
******************************************************************* 
* 
* 
* 
*  This is the remote DBDEL handler.  Its function is to transform the
*  DBDEL parameters into those needed for RDBA, then to send the request
*  to the remote machine through RBMST. 
* 
*  The calling sequence for RBDEL is: 
* 
*         JSB RBDEL 
*          DEF *+5        return point
*          DEF BASE       data base parameter from DBDEL call 
*          DEF SET        data set parameter from DBDEL call
*          DEF MODE       mode from DBDEL call
*          DEF STAT       status array from DBDEL call
* 
**********************************************************************
*                                                                    *
*  Run Table for local machine in Remote Data Base Access            *
*                                                                    *
*  The local copy of the Run Table used by the RDBA master subrou-   *
*  tines consists of the following sections:                         *
*                                                                    *
*    1) Data Base Control Block                                      *
*    2) Data Item Table                                              *
*    3) Data Set Table                                               *
*    4) Sort Table                                                   *
*                                                                    *
*  These sections are in the order stated.  Details of each section  *
*  follow.                                                           *
*                                                                    *
**********************************************************************
***                                                                ***
*                                                                    *
*  Data Base Control Block - one 17 word entry per data base         *
*                                                                    *
***                                                                ***
RDCBS DEC 17        DBCB size 
* 
RDNAM DEC 0         data base name - three words
      DEC 1 
      DEC 2 
RDRBN DEC 3         remote data base number 
      DEC 4 
RDDSN DEC 5         DS node number
      DEC 6 
RDITC DEC 7         data item count 
RDITP DEC 8         data item table pointer 
RDDSC DEC 9         data set count
RDDSP DEC 10        data set table pointer
RDSOP DEC 11        sort table pointer
      DEC 12
RDLMD DEC 13        lock flag/open mode 
RDLFG EQU RDLMD     1st byte: lock flag 
RDMOD EQU RDLMD     2nd byte: open mode 
      DEC 14
RDCBC DEC 15        # of DCBs desired = 0 
RDMDL DEC 16        maximum data length 
* 
ZERO  EQU RDNAM     base of zero for future equates 
***                                                                ***
*                                                                    *
*  Data Item Table - one 5 word entry per item in a 1000 data base   *
*                                                                    *
***                                                                ***
RI1LN EQU ZERO+5    length of a 1000 entry
* 
RI1NM EQU ZERO      item name - 3 words 
RI1NO EQU ZERO+3    item number 
RI1IL EQU ZERO+4    item length 
***                                                                ***
*                                                                    *
*  Data Set Table - one 6 word entry per set in a 1000 data base     *
*                                                                    *
***                                                                ***
RS1LN EQU ZERO+6    length of a 1000 entry
* 
RS1NM EQU ZERO      set name - 3 words
RS1NO EQU ZERO+3    set number
RS1EL EQU ZERO+4    entry length (in words) 
RS1KL EQU ZERO+5    key item length for a master
***                                                                ***
*                                                                    *
*  Sort Table - one 1 word entry per item and per set.  Each entry   *
*               is a pointer to the respective item or set table     *
*               entry relative to the start of the Run Table         *
*                                                                    *
***                                                                ***
A     EQU 0 
B     EQU 1 
* 
      ENT RBDEL 
      EXT .ENTR,AIRUN,RBCST,RBMST 
* 
BASE  NOP 
SET   NOP 
MODE  NOP 
STAT  NOP 
* 
*  Get true parameter and return point addresses. 
* 
RBDEL NOP 
      JSB .ENTR 
       DEF BASE 
* 
*  Check to see if the data base was opened in a mode within [1,3], and 
*  if mode 1, that the data base is locked to the user.  Open mode is in
*  the low order byte of the 14th word of the DBCB, lock flag is in the 
*  high order byte of the same word.
* 
      LDB AIRUN 
      ADB RDMOD 
      LDA B,I 
      AND LOBYT 
* 
      CPA D1
      JMP RDEL1     Open mode = 1.
      CPA D3
      JMP RDEL2     Open mode = 3.
      JMP E104      Invalid open mode for a Delete. 
* 
RDEL1 LDA B,I       Is data base locked?
      SSA,RSS         (i.e. lock flag negative?)
      JMP E159        No - data base not enabled. 
* 
*  Make sure the DBDEL mode is 1. 
* 
RDEL2 LDA MODE,I
      CMA,INA 
      INA,SZA 
      JMP E115      Illegal DBDEL mode. 
* 
*  Ask RBCST to check the validity of the set reference and to return us
*  the set's number, if valid.
* 
      JSB RBCST 
       DEF *+4
       DEF SET,I    RBCST needs: set reference
       DEF STNUM        returns: set number 
       DEF STADR                 set's Set Table entry address
      JMP E100      Invalid set return. 
* 
*  Ask RBMST to build the request, send it, and await the reply.
* 
      JSB RBMST 
       DEF *+11 
       DEF D43      RBMST needs: RDBA Index 
       DEF MODE,I                DBDEL mode 
       DEF STNUM                 data set number
       DEF D0                    dummy
       DEF BASE,I                data base parameter
       DEF STAT,I                status array 
       DEF D0                    outgoing data buffer 
       DEF D0                    outgoing data length 
       DEF D0                    incoming data buffer 
       DEF D0                    incoming data length 
      NOP             <error return>
RDEL3 JMP RBDEL,I     <normal return> 
* 
*  Error return points. 
* 
E100  LDB D100      Invalid data set. 
      RSS 
E104  LDB D104      Improper open mode for a Delete.
      RSS 
E115  LDB D115      Illegal DBDEL mode. 
      RSS 
E159  LDB D159      Data base not locked. 
* 
RDEL4 STB STAT,I
      JMP RDEL3 
* 
*  Constants and variables. 
* 
D0    EQU ZERO
D1    EQU ZERO+1
D3    EQU ZERO+3
D7    EQU ZERO+7
D43   DEC 43
D100  DEC 100 
D104  DEC 104 
D115  DEC 115 
D159  DEC 159 
* 
LOBYT OCT 377 
* 
STNUM NOP 
STADR NOP 
      END 
      END$
                