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.
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.