As the responses have indicated this is not a trivial task and it could be impossible in the general case. Although the TAM or BSM instructions can determine the addressing mode at entry in most cases, you do not know for sure whether the R1, R13 and R14 addresses are "clean" for the addressing mode you determined. This may not be as messy for your case, where it sounds like the caller is always some version of COBOL. But if the caller could be an assembler program or subroutine written long ago, there may be flags in the first byte of the registers, amode switches in the program, or other non-standard techniques.

Since you are called by a known level of COBOL, either directly or through an LE service, you might check if there is a missing PTF. Our records indicate that IBM fixed CEEXCRTH for APAR PM52681, but dropped the fix when creating z/OS 2.1 (PI29344). The problem was a AMODE-31 R14 without the high-order bit on, which IBM accepted as an error in LE.

Regards, Gary

__________
On 2016-07-11 16:09, Steve Thompson wrote:
I am trying to determine how I am supposed to know if a COBOL program is AMODE=31/ANY when they call an ALC subroutine.

The routine getting control has just been through an upgrade from 1979 style of NOREUS and data mixed in with instructions.

Also, this routine is not LE conforming. It has never been.

I'm used to doing a BSM to return as a subroutine to have addressing modes match. I had assumed that the caller did BSSM not just BASR or BALR

So when the program ends and returns to the caller via BSM R14, wow, you would not believe all the ESTAEs that get driven (including this programs ESTAEX). LE throws a fit and thankfully, having set up SYSMDUMP with DISP=MOD, I get the dump I need and IPCS ignores the second dump. ;-)

So, R14 does not have the hi-order bit on when I am called.

COBOL being used is Enterprise COBOL 4.2 (which is currently supported).

The environment, just so we are all on the same page is JES2, z/OS 2.2, z13EC.

Regards,
Steve Thompson

PS. I have been scanning various manuals (including the LE one) and nothing is said about this. And I don't have any MVS/XA or MVS/ESA manuals around anymore.

Reply via email to