... because I have little control over and no knowledge of the specific 
instructions the compiler may emit. I only know the ARCH level of the compile.

Here's the background: the product recently S0C1ed on initial execution at a 
new customer. We quickly figured out the problem was a box older than the 
target of the build. My boss asked "couldn't we put out a better message than 
S0C1?" (I think S0C1 is a perfectly good message but I am not the boss.)

Of course, the problem is not totally trivial because it implies that the code 
answering the question is in fact capable of execution on the box. Yes, I think 
I have that solved -- I will #pragma OPTIONS (ARCH) the entry module (only runs 
once per execution, optimization is nearly irrelevant) down to a minimum ARCH 
level, first doing #define ORIGINALARCH __ARCH__. Then I can compare (original) 
build ARCH to hardware ARCH and exit gracefully with a natural language 
diagnostic if the former is greater than the latter.

Hokay?

Charles

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf 
Of Tony Harminc
Sent: Wednesday, November 25, 2015 10:16 AM
To: [email protected]
Subject: Re: Straightforward way to determine hardware architecture level?

On 25 November 2015 at 11:57, Charles Mills <[email protected]> wrote:
> Is there a fairly straightforward way to determine the "architecture number"
> of the hardware on which a program is actually running? By 
> architecture level I mean z13 = ARCH(11) and so forth, as supported by 
> C/C++ and I think now COBOL. By straightforward I mean I do not want 
> to test various feature bits in the CVT and try to infer the 
> architecture level or try various instructions and catch the S0C1s.

Well someone's got to ask: why do you want this number, rather than just 
testing the relevant feature bit before you try to use some instruction or 
feature? The only thing that comes to my mind is that you may want to 
dynamically invoke the C (or COBOL) compiler, passing it the ARCH(nn), but I 
think the default is the level of the current system in any case.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to