Article 132863 of comp.os.vms:
Path: nntpd.lkg.dec.com!sousa.tay1.dec.com!pa.dec.com!decuac.dec.com!haven.umd.edu!ames!elroy.jpl.nasa.gov!usc!news.cerf.net!nntp-server.caltech.edu!SOL1.GPS.CALTECH.EDU!CARL
From: carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick)
Newsgroups: comp.os.vms
Subject: Re: Q: File-backed sections
Date: 30 Oct 1995 02:50:34 GMT
Organization: HST Wide Field/Planetary Camera
Lines: 52
Distribution: world
Message-ID: <471ehq$2n5@gap.cco.caltech.edu>
References: <46jcgr$3na@ping1.ping.be>,<46qnkf$h0h@nntpd.lkg.dec.com>
Reply-To: carl@SOL1.GPS.CALTECH.EDU
NNTP-Posting-Host: sol1.gps.caltech.edu

In article <46qnkf$h0h@nntpd.lkg.dec.com>, hoffman@xdelta.enet.dec.com (Stephen Hoffman) writes:
=
=In article <46jcgr$3na@ping1.ping.be>, Peter.Stuer@ping.be
=(Peter Stuer) writes:
=
=:Could anyone please send me some example code on how to create a
=:memory section that is backed by a user-file, not the page file ? I've
=:read the System Services manual over and over and have worked with
=:global section many times. I just don't understand how to convert the
=:FORTRAN example DEC prints in the manual because they omitted the
=:important part: the part where they get the channel of the file!
=
=  Once you've got the file created via a call to sys$open() or
=  sys$create() system (RMS) service call, and assuming you have
=  thought far enough ahead to set the FAB$M_UFO bit in the
=  FAB$L_FOP field in the open/create, you will receive the
=  channel number back via the FAB$L_STV cell.
=
=  (Once you figure out how to use RMS, you can _really_ baffle
=  mere mortals with talk of FAB, RAB, and the ubiquitous FOP. :-)

Here's an example in FORTRAN.  It assumes the file already exists:
	INTEGER*4 USROPN
	INTEGER*2 CHANNEL
	EXTERNAL USROPN
	COMMON /CHAN/ CHANNEL
	OPEN(UNIT=1,FILE='TEST.DAT',STATUS='OLD',USEROPEN=USROPN)
	TYPE 10, CHANNEL
10	FORMAT(' %X',Z4.4)
	END

	INTEGER*4 FUNCTION USROPN(FAB, RAB)
	INCLUDE '($RABDEF)'
	INCLUDE '($FABDEF)'
	RECORD /FABDEF/ FAB
	RECORD /RABDEF/ RAB
	INTEGER*4 SYS$OPEN
	INTEGER*2 CHANNEL
	COMMON /CHAN/ CHANNEL

	FAB.FAB$L_FOP = FAB.FAB$L_FOP .OR. FAB$M_UFO
	USROPN = SYS$OPEN(FAB)
	CHANNEL = FAB.FAB$L_STV
	END
--------------------------------------------------------------------------------
Carl J Lydick | INTERnet: CARL@SOL1.GPS.CALTECH.EDU | NSI/HEPnet: SOL1::CARL

Disclaimer:  Hey, I understand VAXen and VMS.  That's what I get paid for.  My
understanding of astronomy is purely at the amateur level (or below).  So
unless what I'm saying is directly related to VAX/VMS, don't hold me or my
organization responsible for it.  If it IS related to VAX/VMS, you can try to
hold me responsible for it, but my organization had nothing to do with it.


