Ref:  Your note of Thu, 3 Nov 2022 17:23:02 -0600

If you want a single ampersand in a SETC expression, you can
easily use '&&'(1,1) to pick it out.  If you want a way to
code a single ampersand in conditional assembly, you can
define the variable &AMP as follows:

&AMP     SETC  '&&'(1,1)

The rule that ampersand remains doubled means that a double
ampersand coded in a character string in a SETC expression or
macro parameter will give a single ampersand when substituted
into an assembler character expression.  As there is no current
syntactic meaning for an ampersand outside a character constant
at assembly time (only during conditional assembly, where it is
used to denote variables) any deliberate occurrence of an
ampersand is likely to be within such a character string.

This rule does not apply to single quotes, which are more likely
to be used in the context of generating entire operands within
quotes.

The DOUBLE function expects its input data to be the actual
character data to be represented.  This is admittedly different
from the SETC constant convention, where ampersands are already
doubled ready to be substituted, and quotes are typically added
explicitly as required.

So it's not consistent between quotes and ampersands, but
neither is typical usage, and the rules reflect that.

Jonathan Scott, HLASM
IBM Hursley, UK

Reply via email to