From - Wed Oct 22 14:32:54 1997
Path: news.mitre.org!blanket.mitre.org!agate!newsgate.duke.edu!nntprelay.mathworks.com!howland.erols.net!cpk-news-hub1.bbnplanet.com!cpk-news-feed3.bbnplanet.com!news.bbnplanet.com!topgun.es.dupont.com!usenet
From: "Paul K.E. Walker" <cn3014@coastalnet.com>
Newsgroups: comp.os.vms
Subject: Re: Reading file size
Date: 22 Oct 1997 15:29:34 GMT
Organization: DuPont Experimental Station
Lines: 73
Message-ID: <01bcdf18$61aa6f60$14683434@walkerp1.kn.dupont.com>
References: <01bcde00$24067320$8c45c1c1@babel.bph.krakow.pl> <1997Oct21.063946.1@eisner> <01bcde1c$52b0cba0$8c45c1c1@babel.bph.krakow.pl> <1997Oct21.142803.1@eisner> <62kmil$mmk$1@info.cyf-kr.edu.pl>
NNTP-Posting-Host: walkerp1.kn.dupont.com
X-Newsreader: Microsoft Internet News 4.70.1155

Arkadiusz Sus <arek.sus@bph.krakow.pl> wrote in article
<62kmil$mmk$1@info.cyf-kr.edu.pl>...
> how, for the sake of God, should I access XABs?

Here is an example created just for you!  More information can be found in
the VMS Record Management Services Manual, order number AA-LA83A-TE.

Paul

          .TITLE    XAB_TEST
          .IDENT    /1.0/

; This program demonstrates basic usage of XABALL and XABDAT.  The system 
; services $PARSE and $SEARCH are used to initialize the XAB's.

;
; Data area
;
          .PSECT    DATA,WRT,NOEXE
MYFAB:    $FAB      XAB=MYXABALL,-                ;File access block
                    NAM=MYNAM,-                   ;...Name block address
                    FNM=<DSA9000:[000000]*.DIR;>,-;...File name string
                    FNS=22                        ;...File name string size
MYNAM:    $NAM      ESA=MYESA,-                   ;Name block
                    ESS=NAM$C_MAXRSS,-            ;...Extended string
length
                    RSA=RESULT,-                  ;...Storage for result 		
					  ;...string
                    RSS=NAM$C_MAXRSS              ;...Result string size
MYXABALL: $XABALL   NXT=MYXABDAT                  ;Allocation XAB
MYXABDAT: $XABDAT                                 ;Date and time XAB
RESULT:   .BLKB     NAM$C_MAXRSS                  ;Result string storage
MYESA:    .BLKB     NAM$C_MAXRSS                  ;Extended string storage

;
; Executable code
;
          .PSECT    CODE,NOWRT,EXE
          .ENTRY    XAB_TEST,^M<>

          $PARSE    FAB=MYFAB                     ;Parse our file 								 
;...specification
          BLBC      R0,P_ERROR                    ;Check for error

          $SEARCH   FAB=MYFAB                     ;Search for one file
match
          BLBC      R0,S_ERROR                    ;Check for error

          MOVAL     RESULT,MYFAB+FAB$L_FNA        ;Use first matched 						
	  ;...filename
          MOVB      MYNAM+NAM$B_RSL,MYFAB+FAB$B_FNS ;...And size

          $OPEN     FAB=MYFAB,                    ;Open performs a $DISPLAY
          BLBC      R0,P_ERROR                    ;Recycle parse error
check

;
; At this point, all FAB's, NAM's, and XAB's are initialized
;

          $CLOSE    FAB=MYFAB                     ;Close file
          RET

P_ERROR:  PUSHL     MYFAB+FAB$L_STV               ;Signal error using STS 	
						  ;...and STV
          PUSHL     MYFAB+FAB$L_STS
          CALLS     #2, G^LIB$SIGNAL

S_ERROR:  MOVL      #1,R0                         ;Disregard RMS-E-FNF
          RET

          .END      XAB_TEST

