HLASM Toolkit Feature Interactive Debug Facility User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Saving and restoring an ADDRESS environment

HLASM Toolkit Feature Interactive Debug Facility User's Guide
GC26-8709-07

When making a "permanent change" to the default addressing environment, it is often required that later in your exec, you restore the original environment again. This can be done in one of three basic ways:
  1. By hard-coding a switch from "address CMS" to "address ASM" again, assuming you know that the original default was "ASM".
  2. By exploiting a little-known feature of REXX that an "address" statement with no operands "pops" the previous addressing environment. REXX saves just one recent environment this way, but that is often all that is needed.
  3. By explicitly saving and restoring the environment. The current environment can be saved by the REXX ADDRESS() function call, as for example "saveenv = address()". It can later be restored by another form of the ADDRESS statement, using ADDRESS VALUE, as for example "address value saveenv". In this case, the "saveenv" is taken to be a REXX variable which holds the environment that is to be set.

There is also some interesting save and restore logic within REXX itself, when calling internal procedures. That topic is beyond the scope of this short introduction to ADDRESS.

z/VM

Since the default ADDRESS environment on entry to IDF macros on CMS is in the form of a PSW, certain special precautions should be made when switching from one ADDRESS mode to another. In particular, be aware that the PSW format is a nonprintable hexadecimal eight bytes, which can contain a X'40' byte that might be interpreted as a blank (causing a REXX syntax error perhaps) if misused.

Procedures numbered 2 and 3 in the "Saving and Restoring" examples above are entirely safe for manipulating a PSW form of environment. Procedure 1 depended on the initial environment being "ASM", which is not the case with IDF on CMS, so it should be avoided.

In most cases, there is no need to make a permanent change to the default addressing. You might have just a couple of host commands that warrant a temporary "address CMS" override. So you do not have to worry at all about any of this save and restore complexity.

IDF on CMS still supplies a usual "ASM" subcom environment, so that "address ASM 'WHATEVER'" is supported on TSO, z/VSE, and CMS. And in almost all cases, it is perfectly acceptable to address IDF commands in this way. Make sure that the "LPSW Fastpath" environment is used for an MRUN command. See MRUN for further information and cautions.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014