Thanks for the hints folks suggested. It turns out that the PL/I
preprocessor does make this easy, via something like:
%Dcl Forn Char;
%if Uppercase(Dyn) = 'YES' %then %do ;
%Forn = ', fetchable';
%end;
%else %do;
%Forn = '';
%end;
Then you just include the Forn variable in the function prototypes, where it
appears as null or , fetchable.
I had some problems with this because I was using a preprocessor variable
named DYN and my test program was also DYN. That meant that the end dyn;
statement at the end of the program became end yes;, which the compiler
didnt much like. So yes, I used much longer variable names that nobody
should ever trip over!
While its a neat facility, I dont see any way to override it. If you think
of CLIST or CMS EXEC/EXEC 2, variables were indicated by an &. Rexx variable
use is more natural, but you can override it by quoting, and it doesnt
interpret keywords as variables. I tried, and end 'dyn'; does NOT
workPL/I doesnt like the quotes (plus you couldnt really quote every
keyword and still read the program).
This seem potentially nasty: if you set a variable named DECLARE, all your
DECLARE statements are now
something else. That feels like a huge security
issue: you %include some member and hilarity ensues (PL/I injection??). Or
just as a joke, back when we printed listings) defining SKIP as PAGE and
watching someone use a box of greenline for a short program...
My dad once told me that hed seen a PL/I program in South America somewhere
in which the language itself was Spanishthe keywords etc. So si for if
(not to be confused with yes!) and más hacer for else do, etc. Im now
suspecting this was done using the preprocessor.
I suppose its a bit late to APAR this.
(Thanks to a list-mate here whom I wont name, who did the real work on
thishes welcome to out himself if desired [yes I just indicated gender])
...phsiii
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN