SWAG, so I won't be surprised to be dead wrong: As an INCLUDE in the SYSIN to the binder with an ENTRY statement naming the CSECT you include. Your inserted code then has to branch to the "real" main entry point for C++, whatever that may be (I've not written or run any C++ on z/OS so I can’t be sure what that may be -- V(CEEMAIN) maybe?).
Possibly may need to ORDER your new CSECT first and let the binder default to the first CSECT as the entry point? Peter -----Original Message----- From: IBM Mainframe Discussion List <[email protected]> On Behalf Of Charles Mills Sent: Tuesday, April 25, 2023 5:27 PM To: [email protected] Subject: Re: XLC architecture level question Setting ARCH is like playing Blackjack or Twenty-one: guess too low and it is sub-optimal; guess too high and you bust. Note that everything we have said here about ARCH and TUNE applies equally to COBOL as to C/C++. Of course if you are writing programs for in-house use your universe of machines to support is much smaller. The classic error is forgetting about your DR machine. At CorreLog we managed to ship a C++ build to someone who was too back-level for our ARCH. So George -- any of you who know George know that he is a good guy but a yell-er -- yelled at me that the S0C1 was totally unacceptable -- we needed an error message. I pointed out that SYSTEM COMPLETION CODE=0C1 *is* an error message, but he was not having that. So I wrote some assembler code and C++ to compare the compiled ARCH level -- you can retrieve it with __ARCH__ -- and put out our own message if there were a conflict. Obviously you need to do that just as early in your run process as possible or the train will have already left the station and run into a wall. Here's an exercise for the readers. If you want to insert some code into a C++ module such that it will run just as early as possible during the run processing, where do you put it and what else do you do? (Hint: "right after int main(int argc, char* argv[]) and cross your fingers" are NOT the right answers.) Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Charles Mills Sent: Tuesday, April 25, 2023 7:06 AM To: [email protected] Subject: Re: XLC architecture level question ARCH level is a "problem" I have dealt with for 12 or so years. I say "problem" in quotes because it is not much of a problem -- you only have to revisit it once every two years, and even then it is not an urgent problem. So you don't need a solution that runs on autopilot -- you can just revisit your decision every two years or so. You need a management policy. The one I have advocated to my management is "we will support the oldest hardware supported by the oldest supported release of z/OS." I point out that while there may be lots of customers out there running z9's, they probably are not buying a whole lot of OEM products. Currently that would be ARCH(10), representing the zB/EC12, supported by z/OS V2R4. Once V2R4 goes out of service it would become -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
