Try this. It assembled cleanly using Assembler G:
MACRO
ACLEAR &L=,&A=VSAMWORK,&I=00
LCLC &AA
AIF (T'&L EQ 'O' OR T'&L NE 'N').AROUND NO VALID LENGTH?
AIF ('&L' GT '256').DOLIT WE NEED TO LOAD A LITERAL
LA R15,&L NUMBER OF BYTES TO CLEAR
AGO .CONTINU CONTINUE WITH MAINLINE CODE
.DOLIT ANOP
SR R15,R15 CLEAR LENGTH REGISTER
ICM R15,B'0011',=AL2(&L) GET LENGTH
AGO .CONTINU
.AROUND ANOP
&AA SETC 'L''' MAKE LENGTH ATTRIBUTE STRING
LA R15,&AA&A GET LENGTH OF FIELD
.CONTINU ANOP . LENGTH IS SET
LA R14,&A TARGET ADDRESS TO CLEAR
LR R0,R14 SOURCE ADDRESS TO CLEAR
SR R1,R1 SET SENDING FIELD LENGTH TO ZERO
IC R1,X'&I' SET PAD CHARACTER
MVCL R14,R0 INITIALIZE WORK AREA
* R0, R1, R14, AND R15 ARE NOW FUBAR
MEND
TESTMAC CSECT
USING *,R15 R15 ALREADY SET FROM CALLER
ACLEAR
ACLEAR L=20
ACLEAR L=500
VSAMWORK DS CL500
YREGS
LTORG , <= JUST TO BE KOSHER
*
END TESTMAC END ASSEMBLY, SUPPLY EP
-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]]
On Behalf Of Dan Skomsky @ Home
Sent: Saturday, August 04, 2012 9:11 AM
To: [email protected]
Subject: Re: Attributes Test In Macros
Where is WORKREC defined in the macro's prototype? By chance is it
specified by the &A parameter?
-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]]
On Behalf Of [email protected]
Sent: Saturday, August 04, 2012 8:54 AM
To: [email protected]
Subject: Attributes Test In Macros
I was looking for an easy way to test a Marci Variable on the Prototype
Statement. The Symbolic Variable coud be Numeric or Alphbetic.
Heres a quick macro I put together to expalin this:
MACRO
ACLEAR &L=256,&A=VSAMWORK,&I=00
LA R15,&L Number of Bytes to clera
LA R14,&A Target Address to clear
LR R0,R14 Sourece Address to clear
LA R1,X'&I' INITIALIZATION CHARACTER
MVCL R14,R0 Initialize Work Area
*
MEXIT
MEND
I would Like to Use ne Symbolic &L and be able to test It for a Nemeric
of Alpha value
If It Numeric I could generate
LA R15,&L
If its Alphabetic I could generate
LA R15,L'WORKREC
Obviously I could have defined two Symbolis one for Numeric and One for
Alpha. Looking at the TYPE Attributes for Macros I dont see A convient wayof
achieveing this. Maybe I dont understand all the Type Attributes.
Does any one have any suggestions as to use One Symbolic Parameter in a
Macro Prototype Statement and be able to generate a different Instruction
depending if the Value is Numeric Or Not.
Paul D'Anelo