So the actual solution to the ops's problem is to reuse the DCB which is very
easy. This is why I never saw a FREEPOOL in the products I worked on.
Named tokens are easy to use and allow you to retain an address. For the op,
here is the psuedo code because I can't remember the macro's and their
specifics.
token get,name='mytokenname'if not found storage obtain init storage
token put,name='mytokenname'end ifl r5,first 4 bytes in token areaopen
putclose
If you wanted to save the overhead, you could move the open into the if and
move close to your program exit which would reduce this to "put".
Don't forget to fix open return code check. RC=4 is a successful open.
Thanks Keith for explanation.
Jon.
On Thursday, July 11, 2019, 09:17:40 AM PDT, Keith Moe
<[email protected]> wrote:
If the same DCB is closed and reopened, the 24-bit buffers left behind from
the previous OPEN that were not FREEPOOLed will be reused. So if the same DCB
is closed and reopened, there is no storage lost (until the last CLOSE).
If the DCB is being refreshed each time (in a work area or the program is
getting loaded and deleted each time), then a FREEPOOL is necessary to prevent
the loss of storage. The original design in the 60s more or less assumed that
after CLOSE the program (TCB) would end which would free the storage or that
the DCB was going to be reopened, so overhead was reduced by not freeing the
buffers that might be reused.
When 31-bit buffers were implemented, they did not perpetuate this design.
Keith Moe
BMC Software
On Thursday, July 11, 2019, 7:45:15 AM PDT, Seymour J Metz <[email protected]>
wrote:
FREEPOOL has always been a requirement for a straight QSAM DCB; with a DCBE
you can make it automatic on CLOSE.
--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
________________________________________
From: IBM Mainframe Assembler List <[email protected]> on behalf
of Jon Perryman <[email protected]>
Sent: Thursday, July 11, 2019 12:17 AM
To: [email protected]
Subject: Re: Probably dumb assembler question
I agree with Mike that your storage leak may be somewhere else. When did
freepool become a requirement? I don't see anything in the code referencing a
buffer. If it is dynamically using a buffer pool, then the buffers should be
returned to the pool upon close and the next open should reuse that buffer.
You can easily find out if this code is the problem. Create a small program
using this code and loop 20,000 times. Be sure to link it rmode 24 in case DCB
has some sort of 3 byte adcon pointing back to the original DCB area.
You bypass close if open rc is not 0. Are you getting a non-zero rc that still
opens the dataset and bypassing the required close?
You mentioned "error". Does that mean you have an abend recovery routine?
Jon.
On Wednesday, July 10, 2019, 03:19:01 PM PDT, Phil Smith III
<[email protected]> wrote:
Charles Mills (and others) wrote about using FREEPOOL and/or RMODE31=BUFF. I
will dig into those.
.phsiii