I'll preface this by saying that I haven't coded C/C++ in almost a decade, and via JCL even longer, but if the SYSOPTF can be a concatenation (I don't know, and don't have source sitting around to test with) could you do something like the following:
//SYSOPTF DD DISP=SHR,DSN=USER.COPTS(MAINOPTS) // DD DISP=SHR,DSN=USER.COPTS(ARCH&AVER.) And have a // SET AVER=9 at the start of job, put the steps for the compiles that require ARCH(5) at the bottom with a SET AVER=5 before them and member ARCH9 contains ARCH(9) and member ARCH5 contains ARCH(5) ============================================== Wayne Driscoll OMEGAMON DB2 L3 Support/Development wdrisco(at)us(dot)ibm(dot)com All opinions are mine, and do not represent IBM Corporation. ============================================== IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> wrote on 11/26/2015 10:32:08 PM: > From: Charles Mills <charl...@mcn.org> > To: IBM-MAIN@LISTSERV.UA.EDU > Date: 11/26/2015 10:32 PM > Subject: Re: [IBM-MAIN] Any clever way to defeat the C compiler's > options precedence? > Sent by: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> > > Yes. Very much like what I do. But it is the framework of the problem, not > the solution. Here is the problem: > > I want to compile the bulk of my modules by default ARCH(9) (changeable from > time to time) but two of them ARCH(5). Should be simple enough, right? (Why? > See related thread. I want to deal gracefully with a machine whose ARCH > level is lower than my build level. I want my main and the "deal with it" > module to be able to run without a S0C1 on any "z" machine.) > > - You can't do the obvious: put ARCH(9) in OPTF and #pragma options ( > ARCH(5) ) in the two because PARM=/OPTF overrides #pragma options -- the > main subject of this thread. > - I thought I was going to solve it by putting #pragma options ( ARCH (9) ) > in a "universal" header and #ifdef around it in the two modules, ... BUT > - #pragma OPTIONS is C only and my code is 98% C++. I could make one of the > two C and split the other one up so part of it was C, but that still leaves > me with no way of specifying ARCH(9) for the bulk of the modules. > - Wait! IBM thoughtfully provided #pragma option_override! It overrides what > was specified on PARM=/OPTF. It's C and C++. Sounds perfect, right? But no > ... it only supports the optimization options, and ARCH is in this > compiler's world not an optimization option -- only compact, level, spill > and strict. > - I am about convinced I can't get there from here. Does my problem seem > that unreasonable? > > Charles > > -----Original Message----- > From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On > Behalf Of David Crayford > Sent: Thursday, November 26, 2015 5:27 PM > To: IBM-MAIN@LISTSERV.UA.EDU > Subject: Re: Any clever way to defeat the C compiler's options precedence? > > Isn't this a bit of a no-brainer just using JCL? > > //CPROC PROC M=,PARMS= > //COMPILE EXEC PGM=CCNDRVR,REGION=0M, > // PARM=('EXPORTALL OPTF LOC(EN_US.IBM-037) &PARMS') > //SYSMSGS DD DUMMY > //USERLIB DD DISP=SHR,DSN=DOC.USER.H > // DD DISP=SHR,DSN=COM110.WDOC.H > // DD DISP=SHR,DSN=COM110.DEVT.H > //SYSOPTF DD * > ARCH(9) > RENT,SS,NOSEQ,NOMARG,STA,LO, > SE(*),LSE(*),GOFF,SO,LIST,LANG(EXTC99) > DEF(_XOPEN_SOURCE_EXTENDED) > //SYSIN DD DISP=SHR,DSN=COM110.DEVT.C(&M) > //SYSLIN DD DISP=SHR,DSN=COM110.WDOC.COBJECT(&M) > //SYSPRINT DD SYSOUT=* > //SYSOUT DD SYSOUT=* > //SYSCPRT DD SYSOUT=* > //* > // PEND > //* > //COMCISPF EXEC CPROC,M=COMCISPF,PARMS='ARCH(5)' > //COMDLL EXEC CPROC,M=COMDLL > //COMDLLI EXEC CPROC,M=COMDLLI > //COMDLLS EXEC CPROC,M=COMDLLS > //COMDSN EXEC CPROC,M=COMDSN > //COMHMAP EXEC CPROC,M=COMHMAP > > > On 26/11/2015 3:24 AM, Charles Mills wrote: > > The C/C++ compiler lets you set options globally with PARM= or > > DD:OPTFILE (or equivalently on a UNIX command line for those who like > > that sort of thing). You can also specify most options *first thing* > > in a source module with #pragma OPTIONS. > > > > The former overrides the latter. It seems to me that is backwards. I > > want to compile all of my modules with OPTION FOO, except one module > > that I want to compile with OPTION NOFOO. I would like to specify > > PARM=FOO globally and specify #pragma OPTIONS ( NOFOO ) in the one > > module. Doesn't that sound reasonable? > > > > Am I RTFM incorrectly? Or has anyone figured out a bit of cleverness > > to have global "default" options that one can override on a source > > module by source module basis. (I have common JCL that I use > > "universally." I have hundreds of source modules. I don't have > > hundreds of "compile jobs.") > > > > Thanks, > > > > Charles > > > > ---------------------------------------------------------------------- > > For IBM-MAIN subscribe / signoff / archive access instructions, send > > email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, send email > to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN