.TITLE FSY_OPNBDF ; @(#)fsyvmsd.mar 17.1.1.1 (ESO-IPG) 01/25/02 17:36:21 ;++ ; OPNBDF - Open Bulk Data File ; ; This routine is used to open an EXISTING Bulk Data File for ; subsequent processing. The filename, logical or physical, is ; supplied by the calling program and the file is opened by RMS ; using the User File Open option. This restricts the access to ; the file (on the assigned channel) to the QIO and file-mapping ; system services; no RMS routines can be used. However, the ; file can still be accessed on another channel for RMS process- ; -ing, (see FSY_EXTBDF), as it is opened for file sharing. ; ; The file will be opened for read/only access if the protection ; does not allow read/write operations to be performed. ; ; If the bulk data file is opened successfully, the I/O channel ; number, FILES-11 file identification and device name string are ; returned to the calling program. These can be used subsequently ; to re-open the file, using the RMS NAM block, for any ancillary ; processing that may be required. ; ; +++ ; This is the version of MID_OPNBDF for C modules, ; so character strings are handled more directly. ; +++ ; use as FSY_OPNBDF(NAME,LEN,IOCHAN,FILEIDA,FILEIDB,DEVICE,STATUS) ; ; Input argument: ; --------------- ; NAME: CHARACTER expression: Name of Bulk Data File. ; LEN: I*4 Length of NAME ; ; Output arguments: ; ----------------- ; IOCHAN: INTEGER variable: I/O channel assigned to file. ; FILEIDA: INTEGER variable: FILES-11 File Identification (part A) ; FILEIDB: INTEGER variable: FILES-11 File Identification (part B) ; DEVICE: CHARACTER variable: Device Identification (20 chars) ; STATUS: INTEGER variable: Status return. ; ; ; K. Banse version 1.00 851120 ; K. Banse version 1.10 910917 ; K. Banse version 1.30 980616, W_FID is 6 bytes! ;-- $RMSDEF BDFFAB: $FAB FOP=, - SHR=, - FAC=, - NAM=BDFNAM BDFFABR: $FAB FOP=, - SHR=, - FAC=, - NAM=BDFNAM BDFNAM: $NAM FSY_OPNBDF:: .WORD ^M<> MOVL 04(AP),BDFFAB+FAB$L_FNA ;addr of NAME string MOVB 08(AP),BDFFAB+FAB$B_FNS ;size of NAME string $OPEN FAB=BDFFAB ;attempt to open file BLBC R0,50$ ;try to open with read only... MOVL BDFFAB+FAB$L_STV,@12(AP) ;return IOCHAN MOVL BDFNAM+NAM$W_FID,@16(AP) ;return FILEIDA MOVW BDFNAM+NAM$W_FID+4,@20(AP) ;return FILEIDB MOVAL BDFNAM+NAM$T_DVI,R0 ;move to DEVICE string MOVL 24(AP),R1 MOVL (R0),(R1) ADDL2 I^#4,R0 ADDL2 I^#4,R1 MOVL (R0),(R1) ADDL2 I^#4,R0 ADDL2 I^#4,R1 MOVL (R0),(R1) ADDL2 I^#4,R0 ADDL2 I^#4,R1 MOVL (R0),(R1) 20$: MOVL BDFFAB+FAB$L_STS,@28(AP) ;return STATUS RET 50$: MOVL 04(AP),BDFFABR+FAB$L_FNA ;addr of NAME string MOVB 08(AP),BDFFABR+FAB$B_FNS ;size of NAME string $OPEN FAB=BDFFABR ;attempt to open file BLBC R0,60$ ;abort if open failed MOVL BDFFABR+FAB$L_STV,@12(AP) ;return IOCHAN MOVL BDFNAM+NAM$W_FID,@16(AP) ;return FILEIDA MOVW BDFNAM+NAM$W_FID+4,@20(AP) ;return FILEIDB MOVAL BDFNAM+NAM$T_DVI,R0 ;move to DEVICE string MOVL 24(AP),R1 MOVL (R0),(R1) ADDL2 I^#4,R0 ADDL2 I^#4,R1 MOVL (R0),(R1) ADDL2 I^#4,R0 ADDL2 I^#4,R1 MOVL (R0),(R1) ADDL2 I^#4,R0 ADDL2 I^#4,R1 MOVL (R0),(R1) 60$: MOVL BDFFABR+FAB$L_STS,@28(AP) ;return STATUS RET .END .TITLE FSY_OPNFIL