Charles, I agree that there should be a compiler or LE API to do this.
If not: ARCH levels actually map to a set of required "Facilities" (the Principles of Operation term). You can test at the facility bits in the PSAE, mapped by IHAFACL. Then you could use the documentation on ARCH in the compiler manual to construct a bit mask for each level. Then start with the lowest level and search until you find the last one with all of the required facilities. Here's my whack at it (but I have no idea if it is accurate; Maybe open an ETR with IBM to confirm? ) ARCH(5) z-arch base. (Assuming that you know that you are running modern z/OS in z-arch mode, I would start here) - FaclZArchInstalled ARCH(6) long-displacement facility - FaclLongDisplacement ARCH(7) (z9) extended-immediate facility, DFP facility (if DFP compiler option enabled) - FaclExtendedImmediate ARCH(8) (z10) general instruction extensions facility, DFP Facility - FaclGeneralInstExtension - FaclDFPF ARCH(9) (z196) high-word facility, the interlocked-access facility, the load/store-on-condition facility, the distinct-operands-facility and the population-count facility. - FaclHighWord - FaclLoadStoreOnCondition - FaclDistinctOperands - FaclPopulationCount ARCH(10) (xC12) execution-hint facility, the load-and-trap facility, the miscellaneous-instruction-extension facility, and the transactional-execution facility. - FaclMiscInstExt - FaclExecutionHint - FaclLoadAndTrap - FaclTransactionalExecution ARCH(11) (z13) vector facility, the decimal floating point packed conversion facility, the load/store-on-condition facility, and the conditional-transaction-end facility. - Facl_VectorExtensionFacility - FACL_DFPPackedConversion - FACL_LoadStoreOnCond2 - FACL_CTEND ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
