&SYSM_SEV System Variable Symbol
Use &SYSM_SEV to get the highest MNOTE severity code for the macro most recently called directly from this level.
The global-scope system variable symbol &SYSM_SEV is assigned
a read-only value. The assembler assigns a value of zero when a macro
is called and when a macro returns (MEND or MEXIT), the highest severity
of all MNOTE assembler instructions executed in the called macro is
used to update the variable.
Notes:
- The value of the variable symbol is supplied as three numeric characters, not as an arithmetic (binary) value.
- The value of the type attribute of &SYSM_SEV (T'&SYSM_SEV) is always N.
- The value of the count attribute (K'&SYSM_SEV) is always 3.
- The value of &SYSM_SEV is unreliable if any MNOTE is incorrectly coded such that a diagnostic message is generated for the MNOTE statement. The cause of the diagnostic message must be corrected.
In this example, the &SYSM_SEV variable has a value of 0 until INNER returns. The OUTER macro
uses &SYSM_SEV to determine which statements to generate, and in this case issues an MNOTE to
pass the severity back to the open code.
1 MACRO
2 OUTER &SEV
3 DC A(&SYSM_HSEV,&SYSM_SEV) outer 1
4 MNOTE &SEV,'OUTER - parm severity=&SEV'
5 DC A(&SYSM_HSEV,&SYSM_SEV) outer 2
6 INNER
7 DC A(&SYSM_HSEV,&SYSM_SEV) outer 3
8 AIF ('&SEV' GT '&SYSM_SEV').MN
9 MNOTE &SYSM_SEV,'OUTER - returned severity=&SYSM_SEV'
10 .MN ANOP
11 DC A(&SYSM_HSEV,&SYSM_SEV) outer 4
12 MEND
13 MACRO
14 INNER
15 DC A(&SYSM_HSEV,&SYSM_SEV) inner 1
16 MNOTE 8,'INNER'
17 DC A(&SYSM_HSEV,&SYSM_SEV) inner 2
18 MEND
000000 00000 00040 19 E_G CSECT
20 *,OPEN CODE an mnote comment - sev=0
21 DC A(&SYSM_HSEV,&SYSM_SEV) open_code
000000 0000000000000000 + DC A(000,000) open_code
22 OUTER 4
000008 0000000000000000 23+ DC A(000,000) outer 1
** ASMA254I *** MNOTE *** 24+ 4,OUTER - parm severity=4
000010 0000000400000000 25+ DC A(004,000) outer 2
000018 0000000400000000 26+ DC A(004,000) inner 1
** ASMA254I *** MNOTE *** 27+ 8,INNER
000020 0000000800000000 28+ DC A(008,000) inner 2
000028 0000000800000008 29+ DC A(008,008) outer 3
** ASMA254I *** MNOTE *** 30+ 008,OUTER - returned severity=008
000030 0000000800000008 31+ DC A(008,008) outer 4
32 *,OPEN CODE an mnote comment - sev=0
33 DC A(&SYSM_HSEV,&SYSM_SEV) open_code
000038 0000000800000008 + DC A(008,008) open_code
34 END