On 7 March 2011 18:12, Mike Lude <[email protected]> wrote:
> I'm using an IBM-supplied macro that contains something similar to
>
> CODE  EQU C'ABCD'
>
> I have a value returned by a system service and I want to see if it matches 
> CODE, something like
>
> CLC MYSTRING,=C(CODE)
>
> Of course, this is invalid. I can't figure out how to use this equate. 
> Anybody have an idea?

Typically you would use

CLC   MYSTRING,=A(CODE)

but this is a bit doubtful... It tempts the beginner into thinking that

WRONG  EQU  C'ABCDE'
CLC   MYSTRING,=A(WRONG)

might work, and it won't.

In many cases it makes more sense to use a macro-time variable
("variable symbol") for this sort of thing:

&CODE   SETC   'ABCDE'
CLC   MYSTRING,=C'&CODE'

This is not always a good thing; in some ways it clutters the listing,
and can lead to other problems, but in this case it does avoid the
rather artificial A(CODE) construct for a character string.

Tony H.

Reply via email to