Google
 

Trailing-Edge - PDP-10 Archives - CFS_TSU04_19910205_1of1 - update/t20src/dap.req
There are 5 other files named dap.req in the archive. Click here to see a list.
!Macros to do the usual DAP things

!
!	COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1981, 1986.
!	ALL RIGHTS RESERVED.
!
!	THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY  BE  USED  AND
!	COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH
!	THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE.   THIS  SOFTWARE  OR
!	ANY  OTHER  COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE
!	AVAILABLE TO ANY OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE
!	SOFTWARE IS HEREBY TRANSFERRED.
!
!	THE INFORMATION IN THIS SOFTWARE IS  SUBJECT  TO  CHANGE  WITHOUT
!	NOTICE  AND  SHOULD  NOT  BE CONSTRUED AS A COMMITMENT BY DIGITAL
!	EQUIPMENT CORPORATION.
!
!	DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR  RELIABILITY  OF
!	ITS SOFTWARE ON EQUIPMENT THAT IS NOT SUPPLIED BY DIGITAL.
!

!

!++
! FACILITY: FTS DAP Macros
!
! ABSTRACT: These macros perform common functions needed to implement DAP
!           using the DECnet Interface.
!
!
! ENVIRONMENT: BLISS DECnet Interface
!
! AUTHOR:	Andrew Nourse, CREATION DATE: 29-Dec-81
!
! MODIFIED BY:
!
! 	, : VERSION
! 01	- The beginning
! 636 - Allow RSTS to read stream files.
!--
!
! TABLE OF CONTENTS:
!
! EXTR
! UNREF
! GET_BYTE
! GET_2BYTE
! GET_HEADER
! GET_EXTENSABLE
! GET_VARIABLE
! BACK
! PUT_BYTE
! PUT_2BYTE
! PUT_HEADER
! PUT_EXTENSABLE
! PUT_VARIABLE
! SET_EXTENSION_BITS
! COPY_ASCIZ_ASCIC
! COPY_ASCIC_ASCIZ

!
! MACROS:
!

!Define '$' as a reference to the start of any block
!So we don't need to worry if this is a real block or a REF of one
MACRO   $=0,0,0,0 %;

!Require file containing system-dependant DAP macros, structure defs,etc.
MACRO	CHAR8[C1,C2,C3,C4]=((C1 AND 255)^28)
                           +(((C2+0) AND 255)^20)
                           +(((C3+0) AND 255)^12)
                           +(((C4+0) AND 255)^4) %;
				!Pack 4 8-bit bytes per word

MACRO ANYSET[EXF]=(.EXF<27,9> NEQ 0) %;
	!This macro returns 1 if any bits in an extensible field are set
	!assuming that extension bits are set up (see SET_EX_BITS,SETEXB)

MACRO NLB$H_BYTES=NLB$H_UNITS %;       ! For documentation purposes
                                       ! we want this alternate name because
                                       ! BYTES ARE NOT ALWAYS ADDRESSABLE UNITS

MACRO  $DAP$INCR(IND,STA,FIN)[]=BEGIN
				COMPILETIME IND=STA;	!Set index counter
				%IF IND LEQ FIN
				    %THEN
                                    %REMAINING;
				    $DAP$INCR(IND,STA+1,FIN,%REMAINING)
				    %FI
				END%;

MACRO CLEARV[VAR]=	BEGIN
			COMPILETIME SIZ=%ALLOCATION(VAR)-1;
				BEGIN
				MAP VAR: VECTOR;
				%IF (SIZ-7) LSS 0
				%THEN $DAP$INCR(I,0,SIZ,(VAR[I]=0))
				%ELSE	
				INCR I FROM 0 TO SIZ DO VAR[.I]=0
				%FI
				END
                        END %;

MACRO EXTR[RTN]= %IF NOT %DECLARED(RTN)
                 %THEN EXTERNAL ROUTINE RTN
                 %FI %;

MACRO UNREF(X)=X %;


MACRO INIT_MESSAGE(DD)=
             (BIND DESC=DD: $DAP_DESCRIPTOR;              
              DESC[DAP$$V_MFLAGS_1]=DESC[DAP$$V_MFLAGS_2]
                                   =DESC[DAP$$V_MFLAGS_3]=0) %;


MACRO GET_BYTE(DD)=(EXTR( D$GBYT );
                    D$GBYT(UNREF(DD))) %;
      
MACRO GET_2BYTE(DD)=(EXTR( D$G2BY );
                     D$G2BY(UNREF(DD))) %;

MACRO PUT_BYTE(DD,DATA)=(EXTR( D$PBYT );
                         D$PBYT(UNREF(DD),DATA)) %;
      
MACRO PUT_2BYTE(DD,DATA)=(EXTR( D$P2BY );
                          D$P2BY(UNREF(DD),DATA)) %;

MACRO GET_LONGWORD(DD)=(EXTR( D$GLWD );
                        D$GLWD(UNREF(DD))) %;
       
MACRO PUT_LONGWORD(DD,VALUE)=(EXTR( D$PLWD );
                              D$PLWD(UNREF(DD),VALUE)) %;


MACRO GET_EXTENSABLE(DD,ADRS,MAXLEN)=(EXTR(D$GEXT);
                                      D$GEXT(UNREF(DD),UNREF(ADRS),MAXLEN)) %;
       
MACRO PUT_EXTENSABLE(DD,ADRS)= (EXTR(D$PEXT);
                                D$PEXT(UNREF(DD),UNREF(ADRS))) %;
                                        
MACRO GET_VARIABLE_STRING(DD,PTR,MAXLEN)=(EXTR(D$GVST);
                                          D$GVST(UNREF(DD),UNREF(PTR),MAXLEN))
                                         %;
       
MACRO PUT_VARIABLE_STRING(DD,PTR)=(EXTR(D$PVST);
                                   D$PVST(UNREF(DD),UNREF(PTR))) %;

MACRO GET_VARIABLE_COUNTED(DD,PTR,MAXLEN)=(EXTR(D$GVCT);
                                           D$GVCT(UNREF(DD),UNREF(PTR),MAXLEN))
                                          %;
       
MACRO PUT_VARIABLE_COUNTED(DD,PTR)=(EXTR(D$PVCT);
                                    D$PVCT(UNREF(DD),UNREF(PTR))) %;

MACRO GET_HEADER(DD)=
      (EXTR( D$GHDR );
       D$GHDR(UNREF(DD))) %;

MACRO PUT_HEADER(DD)=
      (EXTR( D$PHDR );
       D$PHDR(UNREF(DD))) %;


MACRO PUT_BYTES(DD,DESC)=
                         (EXTR (D$PSTR);
                          D$PSTR(DD,DESC)) %;
MACRO PUT_STRING(DD,DESC)=
                         (EXTR (D$PSTR);
                          D$PSTR(DD,DESC)) %;
%BLISS36(
MACRO
      DAP$PUT_MESSAGE=D$PMSG %,
      DAP$GET_MESSAGE=D$GMSG %,
      DAP$PUT_HEADER=D$PHDR %,
      DAP$GET_HEADER=D$GHDR %,
      DAP$PUT_CONFIG=D$PCFG %,
      DAP$PUT_ATTRIBUTES=D$PATT %,
      DAP$$PUT_ATTRIBUTES=D$$PAT %,
      DAP$PUT_ACCESS=D$PACC %,
      DAP$PUT_NAME=D$PNAM %,
      DAP$PUT_CONTROL=D$PCTL %,
      DAP$PUT_ACCESS_COMPLETE=D$PACM %,
      DAP$GET_CONFIG=D$GCFG %,
      DAP$GET_ATTRIBUTES=D$GATT %,
      DAP$$GET_ATTRIBUTES=D$$GAT %,
      DAP$GET_STATUS=D$GSTS %,
      DAP$GET_DATE=D$GDTM %,
      DAP$PUT_DATE=D$PDTM %,
      DAP$GET_ACK=D$GACK %,
      DAP$UNGET_BYTE=D$UBYT %,
      DAP$UNGET_HEADER=D$UHDR %,
      DAP$ERROR_DAP_RMS=D$ERDR %,
      DAP$ERROR_RMS_DAP=D$ERRD %,
      DAP$RFA_RMS_DAP = D$RFRD %,                                         !A605
      DAP$RFA_DAP_RMS = D$RFDR %;                                         !A605

MACRO
      DAP$GET_BITVECTOR=D$GBIT %,
      DAP$PUT_BITVECTOR=D$PBIT %,
      DAP$SIZE_BITVECTOR=D$SIZB %,
      DAP$GET_STRING=D$GSTR %,
      DAP$GET_VARIABLE_STRING=D$GVST %,
      DAP$GET_LONGWORD=D$GLWD %,
      DAP$GET_BYTE=D$GBYT %,
      DAP$GET_2BYTE=D$G2BY %,
      DAP$GET_EXTENSABLE=D$GEXT %,
      DAP$GET_VARIABLE_COUNTED=D$GVCT %,
      DAP$PUT_STRING=D$PSTR %,
      DAP$PUT_VARIABLE_STRING=D$PVST %,
      DAP$PUT_LONGWORD=D$PLWD %,
      DAP$PUT_BYTE=D$PBYT %,
      DAP$PUT_2BYTE=D$P2BY %,
      DAP$PUT_EXTENSABLE=D$PEXT %,
      DAP$PUT_VARIABLE_COUNTED=D$PVCT %;
)

MACRO                                      ! The following are used only by FAL
      DAP$GET_CONTROL=D$GCTL %,            ! 
      DAP$GET_ACCESS=D$GACC %,             ! 
      DAP$PUT_ACK=D$PACK %,                ! 
      DAP$GET_ACCESS_COMPLETE=D$GACM %,    !
      DAP$PUT_STATUS=D$PSTS %,             ! 
      DAP$PUT_SUCCESS=D$PSUC %,            ! 
      DAP$GET_CONTINUE=D$GCNT %,           !
      DAP$RETRY_LAST_OPERATION = d$retr %; !

MACRO SEND_STATUS(DD,MACCODE,MICCODE)=
       (EXTR (DAP$PUT_STATUS,DAP$PUT_MESSAGE);
        BIND STS$$DD=DD: $DAP_DESCRIPTOR;
        DAP$PUT_STATUS(STS$$DD[$],MACCODE,MICCODE);
        DAP$PUT_MESSAGE(STS$$DD[$])) %;
                      

MACRO $DAP_MOVE_BITS(SOURCE,SPFX,DEST,DPFX)[ITEM]=
      %IF %DECLARED(%NAME(SPFX,ITEM)) AND %DECLARED(%NAME(DPFX,ITEM))
      %THEN DEST[%NAME(DPFX,ITEM)]=.SOURCE[%NAME(SPFX,ITEM)]; %FI; %;

!+
! Temporary until Dap$Put_Longword and its callers are fixed
!-
MACRO $Dap_Size_Longword( val ) = 5 %; 
%(
MACRO $Dap_Size_Longword( val ) =
      (  1                              ! Count field
       + ((val) NEQ 0)                  ! Low byte of value if val nonzero
       + (((val)^-8) NEQ 0)             ! Next byte if needed
       + (((val)^-16) NEQ 0)            ! Next byte if needed
       + (((VAL)^-24) NEQ 0)            ! Next byte if needed
       + (((val)^-32) NEQ 0)            ! Next byte if needed
      ) %;
)%
COMPILETIME DAP$K_DEFAULT_VALUE=-1;

MACRO $DAP_TRANSLATE_VALUE(VALUE,SPFX,DPFX)=
      (SELECT VALUE OF
       SET
       $DAP$$TRANSLATE_VALUE(SPFX,DPFX,%REMAINING);
       TES)
       %;

MACRO $DAP$$TRANSLATE_VALUE(SPFX,DPFX)[ITEM]=
       [%IF %DECLARED(%NAME(SPFX,ITEM))
        %THEN %NAME(SPFX,ITEM)
        %ELSE DAP$K_DEFAULT_VALUE
        %FI]: %IF %DECLARED(%NAME(DPFX,ITEM))
              %THEN %NAME(DPFX,ITEM)
              %ELSE DAP$K_DEFAULT_VALUE
              %FI
       %;


MACRO $VALUE_RMS_DAP(VALUE,SPFX,DPFX,ERRCOD)=
      (SELECT VALUE OF
       SET
       $$VALUE_RMS_DAP(SPFX,DPFX,ERRCOD,%REMAINING);
       [OTHERWISE]: ( UserError( Errcod ); Dap$k_Default_Value );
       TES)
       %;

MACRO $$VALUE_RMS_DAP(SPFX,DPFX,ERRCOD)[ITEM]=
       [ %NAME(SPFX,ITEM) ] :
       %IF %DECLARED(%NAME(DPFX,ITEM))
           %THEN %NAME(DPFX,ITEM)
           %ELSE ( UserError( Errcod ); Dap$k_Default_Value )
           %FI
       %;

MACRO CCar (Arg1) = Arg1 %;              ! First argument of list only
MACRO CCdr (Arg1) = %REMAINING %;        ! 2nd and rest of list
MACRO Car (Arglist) = CCar (%REMOVE( Arglist )) %;
MACRO Cdr (Arglist) = CCdr (%REMOVE( Arglist )) %;

MACRO SET_EX_BITS[EXF]=(EXTR(SETEXB);SETEXB(EXF,%ALLOCATION(EXF)*4)) %;

MACRO SET_EX_BITS_A[EXF]=(EXTR(SETEXB);SETEXB(EXF,4)) %;

MACRO $DAP_SIZE_BITVECTOR[BVEC,MAX]=
      0+DAP$SIZE_BITVECTOR(BVEC,MAX,1) %;

MACRO Pp(Str)=CH$PTR(UPLIT(%ASCIZ %STRING(Str))) %; 

MACRO Find_Substring( Target, Pattern )=
      ( EXTR( FSUBAZ );
        Fsubaz(Target, Pattern) ) %;

MACRO
     Asciz_Len(Asciz)=(LOCAL Asciz__Tptr;
                       Asciz__Tptr=Asciz;
                       INCR i FROM 0
                       DO IF CH$RCHAR_A(Asciz__tptr) EQL 0
                       THEN EXITLOOP .i) %;

MACRO Asciz_Str( Asciz )=(Asciz_Len(Asciz),Asciz) %;

MACRO Str_Exclude( Desc, Chars )=
   ( BIND excl$$chars=(Chars);
     Desc[Str$a_Pointer]=CH$PLUS(.desc[Str$a_Pointer],excl$$chars);
     Desc[Str$h_Length]=MAX((.desc[Str$h_Length]-excl$$chars),0);
     Desc[Str$h_Pfxlen]=.desc[Str$h_Pfxlen]+excl$$chars ) %;        !m563

MACRO Str_Include( Desc, Chars)=
    (Desc[Str$h_Length]=.desc[Str$h_Length]+Chars ) %;

MACRO Str_Prefix( Desc )=
    ( .desc[Str$h_Pfxlen],
      CH$PLUS(.desc[Str$a_Pointer],-.desc[Str$h_Pfxlen]) ) %;

MACRO Str_String_Plus_Prefix( Desc )=
    ( .desc[Str$h_Pfxlen]+.desc[Str$h_Length],
      CH$PLUS(.desc[Str$a_Pointer], -.desc[Str$h_Pfxlen]) ) %;

MACRO Str_String_Plus_Remainder( Desc )=
    ( .desc[Str$h_Maxlen]-.desc[Str$h_Pfxlen],  .desc[Str$a_Pointer] ) %;

MACRO Str_Remainder( Desc ) =
    ( .desc[Str$h_Maxlen]-(.desc[Str$h_Length]+.desc[Str$h_Pfxlen]),
      CH$PLUS(.desc[Str$a_Pointer], .desc[Str$h_Length]) ) %;

MACRO Str_String( Desc ) =
    ( .desc[Str$h_Length], .desc[Str$a_Pointer] ) %;

MACRO
     ASCIZ_TO_DESCRIPTOR(ASCIZ,DESC)=$STR_DESC_INIT(DESCRIPTOR=DESC,
                                                    STRING=(ASCIZ_LEN(ASCIZ),
                                                            ASCIZ),
                                                    CLASS=BOUNDED) %;
                                                            
MACRO ASCIZ_TO_FIXED_DESCRIPTOR(ASCIZ,DESC)=
           $STR_DESC_INIT(DESCRIPTOR=DESC,
                          STRING=(ASCIZ_LEN(ASCIZ), ASCIZ),
                          CLASS=FIXED) %;

MACRO DAPCODE=3,16 %;                   ! Extract DAP code from condition code

MACRO $$Error( Oper, Blk, Sts, Stv )=
               ( BIND RmsBlk=(Blk): $Fab_decl;
                 %IF %LENGTH GTR 2
                 %THEN
                 RmsBlk[Fab$h_Sts]=Usrsts=(Sts);
                 RmsBlk[Fab$h_Stv]=Usrstv=(Stv);
                 %FI
                 Usrerr () ) %;

%(  ! It's not fake any more
!Fake out our error routine to act as if we were invoked by JSYS
MACRO  $$Error( Oper, Blk, Sts, Stv )=
               (LOCAL VEC: VECTOR[3];
                Vec[0]=%NAME('RMS$',Oper,'_jsys')+%O'104000000000';
                $$Errrtn(Blk, 0, vec[2])) %;
)%


! Differing concepts of bucket numbers
MACRO RMS_VBN_TO_DAP(RMSVBN)=(LOCAL RMSNUM;
                              RMSNUM=RMSVBN;
                              IF .RMSNUM NEQ 0
                              THEN ((.RMSNUM-1)*4)+1
                              ELSE 0) %;
MACRO DAP_VBN_TO_RMS(DAPVBN)=(LOCAL DAPNUM;
                              DAPNUM=DAPVBN;
                              IF .DAPNUM NEQ 0
                              THEN ((.DAPNUM-1)/4)+1
                              ELSE 0) %;
MACRO GET_VBN(DD)=DAP_VBN_TO_RMS(GET_LONGWORD(DD)) %;
MACRO PUT_VBN(DD,VBN)=PUT_LONGWORD(DD,RMS_VBN_TO_DAP(VBN)) %;

!
! STRUCTURE DEFINITIONS
!


STRUCTURE EX[BT;SIZE]=		!DAP extensible field
	[(SIZE+3)/4]		!Note that size is in bytes
	(EX+(BT/32))<(BT MOD 8)+27-(((BT MOD 32)/8)*9),1,0>;
	!This is to reconcile the fact that on both the -11 and the -10
	!number bits from right to left (in the hardware, at least)
	!but the -10 numbers and stores bytes from left to right.
	!The bits in a word are numbered by this structure as follows:
	!X 07 06 05 04 03 02 01 00 X 15 14 13 12 11 10 09 08	(left half)
	!X 23 22 21 20 19 18 17 16 X 31 30 29 28 27 26 25 24	(right half)

STRUCTURE BYTE8VECTOR[I;SIZE]=
	[(SIZE+3)/4]
	(BYTE8VECTOR+(I/4))<28-((I MOD 4)*8),8,0>;
	!4 8-bit bytes per word, left justified, just as ILDB would want

!
! Non-standard Linkages
!

LINKAGE
       rms_ercal = PUSHJ (REGISTER = 1) : LINKAGE_REGS (15, 14, 1);
              

!
! Include files
!

%IF NOT %DECLARED (%QUOTE $BIT)
%THEN LIBRARY 'BLI:XPORT';
%FI

%IF (%VARIANT AND %O'400') NEQ 0 %THEN $SHOW(ALL) %FI;

! DD Structure

$FIELD $DAP_DESCRIPTOR_FIELDS=
       SET
       DAP$T_DATA=[$DESCRIPTOR(BOUNDED)],
           $OVERLAY($SUB_FIELD(DAP$T_DATA,XPO$H_LENGTH))
           DAP$H_BYTES_REMAINING=[$SHORT_INTEGER],

           $OVERLAY($SUB_FIELD(DAP$T_DATA,XPO$A_ADDRESS))
           DAP$A_DATA=[$POINTER],

           $OVERLAY($SUB_FIELD(DAP$T_DATA,XPO$H_PFXLEN))
           DAP$H_BYTES_USED=[$SHORT_INTEGER],

           $OVERLAY($SUB_FIELD(DAP$T_DATA,XPO$H_MAXLEN))
           DAP$H_MESSAGE_LENGTH=[$SHORT_INTEGER],

           $CONTINUE
           
       DAP$B_OPERATOR=[$SHORT_INTEGER],
       DAP$B_STREAMID=[$SHORT_INTEGER],
       DAP$H_LENGTH=[$SHORT_INTEGER],   ! Length of this DAP message
       DAP$H_BITCNT=[$SHORT_INTEGER],   ! Number of bits used in last byte of data message
       DAP$V_MFLAGS=[$BYTES(5)],
           $OVERLAY(DAP$V_MFLAGS)       ! these are for clearing the flags
           DAP$$V_MFLAGS_1=[$BYTES(2)], ! 
           DAP$$V_MFLAGS_2=[$BYTES(2)], ! 
           DAP$$V_MFLAGS_3=[$BYTES(1)], ! 
           $OVERLAY(DAP$V_MFLAGS)
           DAP$V_MFLAGS_STREAMID=[$BIT],! Stream ID (not supported)
           DAP$V_MFLAGS_LENGTH=[$BIT],  ! Length field present
           DAP$V_MFLAGS_LEN256=[$BIT],  ! Length field is 2 bytes long
           DAP$V_MFLAGS_BITCNT=[$BIT],  ! BITCNT field present (DATA message only)
           DAP$V_MFLAGS_XXXXXX=[$BIT],  ! Reserved
           DAP$V_MFLAGS_SYSPEC=[$BIT],  ! System-specific field present (not supported)
           DAP$V_MFLAGS_MORE=[$BIT],    ! Not last segment -- more coming
           $CONTINUE
       DAP$V_INTERRUPT=[$BIT],          ! Interrupt message
       $ALIGN(WORD)                     ! Make the addresses halfword aligned
       DAP$A_NLB=[$ADDRESS],            ! Address of NLB
       DAP$H_OFFSET=[$SHORT_INTEGER],   ! Number of into msg for DAP msg start
       DAP$A_OTHER_DD=[$ADDRESS]        ! Address of DD for other direction
       TES;

! End of DD

LITERAL DAP$K_DESCRIPTOR_LEN=$FIELD_SET_SIZE;
MACRO $DAP_DESCRIPTOR= BLOCK[DAP$K_DESCRIPTOR_LEN] FIELD ($DAP_DESCRIPTOR_FIELDS) %;

!Bits for runtime workaround conditionals

LITERAL                                 ! TOPS-20 workarounds
    T20_BUG_NO_DIR_PRV=1;               ! No status for ER$PRV on DIRECTORY

LITERAL                                 ! RSTS/E workarounds
    RST_BUG_NO_RFM_SPEC=2,              ! Default STM format if no RFM
    RST_BUG_NO_DIR_FNF=1;               ! No status for ER$FNF on DIRECTORY

LITERAL                                 ! RSX workarounds
    RSX_BUG_NOT_WANT_BLS=1;             ! RSX FCS FAL doesn't like BLS field

LITERAL                                 ! VMS workarounds
    VMS_BUG_BYTLM_HANG=1;               ! VMS hangs if BUFSIZE not << BYTLM

LITERAL                                 ! IAS workarounds
    IAS_BUG_ACM_FOP=1;                  ! IAS complains about FOP bits on close

!
!Common definitions for DAP
!
LIBRARY 'CONDIT';

! Codes defined in the DAP protocol specification -- v 7.0
! 
! Revision History
!
!  1 - Develop this parameter file
!  2 - PDT and BDT were reversed, and ADT needs to be added.
!  3 - Increase DAP$K_BUFFER_SIZE
!

!DAP buffer size
LITERAL DAP$K_BUFFER_SIZE=8192;

!The FAL Object Type

LITERAL DAP$K_FAL=17;
!
!	DAP MESSAGE TYPES DEFINED
!
LITERAL
	DAP$K_CONFIG=1,		! CONFIGURATION 
	DAP$K_ATTRIBUTES=2,	! ATTRIBUTES
	DAP$K_ACCESS=3,		! ACCESS
	DAP$K_CONTROL=4,        ! CONTROL
	DAP$K_CONTINUE=5,       ! CONTINUE
	DAP$K_ACK=6,		! ACKNOWLEDGE
	DAP$K_ACCESS_COMPLETE=7,! ACCESS COMPLETE
	DAP$K_DATA=8,		! DATA
	DAP$K_STATUS=9,		! STATUS
	DAP$K_KEY=10,		! KEY DEFINITION
	DAP$K_ALLOCATION=11,    ! ALLOCATION
	DAP$K_SUMMARY=12,       ! SUMMARY ATTRIBUTES MESSAGE
	DAP$K_DATE_TIME=13,     ! DATE & TIME ATTRIBUTES MESSAGE
	DAP$K_PROTECTION=14,	! PROTECTION
	DAP$K_NAME=15,		! NAME MESSAGE
	DAP$K_ACL=16;		! ACCESS CONTROL LIST

!
!Bits within FLAGS byte
!
! We do not use these, see description of $DAP_DESCRIPTOR
%(
LITERAL
	DAP$V_MFLAGS_STREAMID=0,	! STREAMID present
	DAP$V_MFLAGS_LENGTH=1,	! LENGTH field present
	DAP$V_MFLAGS_LEN256=2,	!2-byte length field present
	DAP$V_MFLAGS_BITCNT=3,  !BIT COUNT in DATA message only
                                !4 is reserved
        DAP$V_MFLAGS_SYSPEC=5,  !System-specific field
        DAP$V_MFLAGS_MORE=6;    !Not last segment of message
)%
!
!	FIELDS WITHIN CONFIGURATION MESSAGES
!
!       SEE CONFIG.REQ for definition of CONFIG block
!
!DAP Operating system type codes defined:
!

LITERAL	DAP$K_RT11=1,
	DAP$K_RSTS=2,
	DAP$K_RSX11S=3,
	DAP$K_RSX11M=4,
	DAP$K_RSX11D=5,
	DAP$K_IAS=6,
	DAP$K_VMS=7,
	DAP$K_TOPS20=8,
	DAP$K_TOPS10=9,
        DAP$K_RTS8=10,
        DAP$K_OS8=11,
        DAP$K_RSX11MPLUS=12,
        DAP$K_COPOS11=13,
        DAP$K_POS=14,
        DAP$K_ELAN=15,
        DAP$K_CPM=16,
        DAP$K_MSDOS=17,
	DAP$K_ULTRIX32=18,
	DAP$K_ULTRIX11=19;

LITERAL DAP$K_OSTYPE_MAX=19;

!
!DAP File system type codes defined:
!

LITERAL	DAP$K_FILESYS_RMS11=1,
	 DAP$K_RMS11=DAP$K_FILESYS_RMS11,
	DAP$K_FILESYS_RMS20=2,
	 DAP$K_RMS20=DAP$K_FILESYS_RMS20,
	DAP$K_FILESYS_RMS32=3,
	 DAP$K_RMS32=DAP$K_FILESYS_RMS32,
	DAP$K_FILESYS_FCS11=4,
	 DAP$K_FCS11=DAP$K_FILESYS_FCS11,
	DAP$K_FILESYS_RT11=5,
	DAP$K_FILESYS_NONE=6,
        DAP$K_FILESYS_TOPS20=7,
        DAP$K_FILESYS_TOPS10=8,
        DAP$K_FILESYS_OS8=9,
        DAP$K_FILESYS_RMS32S=10,
	DAP$K_FILESYS_CPM=11,
	DAP$K_FILESYS_MSDOS=12,
	DAP$K_FILESYS_ULTRIX32=13,
	DAP$K_FILESYS_ULTRIX11=14;

LITERAL DAP$K_FILESYS_MAX=14;
!
!	DAP ATTRIBUTE MESSAGE FIELD DEFINITIONS
!
%(
![5.0]	SYSCAP BITS
LITERAL
	SYS_PREALLOCATE=0,	!PREALLOCATION
	SYS_SEQ_ORG=1,	!Sequential file organization
	SYS_REL_ORG=2,	!Relative...
	SYS_DIR_ORG=3,	!Direct... (reserved)
	SYS_1KEY_ORG=4,	!Single keyed indexed... (reserved)
	SYS_SEQ_ACC=5,	!Sequential file access
	SYS_REC_ACC=6,	!Access by record #
	SYS_VBN_ACC=8,	!Access by VBN
	SYS_KEY_ACC=9,	!Random access by Key
	SYS_HSH_ACC=10,	!User generated hash code access (reserved)
	SYS_RFA_ACC=11,	!Access by RFA
	SYS_NKEY_ORG=12,!Multi-key indexed organization
	SYS_SWITCH_ACC=13,	!Switching access mode
	SYS_APPEND=14,	!Append
	SYS_SUBMIT_ACC=16, !SUBMIT access message
	SYS_COMPRESS=17, !File compression (reserved)
	SYS_STREAMS=18,	!Multiple data streams
	SYS_STSRET=19,	!Status return
	SYS_BLOCKING=20,!DAP message blocking
	SYS_SBLOCKING=21, !Blocking across responses
	SYS_LEN256=22,	!2-byte length field supported
	SYS_CHECKSUM=24,!File checksum
	SYS_KDF=25,	!KEY definition XAM
	SYS_ALLOC=26,	!ALLOCATION XAM
	SYS_SUM=27,	!Summary attributes XAM
	SYS_FHC=28,	!File header characteristics XAM
	SYS_DTM=29,	!Date & time XAM
	SYS_PRO=30,	!Protection XAM
	SYS_ACL=32,		!Access control list XAM
	SYS_SPOOL_FOP=33,	!Spool via FOP field
	SYS_SUBMIT_FOP=34,	!Submit via FOP field
	SYS_ERASE_FOP=35,	!Delete via FOP field
	SYS_DEFAULT_FSP=36,	!Default filespec
	SYS_RELATED_FSP=37,	!Related filespec
	SYS_RECOVERY=38,	!Recovery option (reserved)
	SYS_BITCNT=40;		!BITCOUNT field
)%
!	MENU OF FIELDS IN ATTRIBUTES MESSAGE

LITERAL
	DAP$V_ATTMENU_DAT=0,		! DATA TYPE
	DAP$V_ATTMENU_ORG=1,
	DAP$V_ATTMENU_RFM=2,
	DAP$V_ATTMENU_RAT=3,
	DAP$V_ATTMENU_BLS=4,
	DAP$V_ATTMENU_MRS=5,
	DAP$V_ATTMENU_ALQ=6,
	DAP$V_ATTMENU_BKS=7,
	DAP$V_ATTMENU_FSZ=8,
	DAP$V_ATTMENU_MRN=9,
	DAP$V_ATTMENU_RUN=10,
	DAP$V_ATTMENU_DEQ=11,
	DAP$V_ATTMENU_FOP=12,	!FOP
	DAP$V_ATTMENU_BSZ=13,   !Byte size
	DAP$V_ATTMENU_DEV=14,	!Device characteristics
	DAP$V_ATTMENU_SDC=15,	!Spooled dev char. (reserved)
        DAP$V_ATTMENU_LRL=16,   ! Longest record length
        DAP$V_ATTMENU_HBK=17,   ! High block number
        DAP$V_ATTMENU_EBK=18,   ! EOF block number
        DAP$V_ATTMENU_FFB=19,   ! First free byte in last block
        DAP$V_ATTMENU_SBN=20;   ! Starting block number (contiguous file only)

!	DATATYPE FIELD DEFINITIONS

LITERAL
	DAP$V_DATATYPE_ASCII=0,		! ASCII DATA
	DAP$V_DATATYPE_IMAGE=1,         ! IMAGE MODE (DEFAULT)
	DAP$V_DATATYPE_EBCDIC=2,        ! EBCDIC
	DAP$V_DATATYPE_COMPRESSED=3,    ! COMPRESSED
	DAP$V_DATATYPE_EXECUTABLE=4,    ! EXECUTABLE
	DAP$V_DATATYPE_PRIVELEGED=5,    ! PRIVILEGED
                                        ! 6 is reserved
	DAP$V_DATATYPE_ZERO_ON_DELETE=7;! Zero on delete [5.0]

!	ORG FIELD

LITERAL
	DAP$K_ORG_SEQ=0,		! SEQUENTIAL (DEFAULT)
	DAP$K_ORG_REL=%O'20',		! RELATIVE
	DAP$K_ORG_IDX=%O'40',		! INDEXED
	DAP$K_ORG_DIR=%O'60';		! DIRECT

! RECORD FORMAT (RFM) FIELD

LITERAL
	DAP$K_RFM_UDF=0,		! UNDEFINED RECORD FORMAT
	DAP$K_RFM_FIX=1,		! FIXED LENGTH (DEFAULT)
	DAP$K_RFM_VAR=2,		! VARIABLE LENGTH
	DAP$K_RFM_VFC=3,		! VARIABLE WITH FIXED CONTROL
	DAP$K_RFM_STM=4,		! ASCII STREAM
	DAP$K_RFM_SLF=5,		! ASCII STREAM-LF
	DAP$K_RFM_SCR=6;		! ASCII STREAM-CR

!	RAT FIELD - RECORD ATTRIBUTES

LITERAL
	DAP$V_RAT_FTN=0,        ! FORTRAN CARRIAGE CONTROL
	DAP$V_RAT_CR=1,		! LF/CR ENVELOPE
	DAP$V_RAT_BLK=3,        ! RECORDS DO NOT SPAN BLOCKS
        DAP$V_RAT_EFC=4,        ! EMBEDDED FORMAT CONTROL
	DAP$V_RAT_CBL=5,        ! COBOL CARRIAGE CTL
        DAP$V_RAT_LSA=6,        ! LINE SEQUENCED ASCII
        DAP$V_RAT_MACY11=7;     ! MACY11 FORMAT


!	DEV FIELD - GENERIC DEVICE CHARACTERISTICS

LITERAL
	DAP$V_DEV_REC=0,		! RECORD ORIENTED
	DAP$V_DEV_CCL=1,		! CARRAIGE CONTROL DEVICE
	DAP$V_DEV_TRM=2,		! TERMINAL
	DAP$V_DEV_MDI=3,		! DIRECTORY STRUCTURED
	DAP$V_DEV_SDI=4,		! SINGLE DIRECTORY
	DAP$V_DEV_SQD=5,		! INHERENTLY SEQUENTIAL

	DAP$V_DEV_FOD=7,		! FILES ORIENTED DEVICE
	DAP$V_DEV_SHR=8,		! SHARABLE DEVICE
	DAP$V_DEV_SPL=9,		! DEVICE IS BEING SPOOLED
	DAP$V_DEV_MNT=10,		! DEVICE IS CURRENTLY MOUNTED
	DAP$V_DEV_DMT=11,		! DEV MARKED FOR DISMOUNT
	DAP$V_DEV_ALL=12,		! DEV ALLOCATED
	DAP$V_DEV_IDV=13,		! DEVICE CAPABLE OF INPUT

	DAP$V_DEV_ODV=14,		! DEVICE CAPABLE OF OUTPUT
	DAP$V_DEV_SWL=15,		! SOFTWARE WRITE=LOCKED
	DAP$V_DEV_AVL=16,		! DEVICE AVAILABLE
	DAP$V_DEV_ELG=17,		! ERROR LOGGING ENABLED
	DAP$V_DEV_MBX=18,		! DEVICE IS A MAILBOX
	DAP$V_DEV_RTM=19,		! DEVICE IS REAL-TIME IN NATURE
	DAP$V_DEV_RAD=20;		! DEVICE IS RANDOM ACCESS

!	FOP - FILE ACCESS OPTIONS REQUIRED

LITERAL
	DAP$V_FOP_RWO=0,		! REWIND ON OPEN
	DAP$V_FOP_RWC=1,		! REWIND ON CLOSE
	DAP$V_FOP_POS=3,		! MAG TAPE POSITIONED PAST LAST FILE
	DAP$V_FOP_DLK=4,		! DO NOT LOCK IF CLOSE OK
	DAP$V_FOP_ACK=6,		! VERIFY ATTRIBUTES

	DAP$V_FOP_CTG=7,		! CONTIGUOUS ALLOCATION
	DAP$V_FOP_SUP=8,		! SUPERSCEDE EXISTING FILE
	DAP$V_FOP_NEF=9,		! FORTRAN TAPE OPEN UPDATE
	DAP$V_FOP_TMP=10,		! CREATE TEMP FILE
	DAP$V_FOP_MKD=11,		! MARK FOR DELETION
	DAP$V_FOP_FID=12,		! OPEN BY FILE ID
	DAP$V_FOP_DMP=13,		! DISMOUNT ON CLOSE

	DAP$V_FOP_WCK=14,		! WRITE CHECKING
	DAP$V_FOP_RCK=15,		! READ CHECKING
	DAP$V_FOP_CIF=16,		! NEW FILE ONLY
	DAP$V_FOP_LKO=17,		! OVERRIDE FILE LOCK ON OPEN
	DAP$V_FOP_SQO=18,		! SEQUENTIAL ACCESS ONLY
	DAP$V_FOP_MVN=19,		! Maximum version number
	DAP$V_FOP_SPL=20,		! Spool to printer

	DAP$V_FOP_SCF=21,		! Submit to BATCH on close
	DAP$V_FOP_DLT=22,		! Delete on close
	DAP$V_FOP_CBT=23,		! Contiguous best try
	DAP$V_FOP_WAT=24;		! Wait if locked by another user

!	MENU BITS FOR DATE & TIME MESSAGE

LITERAL
	DAP$V_DTM_CDT=0,		! CREATION DATE PRESENT
	DAP$V_DTM_RDT=1,		! ACCESS DATE PRESENT
	DAP$V_DTM_EDT=2,		! SCRATCH DATE PRESENT
        DAP$V_DTM_RVN=3,                ! Revision number present
        DAP$V_DTM_BDT=4,                ! Backup date present    	!M002
        DAP$V_DTM_PDT=5,                ! Internal date present         !M002
        DAP$V_DTM_ADT=6;                ! Internal date present         !A002


!	MENU BITS FOR PROTECTION MESSAGE

LITERAL
	DAP$V_PROTMENU_OWNER=0,		! OWNER FIELD PRESENT
	DAP$V_PROTMENU_PROTSYS=1,       ! SYSTEM PROTECTION FIELD PRESENT
	DAP$V_PROTMENU_PROTOWN=2,       ! OWNER PROTECTION FIELD PRESENT
	DAP$V_PROTMENU_PROTGRP=3,       ! GROUP PROTECTION FIELD PRESENT
	DAP$V_PROTMENU_PROTWLD=4;       ! WORLD PROTECTION FIELD PRESENT

!	BIT DEFINITIONS IN PROTECTION FIELDS

LITERAL
	DAP$V_PROT_RDV=0,		! DENY READ ACCESS
	DAP$V_PROT_WRV=1,		! DENY WRITE ACCESS
	DAP$V_PROT_EXE=2,		! DENY EXECUTE ACCESS
	DAP$V_PROT_DLE=3,		! DENY DELETE ACCESS
	DAP$V_PROT_APP=4,		! DENY APPEND ACCESS
	DAP$V_PROT_LST=5,		! DENY LIST (directory) ACCESS
	DAP$V_PROT_UPD=6,		! DENY UPDATE ACCESS
	DAP$V_PROT_CNG=7,		! DENY CHANGE PROTECTION ACCESS
	DAP$V_PROT_EXT=8;		! DENY EXTEND ACCESS
!       SUMMARY MESSAGE FIELDS

LITERAL 
    Dap$v_SumMenu_Nok=0,
    Dap$v_SumMenu_Noa=1,
    Dap$v_SumMenu_Nor=2,
    Dap$v_SumMenu_Pvn=3;
!       KEY DEFINITION MESSAGE FIELDS

LITERAL
    Dap$v_KeyMenu_Flg=0,
    Dap$v_KeyMenu_Dfl=1,
    Dap$v_KeyMenu_Ifl=2,
    Dap$v_KeyMenu_Nsg=3,
    Dap$v_KeyMenu_Ref=4,
    Dap$v_KeyMenu_Knm=5,
    Dap$v_KeyMenu_Nul=6,
    Dap$v_KeyMenu_Ian=7,
    Dap$v_KeyMenu_Lan=8,
    Dap$v_KeyMenu_Dan=9,
    Dap$v_KeyMenu_Dtp=10,
    Dap$v_KeyMenu_Rvb=11,
    Dap$v_KeyMenu_Hal=12,
    Dap$v_KeyMenu_Dvb=13,
    Dap$v_KeyMenu_Dbs=14,
    Dap$v_KeyMenu_Ibs=15,
    Dap$v_KeyMenu_Lvl=16,
    Dap$v_KeyMenu_Tks=17,
    Dap$v_KeyMenu_Mrl=18,
    

    ! Flg bits

    Dap$v_Flg_dup=0,
    Dap$v_Flg_chg=1,
    Dap$v_Flg_nul=2,

    ! Dtp values

    Dap$k_Dtp_Stg=0,
    Dap$k_Dtp_In2=1,
    Dap$k_Dtp_Bn2=2,
    Dap$k_Dtp_In4=3,
    Dap$k_Dtp_Bn4=4,
    Dap$k_Dtp_Pac=5,
    Dap$k_Dtp_In8=6,
    Dap$k_Dtp_Bn8=7;
!       ALLOCATION MESSAGE FIELDS

LITERAL
    Dap$v_AllMenu_Vol=0,
    Dap$v_AllMenu_Aln=1,
    Dap$v_AllMenu_Aop=2,
    Dap$v_AllMenu_Loc=3,
    Dap$v_AllMenu_Rfi=4,
    Dap$v_AllMenu_Alq=5,
    Dap$v_AllMenu_Aid=6,
    Dap$v_AllMenu_Bkz=7,
    Dap$v_AllMenu_Deq=8,

    Dap$v_Aln_Any=0,
    Dap$v_Aln_Cyl=1,
    Dap$v_Aln_Lbn=2,
    Dap$v_Aln_Vbn=3,
    Dap$v_Aln_Rfi=4,

    Dap$v_Aop_Hrd=0,
    Dap$v_Aop_Ctg=1,
    Dap$v_Aop_Cbt=2,
    Dap$v_Aop_Onc=3;
!
!	ACCESS MESSAGE FIELD DEFINITIONS
!

!	ACCESS FUNCTION FIELD


LITERAL
	DAP$K_OPEN=1,                   ! OPEN EXISTING FILE
	DAP$K_CREATE=2,                 ! LCREATE NEW FILE
	DAP$K_RENAME=3,                 ! RENAME FILE
	DAP$K_ERASE=4,                  ! ERASE A FILE
	DAP$K_DIRECTORY=6,		! DIRECTORY LIST
	DAP$K_SUBMIT=7,                 ! SUBMIT AS A BATCH JOB
	DAP$K_EXECUTE=8,		! EXECUTE A BATCH JOB

        DAP$K_ACCFUNC_MAX=8;            ! Maximum value for ACCFUNC

!       ACCOPT FIELD - ACCESS OPTIONS

LITERAL
        Dap$v_Accopt_ErrNotFatal   = 0, ! I/O errors are not fatal
        Dap$v_Accopt_ModAttributes = 1, ! Modified Attributes on Create
        Dap$v_Accopt_Crc           = 3, ! End-to-End CRC checking option
        Dap$v_Accopt_GoNoGo        = 4; ! Go/Nogo option

!	FAC FIELD - FILE ACCESS OPERATIONS REQUIRED

                                        ! Following are bit numbers
LITERAL
	DAP$V_FAC_PUT=0,		! PUT ACCESS
	DAP$V_FAC_GET=1,		! GET ACCESS
	DAP$V_FAC_DEL=2,		! DELETE ACCESS
	DAP$V_FAC_UPD=3,		! UPDATE ACCESS
	DAP$V_FAC_TRN=4,		! TRUNCATE ACCESS
	DAP$V_FAC_BIO=5;		! BLOCK I/O ACCESS
!
!	CONTROL MESSAGE FIELD DEFINITIONS
!

!	CONTROL FUNCTION CODES

LITERAL
	DAP$K_GET=1,                    ! GET RECORD
	DAP$K_CONNECT=2,		! INITIATE A DATA STREAM
	DAP$K_UPDATE=3,                 ! UPDATE CURRENT RECORD
	DAP$K_PUT=4,                    ! PUT FOLLOWING RECORDS
	DAP$K_DELETE=5,                 ! DELETE CURRENT RECORD
	DAP$K_REWIND=6,                 ! REWIND FILE
	DAP$K_TRUNCATE=7,		! TRUNCATE FILE
        DAP$K_MODIFY=8,                 ! MODIFY FILE ATTRIBUTES
	DAP$K_RELEASE=9,		! UNLOCK RECORD
	DAP$K_FREE=10,                  ! UNLOCK ALL RECORDS
	DAP$K_EXTEND_BEGIN=11,		! EXTEND FILE BY ALC MSG
	DAP$K_FLUSH=12,                 ! WRITE OUT ALL MODIFIED I/O BUFS
	DAP$K_NXTVOL=13,		! START NEXT VOLUME
	DAP$K_FIND=14,                  ! FIND RECORD
	DAP$K_EXTEND_END=15,		! EXTEND FILE BY ALC MSG
	DAP$K_DISPLAY=16,		! RETRIEVE ATTRIBUTES MESSAGE
	DAP$K_SPACE_FORWARD=17,         ! FORWARD SPACE
	DAP$K_SPACE_BACKWARD=18,        ! BACKWARD SPACE
        DAP$K_CHECKPOINT=19,            ! CHECKPOINT
        DAP$K_RECOVERY_GET=20,          ! GET, recovering after checkpoint
        DAP$K_RECOVERY_PUT=21,          ! PUT, recovering after checkpoint

        DAP$K_CTLFUNC_MAX=21;           ! Highest defined function code

!	CONTROL MESSAGE MENU FIELD

LITERAL
	DAP$V_CTL_RAC=0,		! RAC FIELD PRESENT
	DAP$V_CTL_KEY=1,
	DAP$V_CTL_KRF=2,
	DAP$V_CTL_ROP=3,
	DAP$V_CTL_HSH=4,
	DAP$V_CTL_DISPLAY=5;

!	RAC FIELD DEFINITIONS

LITERAL
	DAP$K_RAC_SEQ=0,		! SEQUENTIAL RECORD ACCESS
	DAP$K_RAC_KEY=1,		! KEYED ACCESS
	DAP$K_RAC_RFA=2,		! ACCESS BY RECORD FILE ADDRESS
	DAP$K_RAC_TRA=3,		! SEQUENTIAL FILE TRANSFER
	DAP$K_RAC_BLK=4,		! ACCESS BY VIRTUAL BLOCK NUMBER
	DAP$K_RAC_BFT=5;		! BLOCK MODE FILE TRANSFER

!	ROP FIELD - RECORD PROCESSING FEATURES

LITERAL
	DAP$V_ROP_EOF=0,		! POSITION TO EOF
	DAP$V_ROP_HSH=3,		! USE HASH CODE IN HSH FIELD
	DAP$V_ROP_LOA=4,		! FOLLOW FILL QUANTITIES
	DAP$V_ROP_ULK=5,		! MANUAL LOCKING/UNLOCKING
	DAP$V_ROP_RAH=7,		! READ AHEAD
	DAP$V_ROP_WBH=8,		! WRITE BEHIND
	DAP$V_ROP_KGE=9,		! KEY IS >=
	DAP$V_ROP_KGT=10;		! KEY IS >

!	DISPLAY FIELD DEFINITIONS

LITERAL
       Dap$v_Display_Attributes=0,
	DAP$V_DISPLAY_ATT=0,		! MAIN ATTRIBUTES MESSAGE
	DAP$V_DISPLAY_KEY=1,		! KEY DEF ATTRIBUTES
       Dap$v_Display_Allocation=2,
	DAP$V_DISPLAY_ALL=2,		! ALLOCATION ATTRIBUTES
       Dap$v_Display_Summary=3,
	DAP$V_DISPLAY_SUM=3,		! SUMMARY ATTRIBUTES
       Dap$v_Display_Date_Time=4,
        DAP$V_DISPLAY_DAT=4,
	DAP$V_DISPLAY_DTM=4,		! DATE/TIME
       Dap$v_Display_Protection=5,
        DAP$V_DISPLAY_PRO=5,            ! PROTECTION
        DAP$V_DISPLAY_ACL=7,            ! ACCESS CONTROL LIST
       Dap$v_Display_Name=8,
        DAP$V_DISPLAY_NAM=8,            ! RESULTANT FILE NAME
       Dap$v_Display_3_Part_Name=9;     ! 3-part name
!
!	CONTINUE TRANSFER MESSAGE FIELDS
!

!	RECOVERY ACTION DEFINITIONS

LITERAL
	DAP$K_CON_RETRY=1,		! TRY AGAIN
	DAP$K_CON_SKIP=2,		! SKIP RECORD
	DAP$K_CON_ABORT=3,		! ABORT TRANSFER
        DAP$K_CON_RESUME=4;             ! Resume
!
!	ACCESS COMPLETE FIELD DEFINITIONS
!

!	FUNCTION DEFINITIONS

LITERAL
	Dap$k_Accomp_Command=1,		! COMMAND - CLOSE THE FILE
	Dap$k_Accomp_Response=2,        ! RESPONSE
        Dap$k_Accomp_Reset=3,           ! RESET FILE
	  Dap$k_Accomp_Purge=3,		! RESET FILE (old name)
	Dap$k_Accomp_Eos=4,		! END STREAM (DISCONNECT)
        Dap$k_Accomp_Skip=5,            ! Skip file
        Dap$k_Accomp_Change_Begin=6,    ! Start of attr change on close
        Dap$k_Accomp_Change_End=7,      ! End of attr change on close
        Dap$k_Accomp_Terminate=8,       ! Return to initial state

        Dap$k_Accomp_Max=8;             ! Max defined value
!
!	STATUS message
!

LITERAL
	DAP$M_MACCODE=%O'170000',
	DAP$M_MICCODE=%O'7777';

!
!	MACCODE FIELD VALUES
!

LITERAL
	DAP$K_MAC_PENDING =    %O'00000',       ! OPERATION IN PROGRESS
	DAP$K_MAC_SUCCESS =    %O'10000',       ! SUCCESS
	DAP$K_MAC_UNSUPPORTED= %O'20000',       ! UNSUPPORTED
	DAP$K_MAC_OPEN =       %O'40000',       ! ERROR IN OPEN
	DAP$K_MAC_TRANSFER =   %O'50000',       ! ERROR IN TRANSFER
	DAP$K_MAC_WARNING =    %O'60000',	! WARNING
	DAP$K_MAC_TERMINATION= %O'70000',       ! ERROR IN TERMINATION
	DAP$K_MAC_FORMAT =     %O'100000',      ! BAD FORMAT
	DAP$K_MAC_INVALID =   %O'110000',       ! FIELD OF MESSAGE INVALID
	DAP$K_MAC_SYNC =      %O'120000';       ! MESSAGE OUT OF SEQUENCE
!
!	MICCODE VALUES FOR MACCODE 2,8,9
!

LITERAL

!	FIRST 6 BITS FOR DAP MESSAGE TYPE NUMBER
	
	DAP$K_MIC_MISC=0,               ! UNSPECIFIED DAP MSG ERROR
	DAP$K_MIC_CONFIG=%O'0100',      ! IN CONFIGURATION
	DAP$K_MIC_ATTRIBUTES=%O'0200',  ! IN ATTRIBUTES
	DAP$K_MIC_ACCESS=%O'0300',      ! IN ACCESS
	DAP$K_MIC_CONTROL=%O'0400',     ! IN CONTROL
	DAP$K_MIC_CONTINUE=%O'0500',    ! IN CONTINUE
	DAP$K_MIC_ACKNOWLEDGE=%O'0600', ! IN ACKNOWLEDGE
	DAP$K_MIC_ACCESS_COMPLETE=%O'0700', ! IN ACCOMP
	DAP$K_MIC_DATA=%O'1000',        ! IN DATA
	DAP$K_MIC_STATUS=%O'1100',      ! IN STATUS
	DAP$K_MIC_KEY=%O'1200',		! IN KEY DEF MSG
	DAP$K_MIC_ALLOCATION=%O'1300',  ! IN ALLOCATION MSG
        DAP$K_MIC_SUMMARY=%O'1400',     ! IN SUMMARY MSG
        DAP$K_MIC_DATE_TIME=%O'1500',   ! IN DATE/TIME MSG
        DAP$K_MIC_PROTECTION=%O'1600',  ! IN PROTECTION MSG
        DAP$K_MIC_NAME=%O'1700',        ! IN NAME MSG
	DAP$K_MIC_ACL=%O'2000';		! IN ACCESS CONTROL LIST

!
!       MICCODE VALUES TO INDICATE WHICH FIELD IS IN ERROR
!       (For MACCODE=2,8,9)
!

        ! Common to all messages
LITERAL
        DAP$K_MIC_UNKNOWN=0,            ! Unknown field
        DAP$K_MIC_FLAGS=%O'10',         ! Message flags
        DAP$K_MIC_STREAMID=%O'11',      ! Stream Identifier
        DAP$K_MIC_LENGTH=%O'12',        ! Length
        DAP$K_MIC_LEN256=%O'13',        ! Len256 (hi byte of length)
        DAP$K_MIC_BITCNT=%O'14',        ! Bit Count
        DAP$K_MIC_SYSPEC=%O'15';        ! System specific field

        ! Configuration message errors by field
LITERAL
        DAP$K_MIC_CONFIG_BUFFER_SIZE=DAP$K_MIC_CONFIG+%O'20',
        DAP$K_MIC_CONFIG_OSTYPE=DAP$K_MIC_CONFIG+%O'21',
        DAP$K_MIC_CONFIG_FILESYS=DAP$K_MIC_CONFIG+%O'22',
        DAP$K_MIC_CONFIG_VERNUM=DAP$K_MIC_CONFIG+%O'23',
        DAP$K_MIC_CONFIG_ECONUM=DAP$K_MIC_CONFIG+%O'24',
        DAP$K_MIC_CONFIG_USRNUM=DAP$K_MIC_CONFIG+%O'25',
        DAP$K_MIC_CONFIG_SOFTVER=DAP$K_MIC_CONFIG+%O'26',
        DAP$K_MIC_CONFIG_USRSOFT=DAP$K_MIC_CONFIG+%O'27',
        DAP$K_MIC_CONFIG_SYSCAP=DAP$K_MIC_CONFIG+%O'30';

        !Attributes message errors by field
LITERAL
        DAP$K_MIC_ATTRIBUTES_ATTMENU=DAP$K_MIC_ATTRIBUTES+%O'20',
        DAP$K_MIC_ATTRIBUTES_DATATYPE=DAP$K_MIC_ATTRIBUTES+%O'21',
        DAP$K_MIC_ATTRIBUTES_ORG=DAP$K_MIC_ATTRIBUTES+%O'22',
        DAP$K_MIC_ATTRIBUTES_RFM=DAP$K_MIC_ATTRIBUTES+%O'23',
        DAP$K_MIC_ATTRIBUTES_RAT=DAP$K_MIC_ATTRIBUTES+%O'24',
        DAP$K_MIC_ATTRIBUTES_BLS=DAP$K_MIC_ATTRIBUTES+%O'25',
        DAP$K_MIC_ATTRIBUTES_MRS=DAP$K_MIC_ATTRIBUTES+%O'26',
        DAP$K_MIC_ATTRIBUTES_ALQ=DAP$K_MIC_ATTRIBUTES+%O'27',
        DAP$K_MIC_ATTRIBUTES_BKS=DAP$K_MIC_ATTRIBUTES+%O'30',
        DAP$K_MIC_ATTRIBUTES_FSZ=DAP$K_MIC_ATTRIBUTES+%O'31',
        DAP$K_MIC_ATTRIBUTES_MRN=DAP$K_MIC_ATTRIBUTES+%O'32',
        DAP$K_MIC_ATTRIBUTES_RUNSYS=DAP$K_MIC_ATTRIBUTES+%O'33',
        DAP$K_MIC_ATTRIBUTES_DEQ=DAP$K_MIC_ATTRIBUTES+%O'34',
        DAP$K_MIC_ATTRIBUTES_FOP=DAP$K_MIC_ATTRIBUTES+%O'35',
        DAP$K_MIC_ATTRIBUTES_BSZ=DAP$K_MIC_ATTRIBUTES+%O'36',
        DAP$K_MIC_ATTRIBUTES_DEV=DAP$K_MIC_ATTRIBUTES+%O'37',
        DAP$K_MIC_ATTRIBUTES_SDC=DAP$K_MIC_ATTRIBUTES+%O'40',
        DAP$K_MIC_ATTRIBUTES_LRL=DAP$K_MIC_ATTRIBUTES+%O'41',
        DAP$K_MIC_ATTRIBUTES_HBK=DAP$K_MIC_ATTRIBUTES+%O'42',
        DAP$K_MIC_ATTRIBUTES_EBK=DAP$K_MIC_ATTRIBUTES+%O'43',
        DAP$K_MIC_ATTRIBUTES_FFB=DAP$K_MIC_ATTRIBUTES+%O'44',
        DAP$K_MIC_ATTRIBUTES_SBN=DAP$K_MIC_ATTRIBUTES+%O'45';

        ! Access message errors by field
LITERAL
        DAP$K_MIC_ACCESS_ACCFUNC=DAP$K_MIC_ACCESS+%O'20',
        DAP$K_MIC_ACCESS_ACCOPT=DAP$K_MIC_ACCESS+%O'21',
        DAP$K_MIC_ACCESS_FILESPEC=DAP$K_MIC_ACCESS+%O'22',
        DAP$K_MIC_ACCESS_FAC=DAP$K_MIC_ACCESS+%O'23',
        DAP$K_MIC_ACCESS_SHR=DAP$K_MIC_ACCESS+%O'24',
        DAP$K_MIC_ACCESS_DISPLAY=DAP$K_MIC_ACCESS+%O'25',
        DAP$K_MIC_ACCESS_PASSWORD=DAP$K_MIC_ACCESS+%O'26';

        ! Control message errors by field
LITERAL
        DAP$K_MIC_CONTROL_CTLFUNC=DAP$K_MIC_CONTROL+%O'20',
        DAP$K_MIC_CONTROL_CTLMENU=DAP$K_MIC_CONTROL+%O'21',
        DAP$K_MIC_CONTROL_RAC=DAP$K_MIC_ACCESS+%O'22',
        DAP$K_MIC_CONTROL_KEY=DAP$K_MIC_CONTROL+%O'23',
        DAP$K_MIC_CONTROL_KRF=DAP$K_MIC_CONTROL+%O'24',
        DAP$K_MIC_CONTROL_ROP=DAP$K_MIC_CONTROL+%O'25',
        DAP$K_MIC_CONTROL_HSH=DAP$K_MIC_CONTROL+%O'26',
        DAP$K_MIC_CONTROL_DISPLAY=DAP$K_MIC_CONTROL+%O'27';

        ! Continue message errors by field
LITERAL
        DAP$K_MIC_CONTINUE_CONTFUNC=DAP$K_MIC_CONTINUE+%O'20';

        ! Acknowledge message errors by field

        ! None

        ! Access complete message errors by field
LITERAL
        DAP$K_MIC_ACCOMP_CMPFUNC=DAP$K_MIC_ACCESS_COMPLETE+%O'20',
        DAP$K_MIC_ACCOMP_FOP=DAP$K_MIC_ACCESS_COMPLETE+%O'21',
        DAP$K_MIC_ACCOMP_CHECK=DAP$K_MIC_ACCESS_COMPLETE+%O'22';

        ! Data message errors by field
LITERAL
        DAP$K_MIC_DATA_RECNUM=DAP$K_MIC_DATA+%O'20',
        DAP$K_MIC_DATA_FILEDATA=DAP$K_MIC_DATA+%O'21';

        ! Status message errors by field
LITERAL
        DAP$K_MIC_STATUS_MACCODE=DAP$K_MIC_STATUS+%O'20',
        DAP$K_MIC_STATUS_MICCODE=DAP$K_MIC_STATUS+%O'21',
        DAP$K_MIC_STATUS_RFA=DAP$K_MIC_STATUS+%O'22',
        DAP$K_MIC_STATUS_RECNUM=DAP$K_MIC_STATUS+%O'23',
        DAP$K_MIC_STATUS_STV=DAP$K_MIC_STATUS+%O'24';

        ! Key Definition message errors by field
LITERAL
        DAP$K_MIC_KEY_KEYMENU=DAP$K_MIC_KEY+%O'20',
        DAP$K_MIC_KEY_FLG=DAP$K_MIC_KEY+%O'21',
        DAP$K_MIC_KEY_DFL=DAP$K_MIC_KEY+%O'22',
        DAP$K_MIC_KEY_IFL=DAP$K_MIC_KEY+%O'23',
        DAP$K_MIC_KEY_SEGCNT=DAP$K_MIC_KEY+%O'24',
        DAP$K_MIC_KEY_POS=DAP$K_MIC_KEY+%O'25',
        DAP$K_MIC_KEY_SIZ=DAP$K_MIC_KEY+%O'26',
        DAP$K_MIC_KEY_REF=DAP$K_MIC_KEY+%O'27',
        DAP$K_MIC_KEY_KNM=DAP$K_MIC_KEY+%O'30',
        DAP$K_MIC_KEY_NUL=DAP$K_MIC_KEY+%O'31',
        DAP$K_MIC_KEY_IAN=DAP$K_MIC_KEY+%O'32',
        DAP$K_MIC_KEY_LAN=DAP$K_MIC_KEY+%O'33',
        DAP$K_MIC_KEY_DAN=DAP$K_MIC_KEY+%O'34',
        DAP$K_MIC_KEY_DTP=DAP$K_MIC_KEY+%O'35',
        DAP$K_MIC_KEY_RVB=DAP$K_MIC_KEY+%O'36',
        DAP$K_MIC_KEY_HAL=DAP$K_MIC_KEY+%O'37',
        DAP$K_MIC_KEY_DVB=DAP$K_MIC_KEY+%O'40',
        DAP$K_MIC_KEY_DBS=DAP$K_MIC_KEY+%O'41',
        DAP$K_MIC_KEY_IBS=DAP$K_MIC_KEY+%O'42',
        DAP$K_MIC_KEY_LVL=DAP$K_MIC_KEY+%O'43',
        DAP$K_MIC_KEY_TKS=DAP$K_MIC_KEY+%O'44',
        DAP$K_MIC_KEY_MRL=DAP$K_MIC_KEY+%O'45';

        ! Allocation message errors by field
LITERAL
        DAP$K_MIC_ALLOCATION_ALLMENU=DAP$K_MIC_ALLOCATION+%O'20',
        DAP$K_MIC_ALLOCATION_VOL=DAP$K_MIC_ALLOCATION+%O'21',
        DAP$K_MIC_ALLOCATION_ALN=DAP$K_MIC_ALLOCATION+%O'22',
        DAP$K_MIC_ALLOCATION_AOP=DAP$K_MIC_ALLOCATION+%O'23',
        DAP$K_MIC_ALLOCATION_LOC=DAP$K_MIC_ALLOCATION+%O'24',
        DAP$K_MIC_ALLOCATION_RFI=DAP$K_MIC_ALLOCATION+%O'25',
        DAP$K_MIC_ALLOCATION_ALQ=DAP$K_MIC_ALLOCATION+%O'26',
        DAP$K_MIC_ALLOCATION_AID=DAP$K_MIC_ALLOCATION+%O'27',
        DAP$K_MIC_ALLOCATION_BKZ=DAP$K_MIC_ALLOCATION+%O'30',
        DAP$K_MIC_ALLOCATION_DEQ=DAP$K_MIC_ALLOCATION+%O'31';

        ! Summary message errors by field
LITERAL
        DAP$K_MIC_SUMMARY_SUMMENU=DAP$K_MIC_SUMMARY+%O'20',
        DAP$K_MIC_SUMMARY_NOK=DAP$K_MIC_SUMMARY+%O'21',
        DAP$K_MIC_SUMMARY_NOA=DAP$K_MIC_SUMMARY+%O'22',
        DAP$K_MIC_SUMMARY_NOR=DAP$K_MIC_SUMMARY+%O'23',
        DAP$K_MIC_SUMMARY_PVN=DAP$K_MIC_SUMMARY+%O'24';

        ! Date/Time message errors by field
LITERAL
        DAP$K_MIC_DATE_TIME_DATMENU=DAP$K_MIC_DATE_TIME+%O'20',
        DAP$K_MIC_DATE_TIME_CDT=DAP$K_MIC_DATE_TIME+%O'21',
        DAP$K_MIC_DATE_TIME_RDT=DAP$K_MIC_DATE_TIME+%O'22',
        DAP$K_MIC_DATE_TIME_EDT=DAP$K_MIC_DATE_TIME+%O'23',
        DAP$K_MIC_DATE_TIME_RVN=DAP$K_MIC_DATE_TIME+%O'24';

        ! Protection message errors by field
LITERAL
        DAP$K_MIC_PROTECTION_PROTMENU=DAP$K_MIC_PROTECTION+%O'20',
        DAP$K_MIC_PROTECTION_OWNER=DAP$K_MIC_PROTECTION+%O'21',
        DAP$K_MIC_PROTECTION_PROTSYS=DAP$K_MIC_PROTECTION+%O'22',
        DAP$K_MIC_PROTECTION_PROTOWN=DAP$K_MIC_PROTECTION+%O'23',
        DAP$K_MIC_PROTECTION_PROTGRP=DAP$K_MIC_PROTECTION+%O'24',
        DAP$K_MIC_PROTECTION_PROTWLD=DAP$K_MIC_PROTECTION+%O'25';
        
        ! Name message errors by field
LITERAL
        DAP$K_MIC_NAME_NAMETYPE=DAP$K_MIC_NAME+%O'20',
        DAP$K_MIC_NAME_NAMESPEC=DAP$K_MIC_NAME+%O'21';

        ! ACL message errors by field
LITERAL
        DAP$K_MIC_ACL_ACLCNT=DAP$K_MIC_ACL+%O'20',
        DAP$K_MIC_ACL_ACL=DAP$K_MIC_ACL+%O'21';
!
!	MICCODE VALUES FOR MACCODE=4,5,6,7   THESE ARE OPEN ERRORS
!
LITERAL
	DAP$K_ERR_ABO=1,		! OPERATION ABORTED
	DAP$K_ERR_ACC=2,		! COULD NOT ACCESS FILE
	DAP$K_ERR_ACT=3,		! FILE ACTIVITY PRECLUDES OP
	DAP$K_ERR_AID=4,		! BAD AREA ID
	DAP$K_ERR_ALN=5,		! ALIGNMENT OPTIONS ERROR
	DAP$K_ERR_ALQ=6,		! ALLOCATION QUANTITY TOO LARGE
	DAP$K_ERR_ANI=7,		! NOT ANSI 'D' FORMAT
	DAP$K_ERR_AOP=8,		! ALLOC OPTION ERROR
	DAP$K_ERR_AST=9,		! INVALID OP AT AST LEVEL
	DAP$K_ERR_ATR=10,		! ATTRIBUTE READ ERR
	DAP$K_ERR_ATW=11,		! ATTRIBUTE WRITE ERROR
	DAP$K_ERR_BKS=12,		! BUCKET SIZE TOO LARGE
	DAP$K_ERR_BKZ=13,		! "
	DAP$K_ERR_BLN=14,		! BLN LENGTH ERROR
	DAP$K_ERR_BOF=15,		! BEGINNING OF FILE DETECTED
	DAP$K_ERR_BPA=16,		! PRIVATE POOL ADT NOT MULT OF 4
	DAP$K_ERR_BPS=17,		! PRIVATE POOL SIZE NOT MULT OF 4
	DAP$K_ERR_BUG=18,		! Internal RMS Error
	DAP$K_ERR_CCR=19,		! Can't connect RAB
	DAP$K_ERR_CHG=20,		! $UPDATE changed a key w/o XB$CHG
	DAP$K_ERR_CHK=21,		! Bucket format Check-byte error
	DAP$K_ERR_CLS=22,		! RSTS/E close function failed *
	DAP$K_ERR_COD=23,		! Invalid or unsupported COD field (STV=XAB)
	DAP$K_ERR_CRE=24,		! F11ACP could not create file *
	DAP$K_ERR_CUR=25,		! No current record (no GET/FIND)
	DAP$K_ERR_DAC=26,		! F11ACP deaccess error in CLOSE *
	DAP$K_ERR_DAN=27,		! Data "AREA" number invalid (STV=XAB)
	DAP$K_ERR_DEL=28,		! RFA-Accessed record was deleted
	DAP$K_ERR_DEV=29,		! Bad device or inappropriate device type
	DAP$K_ERR_DIR=30,		! Error in directory name
	DAP$K_ERR_DME=31,		! Dynamic memory exhausted
	DAP$K_ERR_DNF=32,		! Directory not found
	DAP$K_ERR_DNR=33,		! Device not ready
	DAP$K_ERR_DPE=34,		! Device has positioning error *
	DAP$K_ERR_DTP=35,		! "DTP" field invalid (STV=XAB)
	DAP$K_ERR_DUP=36,		! Duplicate key detected, XB$DUP not set
	DAP$K_ERR_ENT=37,		! RSX-F11ACP enter failed *
	DAP$K_ERR_ENV=38,		! Operation not selected in ORG$ macro
	DAP$K_ERR_EOF=39,		! end of file
	DAP$K_ERR_ESS=40,		! Expanded string area too short
	DAP$K_ERR_EXP=41,		! File hasn't expired yet
	DAP$K_ERR_EXT=42,		! Extend failure *
	DAP$K_ERR_FAB=43,		! Not valid FAB ("BID" not FB$BID)
	DAP$K_ERR_FAC=44,		! Illegal FAC for REC-OP 0 or no FB$PUB (create)
	DAP$K_ERR_FEX=45,		! File already exists
	DAP$K_ERR_FID=46,		! Invalid File-ID
	DAP$K_ERR_FLG=47,		! Invalid Flag-bits combination
	DAP$K_ERR_FLK=48,		! File is locked
	DAP$K_ERR_FND=49,		! RSX-F11ACP FIND function failed
	DAP$K_ERR_FNF=50,		! file not found
	DAP$K_ERR_FNM=51,		! Error in File name
	DAP$K_ERR_FOP=52,		! Invalid "FOP" Options
	DAP$K_ERR_FUL=53,		! Device or file full
	DAP$K_ERR_IAN=54,		! Index "AREA" number invalid #
	DAP$K_ERR_IFI=55,		! Invalid IFI value or unopened file
	DAP$K_ERR_IMX=56,		! Too many areas/key XABs
	DAP$K_ERR_INI=57,		! INIT$ never issued
	DAP$K_ERR_IOP=58,		! Operation invalid for this file org
	DAP$K_ERR_IRC=59,		! Illegal record in sequential file
	DAP$K_ERR_ISI=60,		! Invalid ISI value, on unconnected RAB
	DAP$K_ERR_KBF=61,		! Bad KEY buffer address
	DAP$K_ERR_KEY=62,		! Invalid key field
	DAP$K_ERR_KRF=63,		! Invalid key-of-reference
	DAP$K_ERR_KSZ=64,		! Key size too large
	DAP$K_ERR_LAN=65,		! Lowest-level-index "AREA" invalid
	DAP$K_ERR_LBL=66,		! Not ANSI labeled tape
	DAP$K_ERR_LBY=67,		! Logical channel busy
	DAP$K_ERR_LCH=68,		! Logical channel number too large
	DAP$K_ERR_LEX=69,		! Logical extend error
	DAP$K_ERR_LOC=70,		! "LOC" field invalid
	DAP$K_ERR_MAP=71,		! Buffer mapping error
	DAP$K_ERR_MKD=72,		! Could not mark file for deletion
	DAP$K_ERR_MRN=73,		! MRN value<0 or relative key>MRN
	DAP$K_ERR_MRS=74,		! MRS value=0 for FIX or REL
	DAP$K_ERR_NAM=75,		! "NAM" block address invalid
	DAP$K_ERR_NEF=76,		! Not positioned at EOF
	DAP$K_ERR_NID=77,		! Can't allocate internal file desc
	DAP$K_ERR_NPK=78,		! Indexed file--no primary key defined
	DAP$K_ERR_OPN=79,		! RSTS/E OPEN failure *
	DAP$K_ERR_ORD=80,		! XAB's not in correct order #
	DAP$K_ERR_ORG=81,		! Invalid file organization value
	DAP$K_ERR_PLG=82,		! Error in file's prologue (reorg file)
	DAP$K_ERR_POS=83,		! "POS" field invalid (>MRS) #
	DAP$K_ERR_PRM=84,		! Bad file date field retrived #
	DAP$K_ERR_PRV=85,		! Protection violation
	DAP$K_ERR_RAB=86,		! Not a valid RAB ("BID" not = RB$BID)
	DAP$K_ERR_RAC=87,		! Illegal RAC value
	DAP$K_ERR_RAT=88,		! Illegal record attributes
	DAP$K_ERR_RBF=89,		! Invalid record buffer addr
	DAP$K_ERR_RER=90,		! File Read Error *
	DAP$K_ERR_REX=91,		! Record already exists
	DAP$K_ERR_RFA=92,		! Bad RFA value (RFA=0)
	DAP$K_ERR_RFM=93,		! Invalid record format
	DAP$K_ERR_RLK=94,		! Bucket locked by another stream
	DAP$K_ERR_RMV=95,		! RSX-F11ACP REMOVE function failed *
	DAP$K_ERR_RNF=96,		! Record not found (STV=0)
	DAP$K_ERR_RNL=97,		! Record not locked
	DAP$K_ERR_ROP=98,		! Invalid record options
	DAP$K_ERR_RPL=99,		! Error while reading prologue *
	DAP$K_ERR_RRV=100,		! Invalid RRV record encountered
	DAP$K_ERR_RSA=101,		! RAB stream currently active
	DAP$K_ERR_RSZ=102,		! Bad record size
                                        !  (GTR MRS or NEQ MRS for fixed len)
	DAP$K_ERR_RTB=103,		! Record too big for user buffer
                                        !  (STV=actual size)
	DAP$K_ERR_SEQ=104,		! Primary key out of sequence
	DAP$K_ERR_SHR=105,		! "SHR" field invalid
                                        !   (can't share sequential)
	DAP$K_ERR_SIZ=106,		! "SIZ" field invalid #
	DAP$K_ERR_STK=107,		! Stack too big for save area
	DAP$K_ERR_SYS=108,		! System directive error *
	DAP$K_ERR_TRE=109,		! Index tree error
	DAP$K_ERR_TYP=110,		! Error in file type
	DAP$K_ERR_UBF=111,		! Invalid user buffer address
	DAP$K_ERR_USZ=112,		! Invalid user buffer size
	DAP$K_ERR_VER=113,		! Error in version number
	  DAP$K_ERR_GES=113,		! (version # must be explicit or *)
	DAP$K_ERR_VOL=114,		! Invalid volume number
	DAP$K_ERR_WER=115,		! File write error *
	DAP$K_ERR_WLK=116,		! Device is write-locked
	DAP$K_ERR_WPL=117,		! Error while writing prologue
	DAP$K_ERR_XAB=118,		! Invalid XAB
	DAP$K_ERR_BUGDDI=119,		! Default directory invalid
	DAP$K_ERR_CCA=120,		! Can't access argument list
	DAP$K_ERR_CCF=121,		! Can't close file *
	DAP$K_ERR_CDA=122,		! Can't deliver AST
	DAP$K_ERR_CHN=123,		! Channel assignment failure *
	DAP$K_ERR_CNTRLO=124,		! Terminal output ignored due to ^O
	DAP$K_ERR_CNTRLY=125,		! Terminal input aborted due to ^Y
	DAP$K_ERR_DNA=126,		! Default filename string address error
	DAP$K_ERR_DVI=127,		! Invalid device ID field
	DAP$K_ERR_ESA=128,		! Expanded string address error
	DAP$K_ERR_FNA=129,		! Filename string address error
	DAP$K_ERR_FSZ=130,		! FSZ field invalid
	DAP$K_ERR_IAL=131,		! Invalid argument list
	DAP$K_ERR_KFF=132,		! Known file found
	DAP$K_ERR_LNE=133,		! Logical name error
	DAP$K_ERR_NOD=134,		! Node name error
	DAP$K_ERR_NORMAL=135,		! Operation successful (synonym)
	DAP$K_ERR_OK_DUP=136,		! Record inserted had duplicate key
	DAP$K_ERR_OK_IDX=137,		! Index updated, record inserted
	DAP$K_ERR_OK_RLK=138,		! Record locked, but read anyway
	DAP$K_ERR_OK_RRV=139,		! Record inserted in primary,
                                        !  maybe not secondary or RFA
	DAP$K_ERR_OPENED=140,		! Existing file opened
	DAP$K_ERR_PBF=141,		! Bad prompt buffer address
	DAP$K_ERR_PNDING=142,		! Asyncronous operation pending
	DAP$K_ERR_QUO=143,		! Quoted string error
	DAP$K_ERR_RHB=144,		! Record header buffer invalid
	DAP$K_ERR_RLF=145,		! Invalid related file
	DAP$K_ERR_RSS=146,		! Invalid resultant string size
	DAP$K_ERR_RST=147,		! Invalid resultant string address
	DAP$K_ERR_SQO=148,		! Operation not sequential
	DAP$K_ERR_SUC=149,		! Operation successful
	DAP$K_ERR_SPRSED=150,		! Superceding existing file
	DAP$K_ERR_SYN=151,		! Filename syntax error
	DAP$K_ERR_TMO=152,		! Timeout period expired
	DAP$K_ERR_BLK=153,		! FB$BLK record attribute not supported
	DAP$K_ERR_BSZ=154,		! Bad byte size
	DAP$K_ERR_CDR=155,		! Can't disconnect RAB
	DAP$K_ERR_CGJ=156,		! Can't get JFN for file
	DAP$K_ERR_COF=157,		! Can't open file
	DAP$K_ERR_JFN=158,		! Bad JFN value
	DAP$K_ERR_PEF=159,		! Can't position to EOF
	DAP$K_ERR_TRU=160,		! Can't truncate file
	DAP$K_ERR_UDF=161,		! File is in an undefined state
	DAP$K_ERR_XCL=162,		! Exclusive access required
	DAP$K_ERR_DFL=163,		! Directory full
	DAP$K_ERR_RDD=183,		! Rename-- 2 different devices
	  DAP$K_ERR_RTD=183,		! Rename-- 2 different devices
	DAP$K_ERR_RFE=184,		! Rename-- file already exists
	  DAP$K_ERR_RFX=184,		! (Rename-- file already exists)
	DAP$K_ERR_ALC=193,		! File exceeds allocated space
	DAP$K_ERR_NLN=196,		! No file accessed on LUN
	DAP$K_ERR_NMF=199,		! No more files
	DAP$K_ERR_DCK=200,		! DAP checksum error
	  DAP$K_ERR_CRC=200,		! DAP checksum error
	DAP$K_ERR_QEX=201,		! Quota Exceeded
        DAP$K_ERR_LAE=231,              ! Error reading file attributes
        DAP$K_ERR_LNP=232,              ! Protection Error reading file name
        DAP$K_ERR_LAP=233;              ! Protection Error reading file attrs


!
!NAME message:
!

!NAME MESSAGE TYPE BITS

LITERAL
	DAP$K_NAMETYPE_FSP=0,		! File specification
	DAP$K_NAMETYPE_NAM=1,		! File name only
	DAP$K_NAMETYPE_DIR=2,		! Directory name only
	DAP$K_NAMETYPE_STR=3,		! Volume or structure name
	DAP$K_NAMETYPE_DEF=4,		! Default file specifation
	DAP$K_NAMETYPE_REL=5;		! Related file specifation


LITERAL                                 ! Trace function codes
        DAP$K_TRACE_INPUT=1,
        DAP$K_TRACE_OUTPUT=2,
        DAP$K_TRACE_INPUT_INTERRUPT=5,
        DAP$K_TRACE_OUTPUT_INTERRUPT=6;

!
! Error Codes Defined
!

LITERAL DAP$K_FACILITY_CODE=%O'30000000';

COMPILETIME DAP$K_ERRTAB_LENGTH=0;

MACRO ERR_DS(MAC,MIC)=((MAC+MIC)^3+DAP$K_FACILITY_CODE+STS$K_ERROR) %;

LITERAL
    STS$K_$DAP_SUCCESS = STS$K_NORMAL,
    STS$K_$DAP_WARNING = STS$K_WARNING,
    STS$K_$DAP_OPEN = STS$K_ERROR,
    STS$K_$DAP_TRANSFER = STS$K_ERROR,
    STS$K_$DAP_TERMINATION = STS$K_ERROR;


MACRO $DAP$FILE_ERRS(OPER)[NAM,TXT]=
    NAM,
    (%NAME(DAP$K_MAC_,OPER) + %NAME(DAP$K_ERR_,NAM)),
    %NAME($DAP_,OPER),
    TXT %;

MACRO $DAP$ERROR[CODE,VALUE,SEVERITY,TEXT]=
    %ASSIGN(DAP$K_ERRTAB_LENGTH,%COUNT+1)
    %NAME(DAP$_,CODE) = (VALUE^3)+DAP$K_FACILITY_CODE+%NAME(STS$K_,SEVERITY) %;

MACRO $DAP$ERRORS=$DAP$ERROR(

$DAP$FILE_ERRS(SUCCESS,
NORMAL,  'Successful completion',
SUC,     'Successful completion'),

$DAP$FILE_ERRS(OPEN,
BUG,     'Internal RMS error',
BSZ,     'Invalid Byte size',
COD,     'Invalid COD field in XAB',
DAN,     'Data Area number invalid',
DEV,     'Structure not mounted, or bad device',
DIR,     'Error in directory name',
DNF,     'Directory not found',
DNR,     'Device not ready',
DTP,     'Invalid Datatype in Key XAB',
FEX,     'File already exists',
FLK,     'File locked by another user',
FLG,     'Invalid Flag bit combination',
FNF,     'File not Found',
FNM,     'Error in File Name',
FOP,     'Error in File Options',
FUL,     'Device/File Full',
IAN,     'Index Area number invalid',
KEY,     'Invalid Key for relative file',
KSZ,     'Invalid Key Size',
MRS,     'MRS=0 for fixed or relative file',
NMF,     'No More Files',
NPK,     'No primary key',
ORG,     'Invalid File organization',
PRV,     'Protection violation',
RAT,     'Illegal record attributes',
RFM,     'Illegal Record Format',
SHR,     'Invalid SHR field',
TYP,     'Error in file type',
GES,     'Version must be explicit or *',
WLK,     'Device is write-locked',
SYN,     'Filename syntax error',
CGJ,     'Can''t get JFN',
COF,     'Can''t open file',
DFL,     'Directory full',
RTD,     'Rename: two different devices',
RFX,     'Rename: new file name already in use',
SIZ,     'Invalid Key Size',
XAB,     'Invalid XAB (BID not XAB$K_BID)' ),

$DAP$FILE_ERRS(TRANSFER,
CUR,  'No Current Record',
DME,  'Dynamic Memory Exhausted',
DUP,  'Duplicate key detected',
EOF,  'End of File',
EXT,  'File Extend Error',
IOP,  'Invalid Operation for file organization',
KRF,  'Invalid key-of-reference',
MRN,  'MRN=neq or relative key greater than MRN',
NEF,  'Not positioned to EOF',
POS,  'POS field invalid',
RAC,  'Invalid Record Access',
RFA,  'Invalid RFA specified',
RBF,  'Invalid Record Buffer Address',
RER,  'File Read Error',
REX,  'Record already exists',
RLK,  'Target bucket locked by another stream',
RNF,  'Record not found',
RNL,  'Record not locked',
ROP,  'Invalid Record Options',
RSZ,  'Invalid Record Size',
RTB,  'Record too big for user''s buffer',
UBF,  'Invalid User Buffer Address',
USZ,  'Invalid user buffer size',
WER,  'File Write Error',
QEX,  'Disk quota exceeded',
LAE,  'Error reading file attributes',
LNP,  'Protection failure reading file name',
LAP,  'Protection failure reading file attributes',
XCL,  'File must be open for exclusive access'),

$DAP$FILE_ERRS(TERMINATION,
CRC,  'DAP file transfer CRC error'),

TFL,   DAP$K_MAC_TRANSFER+DAP$K_ERR_FUL, ERROR, 'Device or File Full',

AOR,   %O'770100',   FATAL,     'Argument out of range',
FTL,   %O'770010',   ERROR,     'Field Too Long',
SYNC,  %O'120000',   ERROR,     'Remote system sent message out of sync'
) %;

LITERAL $DAP$ERRORS;