From:	CSBVAX::MRGATE!RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP 30-OCT-1988 03:54
To:	ARISIA::EVERHART
Subj:	RE: Re: delete file by FID?


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Sun, 30 OCT 88 00:02:25 PDT
Received: from CUNYVM.CUNY.EDU by KL.SRI.COM with TCP; Sun, 30 Oct 88 00:00:24 PDT
Received: from UALR.BITNET by CUNYVM.CUNY.EDU (IBM VM SMTP R1.1) with BSMTP id 1077; Sun, 30 Oct 88 02:59:56 EDT
Date: Sat, 29 Oct 88 18:51 CDT
From: Dale Miller <DOMILLER%UALR.BITNET@CUNYVM.CUNY.EDU>
Subject: RE: Re: delete file by FID?
To: INFO-VAX@KL.SRI.COM
X-VMS-To: IN%"INFO-VAX@KL.SRI.COM"

Date sent:  29-OCT-1988 18:47:30

In article <8810221921.AA07512@mcvax.cwi.nl> _or_
 <mcvax!svax05.pcr.co.uk!williams_b@uunet.UU.NET> writes:
>
>
>Does anyone have a chunk of rms code (pref fortran) that opens a file
>by its FID? I can't seem to get it to work. I have a disk with a lost file
>that ANAL/DISK cannot repair, so I'd like to delete the thing by its
>file id. Any suggestions are welcome.
>
>Thanks,
>Brian.

Would you settle for MACRO?  The following code is probably not minimal, but
it will delete the file specified.
****************************** cut here ***********************************
        .TITLE  FID
        .PSECT  DATA LONG
        .ALIGN  LONG

INFAB:  $FAB    FOP=<NAM,DLT>-          ; Specify open by NAM
                NAM = NAMBLK            ; Point to NAM block

INRAB:  $RAB    FAB=INFAB

NAMBLK: $NAM                            ; Generate NAME BLOCK

; Store File ID of file to open

FID:    .WORD   6659                    ; File Number
        .WORD   28                      ; File Sequence Number
        .WORD   0                       ; Relative Volume Number

; Device Name that file resides on

DVI:    .ASCIC  /_OMEGA$DUA8/           ; (Underscore is necessary)

; Create Macro To Handle Error Checking

        .MACRO  ON_ERR ?DEST
        BLBS    R0,DEST
        JMP     PROBLEM
DEST:
        .ENDM   ON_ERR


        .PSECT  CODE
        .ENTRY  START,^M<>              ; Beginning of Main Program

; Write to NAME BLOCK at run time

STORIT: $NAM_STORE      NAM= NAMBLK,-   ; Identify Structure
                        FID = FID,-     ; Store File ID
                        DVI= DVI        ; Store Device Name

        $OPEN   FAB=INFAB               ; Open INFILE.DAT
        ON_ERR                          ; Error Check
        $CONNECT RAB=INRAB              ; Connect Record Stream
        ON_ERR                          ; Error Check
        $DISCONNECT RAB=INRAB           ; Disconnect Record Stream
        ON_ERR                          ; Error Check
        $CLOSE  FAB=INFAB               ; Close File (INPUT)
        ON_ERR                          ; Error Check
        $EXIT_S

PROBLEM:
        $EXIT_S R0
        .END    START                   ; End of Main Program

--------------------------------------------------------------------------
| Dale O. Miller                        | #   #  ###  #     ####         |
| University of Arkansas at Little Rock | #   # #   # #     #   #        |
| 2801 S. University                    | #   # ##### #     ####         |
| Little Rock, AR  72204-1099  USA      | #   # #   # #     #  #         |
| (501)569-8714                         |  ###  #   # ##### #   #        |
| DOMILLER@UALR.BITNET                  | Disclaimer: This does not      |
| 92-20-28 W,34-43-30 N.ICBMNET         | say what I say it doesn't say. |
--------------------------------------------------------------------------

