Telling the system about the execution environment
- The addressing mode (AMODE) at the time the macro is issued
- The ASC mode of the program at the time the macro is issued
- The architectural level in which the program runs
For macros that are sensitive to their environment, use the SYSSTATE macro to define the environment. During the assembly stage, SYSSTATE sets one or more global symbols. Later, in your source code, the macro checks the global symbols and generates the correct code, which might mean avoiding using a z/Architecture® instruction or an access register. Table 1 lists MVS™ macros and identifies macros that need to know the environmental characteristics.
specify
SYSSTATE ARCHLVL=2, and switch to SYSSTATE ARCHLVL=3 before issuing
macros in sections of code that only run when z/OS® 2.1 capabilities are available.
If
you do not issue the SYSSTATE macro, the system assumes the macro
is issued as follows: - In AMODE other than 64-bit
- In primary ASC mode
Usually, in ESA/390 architectural
level (but may assume z/Architecture level
since all supported z/OS releases
require z/Architecture level)
Table 1 describes the relevant characteristics, the corresponding parameters on the SYSSTATE macro, and the global symbols the macro checks.
| Characteristic | Parameter on SYSSTATE | Global symbol |
|---|---|---|
| AMODE of 64-bit, or either 24-bit or 31-bit | AMODE64=YES or NO | &SYSAM64 |
| Primary or AR ASC mode | ASCENV=P or AR | &SYSASCE |
| Architectural level of z/Architecture | ARCHLVL=0, 1, 2 , 3 or OSREL |
&SYSALVL |
Operating system release![]() |
ZOSVvRr![]() |
&SYSOSREL![]() |
You can issue the SYSSTATE macro with the TEST parameter in your own user-written macro to allow your macros to generate code appropriate for their execution environment.
Callable services do not check the global symbols described in this topic. To determine whether a callable service is sensitive to the AMODE, ASC mode, or the Architecture level, see the description of the individual callable service.
In early releases of MVS, the SPLEVEL macro performs a function similar to SYSSTATE. The SPLEVEL macro identifies the level of the operating system, so that you can tune a macro expansion based on that level. You can use this where macro expansions change incompatibly. Because SPLEVEL applies to levels that the system no longer supports, it is not described in this topic.