I hope someone can help me; I have a macro assembler question.
Suppose I write a macro MYMAC receiving two positional parameters:
&TAG MYMAC &DATE1,&DATE2
The macro will do some date arithmetic. If I invoke the macro this way:
MYMAC (2023,7,31),(2024,1,15) two dates (year,month,day)
then IIUC, &DATE1 and &DATE2 are both sublists. I therefore have no trouble
coding SETA statements so that I can reference the year, month, and day values
individually.
Now suppose I wish to modify the macro parameter syntax by requiring an equals
sign in front of one of the dates (because I need to handle certain dates
differently). E.g.:
MYMAC (2023,7,31),(=,2024,1,15)
Again, this is simple: I can check for the equals sign and extract the numeric
values from the appropriate positions in each sublist.
However... suppose I want to allow this syntax:
MYMAC (2023,7,31),=(2024,1,15)
in which the equals sign precedes a date, but is *outside* of the parentheses.
Now IIUC, &DATE2 is no longer a sublist. This instruction:
&YMD2 SETC '&DATE2'(2,*)
sets &YMD2 to the string (2024,1,15) which *looks* like a sublist, but of
course it’s not. Maybe I'm on the wrong track. Bottom line: in my last example,
I can’t figure out how to extract the year, month, and day values from &DATE2
so that I can reference them separately.
I apologize if this is basic stuff... I would really appreciate the help!
Thanks,
David