A proposed RMODE for a program section can be specified in object format. In Assembler, the RMODE pseudo-operation can specify the proposed RMODE. The RMODE for a load module, if not explicitly specified by parameters or control statements in the Binder or Linkage Editor is the most restrictive of the RMODEs in the input object. Even then, a program that dynamically loads a load module can override the load module's RMODE.
As Mr. Sample indicated, an RMODE and AMODE 24 module can call an RMOOE ANY module if it makes arrangements to change the AMODE to AMODE 31 before it calls the module, and changes the AMODE back to AMODE 24 after the RMODE ANY program terminates. The big danger here is that the RMODE ANY module might attempt to return data above the 16-meg line to the RMODE/AMODE 24 program, which will cause the RMODE/AMODE 24 program to fail.
Last year a project I did had an AMODE 31 program call an RMODE 24 (actually, an RMODE unknown) program. This was done, in part, by placing any data sent to the new program in storage allocated below the 16-meg line.