Sorry but I didn't read your full Email but it dawned on me you might have added
more afterwords. It would have been easier to see a sample of what you thought
should have worked.

For some reason, dynamic variable names cannot reference variables passed on the
macro call. In the following, D1 fails but D2 works.

         MACRO
         JUNK   &P1=AAA
&P2      SETC  'BBB'
&D1      SETC  '&(P1)'
&D2      SETC  '&(P2)'
     MNOTE 8,'D1=&D1 D2=&D2'
         MEND
         junk ,

Regards, Jon




________________________________
From: Jon Perryman <jperr...@pacbell.net>
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Sent: Sun, April 1, 2012 11:24:33 AM
Subject: Re: Macro compound symbols

You didn't set or define variable P1. Message  ASMA300E tells you that variable
P1 is not set (notice the TESTM/P1)

Regards, Jon.



________________________________
From: "Hardee, Chuck" <chuck.har...@thermofisher.com>
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Sent: Sun, April 1, 2012 10:07:23 AM
Subject: Macro compound symbols

Hello,

Thru the IBM Mainframe list I have been able to get the assembler to accept the
following as valid:

&VARNAM SETC  'P'.'&I'
&XVAL   SETC  '&(&VARNAM)'

&XVAL is defined as LCLC

This statement:
        MNOTE 'VARNAM=&VARNAM'
results in the following in the assembly listing:
        +VARNAM=P1
so it appears that the creation of the compound variable name is working
(compound being defined as the building of a variable name using two or more
parts at runtime.)

However, this statement:
&XVAL   SETC  '&(&VARNAM)'
results in the following in the assembly listing:
** ASMA003E Undeclared variable symbol; default=0, null, or type=U - TESTM/P1
** ASMA435I Record 44 in S01CH.MISC.MACLIB(TESTMAC) on volume: TECH27
(and I might add that I get the same warning for the remaining variables, P2,
P3, P4 P5 and P6)

Which makes no sense since the macro is defined:
        MACRO
&LABEL  TESTMAC &P1=,&P2=,&P3=,&P4=,&P5=,&P6=

Which, unless I've missed something, defines P1, P2, etc.

Can anyone shed some light on why the assembler would think that the variables
P1 thru P6 would be thought of as not defined when they are clearly defined in
the MACRO template?

Thanks,
Chuck

Charles (Chuck) Hardee
Senior Systems Engineer
Database Administration
Information Technology Services
Thermo Fisher Scientific
chuck.har...@thermofisher.com

Reply via email to