SYNCH is the right method if you are attempting to decrease authority from 
supervisor state to problem state (such as your program is running in 
supervisor state and now needs an exit to get control in problem state 
which is the ESTAE case). It is not an efficient method otherwise.  I'll 
point out also that SYNCH the only proper method to use if you are 
decreasing state authority. While the architecture allows for 
authority-decreasing PC's, z/OS really does not support them and if not 
done properly can easily cause system integrity problems (and I'm not 
going to go into what might entail "properly" because you really shouldn't 
be doing this). I doubt that this limitation is well documented (if at 
all).

The simplest approach is to use BAKR ... PR if all that you want to do is 
to save and then restore the PSW state state.

EPSW will have let you determine whether you are or are not in supervisor 
state.
Since you seem to be able to switch if you want to, you must be authorized 
enough to do so.

So save your current state via BAKR before you switch, us MODESET to 
switch, and restore it by PR.

Note that if you are changing only the PSW key with MODESET the BAKR/PR 
approach is bad because even though the PR will restore the key it will 
not restore the PKM.
For example (but do not do this)
 BAKR
 MODESET KEY=ZERO
 PR

For a normal application, the PKM will have started at x'00C0', will be 
x'8040' after the MODESET and will still be x'8040' after the PR, thus 
leaving the key 8 application with the ability to SPKA to key 0.

Peter Relson
z/OS Core Technology Design

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

Reply via email to