> Is there a way to know the real value of the LEN below when
> I use a variable instead of a value?
>
>      MACRO
> &LABEL WORK &LEN=0
> &LABEL DS XL(&LEN)
>      MNOTE *,.LEN=&LEN.
>      MEND

If you have a recent maintenance level of HLASM, including APAR
PH34116 from February 2021, you can use SETA to obtain the value
of an equated symbol which has been defined and resolved.  (Some
parameter cases did not work and required a further fix for APAR
PH50923).

So in this case, if you know that &LEN contains a single symbol
which has been defined and resolved before the macro is invoked,
you can simply use something like:

&N      SETA  &LEN

If it contains a more complex expression, you can use EQU to
create a dummy variable equal to the expression and then use
that in a SETA expression, provided it has been resolved.

It is possible to test whether a symbol is defined using the
defined attribute D'&LEN but unfortunately it is not currently
possible to test whether it has been resolved (which may not be
the case if the EQU expression contains forward references), so
I do not think it is possible to write code which will assemble
without error but which will only conditionally extract the
value if it has already been resolved.

Jonathan Scott, HLASM
IBM Hursley, UK

Reply via email to