I added: UNSPLIT3 &Name &PARMS
After UNSPLIT2, it still comes thru as a SYSLIST value. Robert Ngan DXC Luxoft -----Original Message----- From: IBM Mainframe Assembler List <[email protected]> On Behalf Of Abe Kornelis Sent: Thursday, September 30, 2021 00:51 To: [email protected] Subject: Re: How can I invoke an arbitrary macro with arbitrary KEYWORD parameters? Robert, IIRC (I hope so) I got it to work with all parms concatenated into a single variable. You might give it a try ... Success! Abe === Op 30/09/2021 om 01:10 schreef Ngan, Robert (DXC Luxoft): > I’m trying to invoke a macro specifying keyword parameters within another > macro, where the keyword and its value were passed to the outer macro. > However, the assembler is always interpreting keyword=value as a SYSLIST > value. > Anyone know how this can be done, or even if it is possible? > The code below shows what I’m trying to do, the “Invoked”d macros never > receive keyword operand values. > > CallMAC TITLE 'Test macro invocations' > MACRO > Invoke &Name,&PARMS > .********************************************************************** > .* Invoke passed macro, with the passed parameters * > .********************************************************************** > AIF (T'&PARMS(1) EQ 'O').AAm110 > &J SETA INDEX('&PARMS(1)','=') > &lValue1 SETC '&PARMS(1)'(1,&J-1) > &rValue1 SETC '&PARMS(1)'(&J+1,*) > .AAm110 ANOP , > .*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * > AIF (T'&PARMS(2) EQ 'O').AAm120 > &J SETA INDEX('&PARMS(2)','=') > &lValue2 SETC '&PARMS(2)'(1,&J-1) > &rValue2 SETC '&PARMS(2)'(&J+1,*) > .AAm120 ANOP , > .*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * > AIF ('&PARMS(2)' NE '').AAm220 > AIF ('&PARMS(1)' NE '').AAm210 > UNSPLIT0 &Name , > AGO .AAm300 > .AAm210 ANOP , > UNSPLIT1 &Name &PARMS(1) > AGO .AAm300 > .AAm220 ANOP , > UNSPLIT2 &Name &PARMS(1),&PARMS(2) > .*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > * > .AAm300 ANOP , > AIF ('&PARMS(2)' NE '').AAm320 > AIF ('&PARMS(1)' NE '').AAm310 > SPLIT0 &Name , > AGO .AAm999 > .AAm310 ANOP , > SPLIT1 &Name &lValue1=&rValue1 > SPLIT1A &Name &lValue1.=&rValue1 > AGO .AAm999 > .AAm320 ANOP , > SPLIT2 &Name &lValue1=&rValue1,&lValue2=&rValue2 > SPLIT2A &Name &lValue1.=&rValue1,&lValue2.=&rValue2 > .AAm999 ANOP , > MEND , -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > MACRO > &Label TestMac1 &T1O1= > .********************************************************************** > .* Macro expecting single parameter * > .********************************************************************** > &P SETA N'&SYSLIST > MNOTE *,'TestMac1 &Label #Parms=&P' > &I SETA 1 > .BBm010 ANOP , > AIF (&I GT &P).BBm020 > MNOTE *,' SYSLIST(&I) = /&SYSLIST(&I)/' > &I SETA &I+1 > AGO .BBm010 > .BBm020 ANOP , > MNOTE *,' T1O1=/&T1O1/' > MEND , -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > MACRO > &Label TestMac2 &T2O1=,&T2O2= > .********************************************************************** > .* Macro expecting two parameters * > .********************************************************************** > &P SETA N'&SYSLIST > MNOTE *,'TestMac2 &Label #Parms=&P' > &I SETA 1 > .CCm010 ANOP , > AIF (&I GT &P).CCm020 > MNOTE *,' SYSLIST(&I) = /&SYSLIST(&I)/' > &I SETA &I+1 > AGO .CCm010 > .CCm020 ANOP , > MNOTE *,' T2O1=/&T2O1/,T2O2=/&T2O2/' > MEND , -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* > EJECT > PRINT MCALL > TestMac1 , > TestMac1 T1O1=aaa > TestMac2 T2O1=bbb,T2O2=ccc > *********************************************************************** > Invoke TestMac1 > *- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -* > Invoke TestMac1,(T1O1=zzz) > *- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -* > Invoke TestMac2,(T2O1=yyy,T2O2=xxx) > END > > Thanks, > Robert Ngan > DXC Luxsoft > > >
