Would using $CONTROL BOUNDS on the COBOL compile catch this?
"David T
Darnell" To: [log in to unmask]
<David.T.Darne cc:
[log in to unmask]> Subject: Re: [HP3000-L] IMAGE
Sent by:
"HP-3000
Systems
Discussion"
<HP3000-L@RAVE
N.UTC.EDU>
04/04/2002
10:46 AM
Please respond
to
David.T.Darnel
l
Joe,
Plenty of people have already indicated that what you get is extremely
unpredictable program behavior, due to overwriting of whatever data space
happens to be "to the right" of your buffer area. I've seen people get bit
on this when the dataset record length increases and the buffer definition
does not get changed accordingly. This can 'lurk' for a long time as that
occasional bug that can't be reproduced in captivity, or it could just
plain cause something obvious like an abort.
There are coding methods to help prevent this problem, such as defining the
dataset structure once and only once in an $include or copylib. In FORTRAN,
you can also code a test for this by combining the proper Image calls
(dbinfo, etc.) with the LEN function ("LEN(IMAGEBUFFER)"). That is, code to
determine the number of bytes to be returned and compare it to the actual
buffer length.
FORTRAN has a number of functions or intrinsics that will yield information
about variables (metadata ?) - and it can be worth the extra resources
required to have a program test it's own assumptions.
-dtd
Joe Amuquandoh <[log in to unmask]>@RAVEN.UTC.EDU> on
04/03/2002 03:45:04 PM
Please respond to Joe Amuquandoh <[log in to unmask]>
Sent by: HP-3000 Systems Discussion <[log in to unmask]>
To: [log in to unmask]
cc:
Subject: [HP3000-L] IMAGE
Hello all,
In IMAGE DBGET, what happens if the LIST of ITEMS is longer than the BUFFER
being put into.
Besides the obvious truncation, is there any impact?
Thanks.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|