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



Mike Silvers wrote:
Hans,

I am trying to make this sort of dynamic :)  I am trying the following:

D size            S              5P 0
 *
 * Load the DS
 *
C                   Eval      size = %Size(Structure)* 3
C                   Eval      StructurePoint = %Alloc(size)

The number 3 will be softcoded in the program, but I am getting a numeric
error when allocating the size.  (The error is The target for a numeric
operation is too small to hold the result).  I don't understand why I am
getting the error.  If I hard code the size as the number 60, there are no
problems and everything works well.

Well, I'm not sure why you're getting the abend.  (You're probably
just missing a PTF.)  But a decimal numeric variable isn't really
the best choice for this type of thing.  Change the definition of
"size" to 10I0, and see what happens.  Integer and unsigned numeric
types are always better for numeric values with zero decimal places.

Alternatively, if you don't need variable "size" for any other
purpose, just code: "eval sp = %alloc(%size(Structure)*3);".

Cheers!  Hans





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.