Download Guide to OpenVMS File Applications
Transcript
Run-Time Options 9.4 Run-Time Example Example 9–2 (Cont.) Using the FDL$PARSE and FDL$RELEASE Routines F_ERROR: R_ERROR: BRW BRW GET_REC: $GET CMPL BEQLU BLBC MOVZWL PUSHAL CALLS BLBC BRB CLEAN: FAB_ERROR RAB_ERROR ; RAB=(R9) ; Get a record #RMS$_EOF,R0 ; If not end of file, CLEAN ; continue R0,R_ERROR RAB$W_RSZ(R9),REC_RESULT ; Move a record into REC_RESULT ; the buffer #1,G^LIB$PUT_OUTPUT ; Display the record R0,ERROR GET_REC ; Get another record ; $CLOSE FAB=(R10) ; Close the FAB BLBC R0,FAB_ERROR PUSHAL MY_RAB ; Push RAB address on stack PUSHAL MY_FAB ; Push FAB address on stack CALLS #2,G^FDL$RELEASE ; Release the control blocks BLBC R0,ERROR BRB FINI ; Successful completion ; FAB_ERROR: ERROR: PUSHL PUSHL BRB FAB$L_STV(R10) FAB$L_STS(R10) RMS_ERR PUSHL CALLS $CLOSE BRW R0 #1,G^LIB$SIGNAL FAB=(R10) FINI PUSHL PUSHL RAB$L_STV(R9) RAB$L_STS(R9) ; Signal file error ; ; Signal error ; End program ; RAB_ERROR: ; Signal record error ; RMS_ERR: CALLS #2,G^LIB$SIGNAL ; FINI: RET .END FDLEXAM Run-Time Options 9–23