I realize this thread has drifted quite a distance from Assembler as a
topic, but hoped to continue the thread until completed.
Naturally there was a snag using the C pre-processor with COBOL syntax.
One line of code in the first source module attempted was molested â just
one out of about 9000:
MOVE '??' TO QPE-SET-OPTS
Resulted in
MOVE ' TO QPE-SET-OPTS
In addition, the C preprocessor complained about virtually every line
processed because if wasnât C code. Very messy.
The HLASM option (my original thought) also looks messy because the source
has to be adjusted with PUNCH statements. I also was hoping for a macro
function, which the C preprocessor (although crude) worked for what I
needed.
Doing all of this in Rexx seems like reinventing the wheel if the PL/I
preprocessor will do the job. Unfortunately I have zero experience with
PL/I. (However, it is installed on my zPDT machine.)
Would a PL/I pro point me toward an example of using the PL/I preprocessor
only? Ideally the preprocessor output could be captured without invoking
the compiler phase.
The following C preprocessor code worked well for formatting code so that
it would work on either z/OS or VSE:
#ifdef _vse
#define SETA(var_ptr1, var_ptr2) \
CALL 'OBXBSETA' USING WK-PTR, \
var_ptr2 \
SET ADDRESS OF var_ptr1 TO WK-PTR
#else
#define SETA(var_ptr1, var_ptr2) \
SET ADDRESS OF var_ptr1 TO \
ADDRESS OF var_ptr2
#endif
The macro takes parameters, and depending on the environment generates
different code. In the COBOL code to be processed, this would appear:
SETA(WK-FIELD-1, WK-FIELD-2)
And this would be generated (if _vse was not defined):
SET ADDRESS OF WK-FIELD-1 TO
ADDRESS OF WK-FIELD-2
How would the equivalent PL/I preprocessor statements look like?
Which compiler and/or preprocessor options would work best?
Can the preprocessor output be captured to a file?
Thanks again for your suggestions and other references, especially if I
should pursue this on a different list.