From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,8470bf03d8d250d3 X-Google-Attributes: gid1164f8,public From: "Steve Lionel" Subject: Re: VMS FORTRAN LUN to channel mapping Date: 1998/12/21 Message-ID: <75lqh3$fjl@usenet.pa.dec.com>#1/1 X-Deja-AN: 424522381 References: <75eou2$qif$1@nnrp1.dejanews.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 Organization: Compaq Computer Corporation - Nashua, NH X-MSMail-Priority: Normal Newsgroups: comp.sys.dec wrote in message news:75eou2$qif$1@nnrp1.dejanews.com... >I have quite a pile of RSX FORTRAN undergoing conversion to >Alpha OpenVMS. Much of it is subroutines which accept a >Fortran LUN as a parameter, then do a QIO to the associated >LUN. > >This worked great under RSX, but under VMS an HLL LUN is not >the same thing as a channel, and QIOs are done to channels. > >Does anyone know how to peek into the Fortran OTS LUN to >channel mapping mechanism to get this information? You couldn't use it even if you got it - the channel is owned by RMS in exec mode. The way to do what you want is to set the FAB$V_UFO bit in the FAB before the OPEN is done (you can do this in a USEROPEN routine) and then the channel number will be in FAB$W_STV after the OPEN completes. You can get a pointer to the FAB by calling FOR$RAB and following RAB$L_FAB. Here's an off-the-cuff example: EXTERNAL UOPN OPEN (UNIT=1,FILE='file.dat',STATUS='OLD',USEROPEN=UOPN) ... INTEGER*4 FUNCTION UOPN (FAB,RAB,LUN) INCLUDE '($FABDEF)' INCLUDE '($RABDEF)' INCLUDE '($SYSSRVNAM)' RECORD /FABDEF/ FAB RECORD /RABDEF/ RAB INTEGER*4 LUN FAB.FAB$L_FOP = FAB.FAB$L_FOP .OR. FAB$M_UFO UOPN = SYS$OPEN (FAB) RETURN END ! Routine to return channel number for a UFO'd LUN INTEGER*2 FUNCTION GETCHAN (LUN) INCLUDE '($FABDEF)' INCLUDE '($RABDEF)' RECORD /FABDEF/ FAB RECORD /RABDEF/ RAB POINTER (P_FAB, FAB) POINTER (P_RAB, RAB) INTEGER*4 FOR$RAB, LUN P_RAB = FOR$RAB (LUN) IF (P_RAB .EQ. 0) THEN GETCHAN = -1 ! No channel available RETURN END IF P_FAB = RAB.RAB$L_FAB GETCHAN = FAB.FAB$W_STV RETURN END Now... do you REALLY need to do this? What kind of "file" are you doing QIOs to and what kind of QIOs? Steve Lionel mailto:Steve.Lionel@digital.com DIGITAL Fortran Development http://www.digital.com/info/slionel.html Compaq Computer Corporation 110 Spit Brook Road, ZKO2-3/N30 Nashua, NH 03062-2698 "Free advice is worth every cent" DIGITAL Fortran web site: http://www.digital.com/fortran