× 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.



On 2024-08-15 1:17 p.m., Sam_L wrote:
Here's my take:

pgm0 is expecting and a two element array, a piece of contiguous memory that contains 4 7s 2 numbers. It receives a pointer to this memory.
...

The called program, pgm0, is only expecting 2 7s 2 numbers.

> Damtin DS
> D AMTA 1 14s 2 Dim(2)
> D AMTm2 1 7s 2
> D AMTd2 8 14s 2

It's only expecting 2 zoned(7:2) numbers. AMTA is zoned(7:2) DIM(2), AMTm2 is the same as AMTA(1), and AMTd2 is the same as AMTA(2).

So the whole thing is weird and indeed it's an accident waiting to happen. But the called program isn't accessing beyond the passed parameter for any of the callers even though one caller is passing 4 elements and one is passing 8 elements, so most of their extra elements would be ignored.

One free-form version of that data structure is:
dcl-ds amtin;
amta zoned(7:2) dim(2);
amtm2 zoned(7:2) pos(1);
amtd2 zoned(7:2) pos(8);
end-ds;

Another version is:
dcl-ds amtin;
amtm2 zoned(7:2);
amtd2 zoned(7:2);
amta zoned(7:2) dim(2) pos(1);
end-ds;


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.