× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




I've got a 32x1000 array that I want to overlay on a 82x3903 array.  (The
former is a collection of data from a DMPSYSOBJ, and the latter is a more
readable representation, since the entries in the dump are 82 bytes long.)

I'm not sure that I understand what you're trying to accomplish. Your first array is 32000 bytes long. The second array is 320046 bytes -- more than 10 times the size of the first one -- so I'm a bit confused. How do you want the array elements to overlap each other?

Regarding the 65535 limit -- that's ONLY a limit on character strings. When a data structure is given a name, then the entire data structure can be used with the string manipulation opcodes and BIFS, as if it's a character string, so it has the 65535 limit. However, when a data structure is "unnamed", it does not have the 65535 limit, since it can't be used with the string opcodes/bifs.

IIRC, an unnamed data structure can be as large as 16mb -- much larger than your 320k array.

This code is perfectly legal:

     D                 ds
     D  Array1                 1  32000a   dim(1000)
     D  Array2                 1 320046a   dim(3903)

But again, I'm not sure that I fully understood what you were looking for, since I don't understand how a construct like this would be useful to anyone. If everything you need is in the first 32000 bytes, why have such a large DIM on the second array?

*In addition to the above*, I also need to add an offset of 16 bytes to the
original array, since the first 16 bytes in the dump "throw off" the 82 byte
entries in the 82x3903 array.

Okay, with an offset, it would look like this:

     D                 ds
     D  Array1                 1  32000a   dim(1000)
     D  Array2                17 320062a   dim(3903)


Note that this is, currently, a quick & dirty, a one-timer type of thing, so
elegance is not called for.  I am somewhat perplexed by the inability to
overlay two arrays, so there's something I could learn that I would be able
to utilize in some future application.  Add to that the offset thingy; and
I'm thinking maybe this should be handled by a user space.

No idea what this has to do with user spaces. User spaces are basically an alternate way of allocating a "space" (raw memory) to store data in. Allocating the space isn't the problem at hand -- overlaying is.

If for some reason you don't like the data structure technique (which is the simplest technique) then you could use a basing pointer to achieve the same thing. You can do this with or without user spaces -- again, how the memory is allocated is immaterial, it's the ability to make both arrays view the same area of memory that's needed.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.