HP3000-L Archives

April 1996, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Sun, 14 Apr 1996 18:05:14 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (29 lines)
Mark writes:
> Is there an example of how to do mapped file access in COBOL
> floating around on the net somewhere? I'd like to play around with
> it.
 
Since nobody's given the short answer yet, I'll throw it in:
 
In general, you *can't* do mapped access from COBOL.  Mapped access is
specifically access to a file via a pointer returned by HPFOPEN.  Since
COBOL (fortunately) has no support for pointers, you can open a file from
COBOL, but (as the examples presented point out) you have to use routines
written in a language that supports pointers to actually access the data.
 
So you are really doing mapped access from C/SPLash!/Pascal, etc. rather
than COBOL.  If you have COBOL applications that must access data mapped,
then this is the way to do it.  If you just want to experiment with mapped
file access, this is a fairly lousy way to do it.
 
Mapped access is rarely (if ever) faster or better than Intrinsic level
file access via FREAD/FREADDIR/FWRITE, etc. (especially if you have to jump
through hoops like external routines written in another language), and using it
can cause other annoying problems (such as making your application incompatible
with some third party tools) so I'm afraid I have to ask that very obnoxious
question:
 
Why do you want to do this? :-)
 
G.

ATOM RSS1 RSS2