System variable symbols are read-only, local-scope or global-scope
variable symbols whose values are determined and assigned only by
the assembler. System variable symbols that have local scope are
assigned a read-only value each time a macro definition is called
by a macro instruction. You can only refer to local-scope system
variable symbols inside macro definitions. System variable symbols
that have global scope are assigned a read-only value for the whole
assembly. You can refer to global-scope system variable symbols in
open code and in macro definitions.
The format of the following two system variables has changed since
Assembler H Version 2:
- &SYSLIST treats parenthesized sublists in SETC symbols as
sublists when passed to a macro definition in the operand of a macro
instruction. The COMPAT(SYSLIST) assembler option can be used to
treat sublists
in the same way as Assembler H Version 2, that is, parenthesized sublists
are treated as character strings, not sublists.
- &SYSPARM can now be up to 255 characters long, subject to
restrictions imposed by job control language.
Some of the new system variable symbols introduced with High Level
Assembler supplement the data provided by system variables available
in previous assemblers.
- &SYSCLOCK:
- &SYSCLOCK provides the date and time the macro is generated.
- &SYSDATE and &SYSDATC:
- &SYSDATE provides the date in the format MM/DD/YY without
the century digits, and the year digits are in the lowest-order positions.
The
new variable symbol &SYSDATC provides the date with the century,
and the year digits in the highest-order positions. Its format is YYYYMMDD.
- &SYSECT and &SYSSTYP:
- All previous assemblers have supported the &SYSECT variable
to hold the name of the enclosing control section at the time a macro
was invoked. This allows a macro that needs to change control sections
to resume the original control section on exit from the macro. However,
there was no capability to determine what type of
control section to resume.
The &SYSSTYP variable provides the
type of the control section named by &SYSECT. This permits a
macro to restore the correct previous control section environment
on exit.
- &SYSMAC:
- Retrieves the name of any macro called between open code and
the current nesting level.
- &SYSM_HSEV:
- Provides the highest MNOTE severity code for the assembly so
far.
- &SYSM_SEV:
- Provides the highest MNOTE severity code for the macro most
recently called from this macro or open code.
- &SYSOPT_XOBJECT:
- Determines if the XOBJECT assembler option was specified.
- &SYSNDX and &SYSNEST:
- All previous assemblers have supported the &SYSNDX variable
symbol, which is incremented by one for every macro invocation in
the program. This permits macros to generate unique ordinary symbols
if they are needed as local labels. Occasionally, in recursively nested
macro calls, the value of the &SYSNDX variable was used to determine
either the depth of nesting, or to determine when control had returned
to a particular level.
Alternatively, the programmer could define
a global variable symbol, and in each macro insert statements to increment
that variable on entry and decrement it on exit. This technique is
both cumbersome (because it requires extra coding in every macro)
and unreliable (because not every macro called in a program is likely
to be under the programmer's control).
High Level Assembler
provides the &SYSNEST variable to keep track of the level of macro-call
nesting in the program. The value of &SYSNEST is incremented globally
on each macro entry, and decremented on each exit.