IBM's workaround for not having a macro functions is to declare a global
variable and set it. The classic example is IBM's SYSSTATE macro. While this is
not the best solution, it does work and it's only an extra line..Maybe a third
line if you want to save the value. Even though it's not a good solution and it
can be quickly implemented..

I find John McKown's request is a greater impact because of macro short comings
and the additional checks that must be made. What he wants is:
      MACRO ,
      MYDCB ,
&KEYWORDS SETC '&SYSLIST(1)'(2,K'&SYSLIST(1)-2)
      DCB      &KEYWORDS.,OPTCD=A
      MEND  ,
      MYDCB  (DDNAME=MYDD,EODAD=LBL1,EOEA=LBL2)

Since everything in &KEYWORD is passed to the DCB macro as a &SYSLIST(1), the
keywords are ignored. Instead, he must use AINSERT and split each of the lines
into 71 byte segments and format it with the correct continuation syntax.

If he didn't want to use AINSERT, then he would  need to have all 50 keywords
specified in his macro prototype and on the DCB call. In addition, he can't just
code null parms. Some of the parms in the DCB macro have values specified and he
would need to ensure those variables have the correct default value specified.



________________________________
From: John Gilmore <[email protected]>
To: [email protected]
Sent: Tue, November 20, 2012 4:56:35 PM
Subject: Re: Impossible - "generic" macro prototype

As you may remember, I have written a lot of these SETAF and SETCF
functions, some of them in PL/I, which does complex arithmetic
[incidental to table generation] easily.

What I had in mind was writing functions that do things for which no
HLASM bif is supplied but for which (I think) one should be available.

MOD is an obvious example.  I can, often do, write it out in
conditional-assembly statements.  I would like to be able to do this
just once and then be able to invoke it as a function.   (I know of
course that I can write an ARITHMOD macro definition.  I indeed have
one, but I cannot invoke it as a function, which would be much more
perspicuous.)


John Gilmore, Ashland, MA 01721 - USA

Reply via email to