Re: Refresh my memory: is there some sort of unstructured object that's cheap to create, and can automatically expand?
"Mark S. Waterbury" <[email protected]>
| Newsgroups | gmane.comp.lang.as400.mi |
|---|---|
| Message-ID | <003401c6058f$26490660$6401a8c0@oemcomputer> |
Hi, James:
Do you really need to create an object (e.g. *USRSPC) to store your data? In
OPM MI, you can easily declare a "space" in the program, e.g.:
DCL SPCPTR XPTR AUTO;
DCL SPC XDATA BAS(XPTR);
DCL DD INCR BIN( 4) AUTO BDRY(4) ;
. . .
MODASA XPTR, INCR; /* extend size of space ... */
And of course you can pass a space pointer that points into this space, just
as you might do with passing a pointer into the *USRSPC...
Or, perhaps you should consider using the ILE heap (which can also be used
by OPM programs)? e.g.:
CRTHS HEAPID, ?X;
ALCHSS ?HEAP, HEAPID, Y;
This approach lets you easily suballocate using ALCHSS, rather than having
to manage the space yourself (as you would with a *USRSPC). Also, at
end-of-job (or end of activation group), OS/400 cleans up and deletes the
heap automatically.
HTH,
Regards,
Mark S. Waterbury
----- Original Message -----
> From: "James H H Lampert" <[email protected]>
> To: <mi400-Zwy7GipZuJhWk0Htik3J/[email protected]>
> Sent: Friday, December 16, 2005 7:50 PM
> Subject: [MI400] Refresh my memory: is there some sort of unstructured
object that's cheap to create, and can automatically expand?
>
> I'm looking to stick something in QTEMP to accumulate a
> bunch of data, and pass it from OPM MI to ILE C, and I
> have this vague memory that there's some sort of object
> that would be perfect for the job. Something that would
> automatically expand as needed to fit the data, without
> any need to explicitly expand it, and that would be cheap
> to create. I'd only require FIFO access.
>
> Am I thinking of something legitimate that I'd forgotten
> the name of, and can't find? Or am I just going
> prematurely senile?
>
> --
> JHHL
>
_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.