Hi Dan. I believe you have run into a couple of glitches in the z390 assembler.
There is another issue with your WIF macro. The line: &LABEL LAY &S,-1(&A,&P) references variable symbol "&A" which is not defined. The HLASM Language Reference states: : Use the MEND statement to indicate the end of a macro : definition. It also provides an exit when it is processed : during macro expansion. It can appear only once within a macro : definition and must be the last statement in every macro : definition. That last sentence in the IBM doc snippet isn't strictly precise. To try to avoid too many complicating factors, I am intentionally avoiding the discussion of nested macro definitions. Historically, the IBM mainframe assemblers ignore everything following the MEND statement when processing a macro contained in a macro library. IBM has taken advantage of this when producing bilingual (assembler and, for example, PL/X) macros. A simple example of this is macro BPXYENFO. A part of making this work is having a method of telling the alternative language processor (the PL/X compiler in my example) to effectively ignore column one of all lines in the source stream. For PL/I this is the "MARGINS" compiler option: "The MARGINS option specifies which part of each compiler input record contains PL/I statements". When a macro definition is "in-line" with the source stream, the lines following the MEND statement are part of the "open code". Having worked on the development and support of several IBM mainframe assemblers, I can testify that processing source code compatibly is quite challenging; the language rules are not exactly "crisp" nor are they consistent :) But, it is what it is, and the history is long.
