Главная Manuals High Level Assembler for z/OS & z/VM & z/VSE. Language Reference (Version 1 Release 6)
|
|
|
&VAL1
AREAD CLOCKD
DC
C’&VAL1’
MEND
When this macro definition is called, these statements are generated:
MAC2
+
DC
C’03251400’
+
DC
C’09015400’
ASPACE instruction
Use the ASPACE instruction to insert one or more blank lines in the listing of a
macro definition in your source module, thus separating sections of macro
definition code on the listing page.
►►
ASPACE
►◄
sequence_symbol
number_of_lines
sequence_symbol
Is a sequence symbol.
number_of_lines
Is a non-negative decimal integer that specifies the number of lines to be left
blank. If number_of_lines is omitted, one line is left blank. If number_of_lines has
a value greater than the number of lines remaining on the listing page, the
instruction has the same effect as an AEJECT statement.
Notes:
1. The ASPACE instruction can only be used inside a macro definition.
2. The ASPACE instruction itself is not printed in the listing.
3. The ASPACE instruction does not affect the listing of statements generated
when the macro is called.
COPY instruction
The COPY instruction, inside macro definitions, lets you copy into the macro
definition any sequence of statements allowed in the body of a macro definition.
These statements become part of the body of the macro before macro processing
takes place. You can also use the COPY instruction to copy complete macro
definitions into a source module.
The specifications for the COPY instruction, which can also be used in open code,
are described in “COPY instruction” on page 125.
MEXIT instruction
The MEXIT instruction provides an exit for the assembler from any point in the
body of a macro definition. The MEND instruction provides an exit only from the
end of a macro definition (see “MEND statement” on page 246 for details).
The MEXIT instruction statement can be used only inside macro definitions.
Chapter 7. How to specify macro definitions
261
►►
MEXIT
►◄
sequence_symbol
sequence_symbol
Is a sequence symbol.
The MEXIT instruction causes the assembler to exit from a macro definition to the
next sequential instruction after the macro instruction that calls the definition. (This
also applies to nested macro instructions, which are described in “Nesting macro
instruction definitions” on page 310.)
For example, the following macro definition contains an MEXIT statement:
MACRO
EXITS
DC
C’A’
DC
C’B’
DC
C’C’
MEXIT
DC
C’D’
DC
C’E’
DC
C’F’
MEND
When this macro definition is called, these statements are generated:
EXITS
+
DC
C’A’
+
DC
C’B’
+
DC
C’C’
Comment statements
Two types of comment statements can be used within a macro definition:
v Ordinary comment statements
v Internal macro comment statements
Ordinary comment statements
Ordinary comment statements let you make descriptive remarks about the
generated output from a macro definition. Ordinary comment statements can be
used in macro definitions and in open code.
An ordinary comment statement consists of an asterisk in the begin column,
followed by any character string. The comment statement is used by the assembler
to generate an assembler language comment statement, just as other model
statements are used by the assembler to generate assembler statements. No
variable symbol substitution is done.
Internal macro comment statements
You can also write internal macro comments in the body of a macro definition to
describe the operations done during conditional assembly when the macro is
processed.
262
HLASM V1R6 Language Reference
An internal macro comment statement consists of a period in the begin column,
followed by an asterisk, followed by any character string. No values are
substituted for any variable symbols that are specified in internal macro comment
statements.
Internal macro comment statements can appear anywhere in a macro definition.
Notes:
1. Internal macro comments are not generated.
2. The comment character string can contain double-byte data.
3. Internal macro comment statements can be used in open code, however, they
are processed as ordinary comment statements.
System variable symbols
System variable symbols are a special class of variable symbols, starting with the
characters &SYS. Their values are set by the assembler according to specific rules.
You cannot declare them in local-scope SET symbols or global-scope SET symbols,
nor use them as symbolic parameters in macro prototype statements. You can use
these symbols as points of substitution in model statements and conditional
assembly instructions.
All system variable symbols are subject to the same rules of concatenation and
substitution as other variable symbols.
A description of each system variable symbols begins with “&SYSADATA_DSN
System Variable Symbol” on page 265.
Do not prefix your SET symbols with the character sequence &SYS. The
assembler uses this sequence as a prefix to all system variable symbol names,
and using them for other SET symbol names might cause future conflicts.
Scope and variability of system variable symbols
Global Scope
Some system variable symbols have values that are established at the
beginning of an assembly and are available both in open code and from
within macros. These symbols have global scope. Most system variable
symbols with global scope have fixed values, although there are some
whose value can change within a single macro expansion. The global-scope
system variables symbols with variable values are &SYSSTMT,
&SYSM_HSEV, and &SYSM_SEV.
Local Scope
Some system variable symbols have values that are available only from
within a macro expansion. These system variables have local scope. Since
the value of system variable symbols with local scope is established at the
beginning of a macro expansion and remains unchanged throughout the
expansion, they are designated as having constant values, even though
they might have different values in a later expansion of the same macro, or
within inner macros.
Over half of the system variable symbols have local scope and therefore
are not available in open code.
Chapter 7. How to specify macro definitions
263
1
macro
2
getlocalsys
3 .*
Define globals for values of interest
4
Gblc &clock,&location,&dsname,&nest
5
Gbla &nesta
6 .*
now update the globals from within the macro
7 &clock
setc ’&sysclock’
8 &location setc ’&sysloc’
9 &dsname setc
’&sysin_dsn’
10 &nest
setc
’&sysnest’
11 &nesta
seta
&sysnest
12
mend
000000
00000
00020
14 r
csect
15 *
16 *
define globals in opencode
17 *
18
Gblc &clock,&location,&dsname,&nest
19
Gbla &nesta
20 *
21 *
invoke macro to update the global values
22 *
23
getlocalsys
24 *
25 *
now use the updated values
26 *
27
dc
c’&clock’
000000
F2F0F0F460F0F660
+
dc
c’2008-07-11 17:48:42.914829’
28
dc
c’&nest’
00001A
F1
+
dc
c’1’
29
dc
f’&nesta’
00001B
00
00001C
00000001
+
dc
f’1’
000000
31
end r
Figure 33. Exposing the value of a local scope variable to open code
Uses, values, and properties
System variable symbols have many uses, including:
v Helping to control conditional assemblies
v Capturing environmental data for inclusion in the generated object code
v Providing program debugging data
Refer to Appendix C, “Macro and conditional assembly language
summary,” on page 417 for a summary of the values and properties that
can be assigned to system variable symbols.
|
&SYS_HLASM_PTF System Variable Symbol
|
Use &SYS_HLASM_PTF to obtain the PTF level for High Level Assembler. It can
|
be used in open code. &SYS_HLASM_PTF is assigned a read-only value. The value
|
is an 8-character string. This variable is available on z/OS, z/VM, z/VSE, and
|
Linux for z Systems.
|
&SYS_HLASM_RPM System Variable Symbol
|
Use &SYS_HLASM_RPM to obtain the RPM level for High Level Assembler on
|
Linux for z Systems. It can be used in open code. &SYS_HLASM_RPM is assigned
|
a read-only value. The value is a 64-character string. This variable is blank on
|
z/OS, z/VM, and z/VSE.
264
HLASM V1R6 Language Reference
&SYSADATA_DSN System Variable Symbol
Use &SYSADATA_DSN in a macro definition to obtain the name of the data set to
which the assembler is writing the associated data.
The local-scope system variable symbol &SYSADATA_DSN is assigned a read-only
value each time a macro definition is called.
z/OS
When the assembler runs on the z/OS operating systems, the value of the
character string assigned to &SYSADATA_DSN is always the value stored
in the JFCB for SYSADATA. If SYSADATA is allocated to DUMMY, or a
NULLFILE, the value in &SYSADATA_DSN is NULLFILE.
For example, &SYSADATA_DSN might be assigned a value such as:
IBMAPC.SYSADATA
z/VM
When the assembler runs on the CMS component of the z/VM operating
systems, the value of the character string assigned to &SYSADATA_DSN is
determined as follows:
Table 38. Contents of &SYSADATA_DSN on CMS
SYSADATA Allocated To:
Contents of &SYSADATA_DSN:
CMS file
The 8-character file name, the 8-character file
type, and the 2-character file mode of the
file, each separated by a space
Dummy file (no physical I/O)
DUMMY
Labeled tape file
The data set name of the tape file
Unlabeled tape file
TAPn, where n is a value from 0 to 9, or A to
F.
For example, &SYSADATA_DSN might be assigned a value such as:
SAMPLE SYSADATA A1
z/VSE
The value of the character string assigned to &SYSADATA_DSN is the file
ID from the SYSADAT dlbl.
For example, &SYSADATA_DSN might be assigned a value such as:
MYDATA
Notes:
1. The value of the type attribute of &SYSADATA_DSN (T'&SYSADATA_DSN) is
always U.
2. The value of the count attribute of &SYSADATA_DSN (K'&SYSADATA_DSN)
is equal to the number of characters assigned as a value to &SYSADATA_DSN.
In the previous CMS example, the count attribute of &SYSADATA_DSN is 20.
&SYSADATA_MEMBER System Variable Symbol
z/VSE The value of &SYSADATA_MEMBER is always null. The value of the type
attribute is O, and the value of the count attribute is 0.
Chapter 7. How to specify macro definitions
265
z/VM and z/OS
You can use &SYSADATA_MEMBER in a macro definition to obtain the
name of the data set member to which the assembler is writing the
associated data.
The local-scope system variable symbol &SYSADATA_MEMBER is
assigned a read-only value each time a macro definition is called.
If the data set to which the assembler is writing the associated data is not a
z/OS partitioned data set, &SYSADATA_MEMBER is assigned a null
character string.
Notes:
1. The value of the type attribute of &SYSADATA_MEMBER
(T'&SYSADATA_MEMBER) is U, unless &SYSADATA_MEMBER is assigned a
null character string, in which case the value of the type attribute is O.
2. The value of the count attribute of &SYSADATA_MEMBER
(K'&SYSADATA_MEMBER) is equal to the number of characters assigned as a
value to &SYSADATA_MEMBER. If &SYSADATA_MEMBER is assigned a null
character string, the value of the count attribute is 0.
&SYSADATA_VOLUME System Variable Symbol
Use &SYSADATA_VOLUME in a macro definition to obtain the volume identifier
of the first volume containing the data set to which the assembler is writing the
associated data.
The local-scope system variable symbol &SYSADATA_VOLUME is assigned a
read-only value each time a macro definition is called.
z/VM If the assembler runs on the CMS component of the z/VM operating
system, and the associated data is being written to a Shared File System
CMS file, &SYSADATA_VOLUME is assigned the value “** SFS”.
If the volume on which the data set resides is not labeled, &SYSADATA_VOLUME
is assigned a null character string.
Notes:
1. The value of the type attribute of &SYSADATA_VOLUME
(T'&SYSADATA_VOLUME) is U, unless &SYSADATA_VOLUME is assigned a
null character string, in which case the value of the type attribute is O.
2. The value of the count attribute of &SYSADATA_VOLUME
(K'&SYSADATA_VOLUME) is equal to the number of characters assigned as a
value to &SYSADATA_VOLUME. If &SYSADATA_VOLUME is assigned a null
character string, the value of the count attribute is 0. The maximum length of
this system variable symbol is 6.
&SYSASM System Variable Symbol
Use &SYSASM to obtain the name of the assembler being used to assemble your
source module. &SYSASM has a global scope. For example, when IBM High Level
Assembler for z/OS & z/VM & z/VSE is used, &SYSASM has the value:
HIGH LEVEL ASSEMBLER
Notes:
1. The value of the type attribute of &SYSASM (T'&SYSASM) is always U.
266
HLASM V1R6 Language Reference
2. The value of the count attribute (K'&SYSASM) is the number of characters
assigned. In the example, the count attribute of &SYSASM is 20.
&SYSCLOCK System Variable Symbol
Use &SYSCLOCK to obtain the TOD clock date and time at which the macro was
generated, based on Universal Time (GMT).
The local-scope system variable symbol &SYSCLOCK is assigned a read-only value
each time a macro definition is called.
The value of &SYSCLOCK is a 26-character string in the format:
YYYY-MM-DD HH:MM:SS.mmmmmm
where:
YYYY Is a four-digit field that gives the year, including the century. It has a value
0000 - 9999.
MM Is a two-digit field that gives the month of the year. It has a value 01 - 12.
DD Is a two-digit field that gives the day of the month. It has a value 01 - 31.
HH Is a two-digit field that gives the hour of the day. It has a value 00 - 23.
MM Is a two-digit field that gives the minute of the hour. It has a value 00 - 59.
SS
Is a two-digit field that gives the second of the minute. It has a value 00 -
59.
mmmmmm
Is a six-digit field that gives the microseconds within the seconds. It has a
value 000000 - 999999.
Example:
2001-06-08 17:36:03 043284
Notes:
1. The value of the type attribute of &SYSCLOCK (T'&SYSCLOCK) is always U.
2. The value of the count attribute (K'&SYSCLOCK) is always 26.
&SYSDATC System Variable Symbol
Use &SYSDATC to obtain the date, including the century, on which your source
module is assembled. &SYSDATC has a global scope.
The value of &SYSDATC is an 8-character string in the format:
YYYYMMDD
where:
YYYY Is four-digit field that gives the year, including the century. It has a value
0000 - 9999.
MM Is two-digit field that gives the month of the year. It has a value 01 - 12.
DD Is two-digit field that gives the day of the month. It has a value 01 - 31.
Example:
20000328
Chapter 7. How to specify macro definitions
267
Notes:
1. The date corresponds to the date printed in the page heading of listings and
remains constant for each assembly.
2. The value of the type attribute of &SYSDATC (T'&SYSDATC) is always N.
3. The value of the count attribute (K'&SYSDATC) is always 8.
&SYSDATE System Variable Symbol
Use &SYSDATE to obtain the date, in standard format, on which your source
module is assembled. &SYSDATE has a global scope.
The value of &SYSDATE is an 8-character string in the format:
MM/DD/YY
where:
MM Is a two-digit field that gives the month of the year. It has a value 01 - 12.
DD Is a two-digit field that gives the day of the month. It has a value 01 - 31.
It is separated from MM by a slash.
YY Is a two-digit field that gives the year of the century. It has a value 00 - 99.
It is separated from DD by a slash.
Example:
07/11/08
Notes:
1. The date corresponds to the date printed in the page heading of listings and
remains constant for each assembly.
2. The value of the type attribute of &SYSDATE (T'&SYSDATE) is always U.
3. The value of the count attribute (K'&SYSDATE) is always 8.
&SYSECT System Variable Symbol
Use &SYSECT in a macro definition to generate the name of the current control
section. The current control section is the control section in which the macro
instruction that calls the definition appears. You cannot use &SYSECT in open
code.
The local-scope system variable symbol &SYSECT is assigned a read-only value
each time a macro definition is called.
The value assigned is the symbol that represents the name of the current control
section from which the macro definition is called. Note that it is the control section
in effect when the macro is called. A control section that has been initiated or
continued by substitution does not affect the value of &SYSECT for the expansion
of the current macro. However, it might affect &SYSECT for a subsequent macro
call. Nested macros cause the assembler to assign a value to &SYSECT that
depends on the control section in force inside the outer macro when the inner
macro is called.
Notes:
1. The control section whose name is assigned to &SYSECT can be defined by a
program sectioning statement. This can be a START, CSECT, RSECT, DSECT, or
COM statement.
268
HLASM V1R6 Language Reference
2. The value of the type attribute of &SYSECT (T'&SYSECT) is always U.
3. The value of the count attribute (K'&SYSECT) is equal to the number of
characters assigned as a value to &SYSECT.
4. Throughout the use of a macro definition, the value of &SYSECT is considered
a constant, independent of any program sectioning statements or inner macro
instructions in that definition.
The next example shows these rules:
MACRO
INNER
&INCSECT
&INCSECT CSECT
Statement 1
DC
A(&SYSECT)
Statement 2
MEND
MACRO
OUTER1
CSOUT1
CSECT
Statement 3
DS
100C
INNER
INA
Statement 4
INNER
INB
Statement 5
DC
A(&SYSECT)
Statement 6
MEND
MACRO
OUTER2
DC
A(&SYSECT)
Statement 7
MEND
-------------------------------------------------------------------
MAINPROG CSECT
Statement 8
DS
200C
OUTER1
Statement 9
OUTER2
Statement 10
-------------------------------------------------------------------
Generated Program
-------------------------------------------------------------------
MAINPROG CSECT
DS
200C
CSOUT1
CSECT
DS
100C
INA
CSECT
DC
A(CSOUT1)
INB
CSECT
DC
A(INA)
DC
A(MAINPROG)
DC
A(INB)
In this example:
v Statement 8 is the last program sectioning statement processed before statement
9 is processed. Therefore, &SYSECT is assigned the value MAINPROG for macro
instruction OUTER1 in statement 9. MAINPROG is substituted for &SYSECT when it
appears in statement 6.
v Statement 3 is the program sectioning statement processed before statement 4 is
processed. Therefore, &SYSECT is assigned the value CSOUT1 for macro
instruction INNER in statement 4. CSOUT1 is substituted for &SYSECT when it
appears in statement 2.
v Statement 1 is used to generate a CSECT statement for statement 4. This is the
last program sectioning statement that appears before statement 5. Therefore,
&SYSECT is assigned the value INA for macro instruction INNER in statement 5.
INA is substituted for &SYSECT when it appears in statement 2.
Chapter 7. How to specify macro definitions
269
v Statement 1 is used to generate a CSECT statement for statement 5. This is the
last program sectioning statement that appears before statement 10. Therefore,
&SYSECT is assigned the value INB for macro instruction OUTER2 in statement 10.
INB is substituted for &SYSECT when it appears in statement 7.
&SYSIN_DSN System Variable Symbol
Use &SYSIN_DSN in a macro definition to obtain the name of the data set from
which the assembler is reading the source module.
The local system variable symbol &SYSIN_DSN is assigned a read-only value each
time a macro definition is called.
z/OS If concatenated data sets are used to provide the source module,
&SYSIN_DSN has a value equal to the data set name of the data set that
contains the open code source line of the macro call statement, irrespective
of the nesting depth of the macro line containing the &SYSIN_DSN
reference.
When the assembler runs on the z/OS operating systems, the value of the
character string assigned to &SYSIN_DSN is always the value stored in the
JFCB for SYSIN.
z/VM When the assembler runs on the CMS component of the z/VM operating
systems, the value of the character string assigned to &SYSIN_DSN is
determined as follows:
Table 39. Contents of &SYSIN_DSN on CMS
SYSIN Allocated To:
Contents of &SYSIN_DSN:
CMS file
The 8-character file name, the 8-character file
type, and the 2-character file mode of the
file, each separated by a space
Reader
READER
Terminal
TERMINAL
Labeled tape file
The data set name of the tape file
Unlabeled tape file
TAPn, where n is a value from 0 to 9, or A to
F.
z/VSE When the assembler runs on the z/VSE operating system, the value of the
character string assigned to &SYSIN_DSN is determined as follows:
Table 40. Contents of &SYSIN_DSN on z/VSE
SYSIPT Assigned To:
Contents of &SYSIN_DSN:
Job stream (SYSIPT)
SYSIPT
Disk
The file-id
Labeled tape file
The file ID of the tape file
Unlabeled tape file
SYSIPT
Examples:
On z/OS, &SYSIN_DSN might be assigned a value such as:
IBMAPC.ASSEMBLE.SOURCE
On CMS, &SYSIN_DSN might be assigned a value such as:
270
HLASM V1R6 Language Reference
SAMPLE ASSEMBLE A1
Notes:
1. If the SOURCE user exit provides the data set information then the value in
&SYSIN_DSN is the value extracted from the Exit-Specific Information block
described in the section “Exit-Specific Information Block” in the HLASM
Programmer's Guide.
2. The value of the type attribute of &SYSIN_DSN (T'&SYSIN_DSN) is always U.
3. The value of the count attribute of &SYSIN_DSN (K'&SYSIN_DSN) is equal to
the number of characters assigned as a value to &SYSIN_DSN. In the previous
CMS example, the count attribute of &SYSIN_DSN is 20.
4. Throughout the use of a macro definition, the value of &SYSIN_DSN is
considered a constant.
&SYSIN_MEMBER System Variable Symbol
z/VSE The value of &SYSIN_MEMBER is always null.
The value of the type attribute is O, and the value of the count attribute is
0.
zVM z/OS
You can use &SYSIN_MEMBER in a macro definition to obtain the name of
the data set member from which the assembler is reading the source
module. If concatenated data sets are used to provide the source module,
&SYSIN_MEMBER has a value equal to the name of the data set member
that contains the macro instruction that calls the definition.
The local-scope system variable symbol &SYSIN_MEMBER is assigned a
read-only value each time a macro definition is called.
If the data set from which the assembler is reading the source module is
not a z/OS partitioned data set or a CMS MACLIB, &SYSIN_MEMBER is
assigned a null character string.
Notes:
1. If the SOURCE user exit provides the data set information then the value in
&SYSIN_MEMBER is the value extracted from the Exit-Specific Information
block described in the section “Exit-Specific Information Block” in the HLASM
Programmer's Guide.
2. The value of the type attribute of &SYSIN_MEMBER (T'&SYSIN_MEMBER) is
U, unless &SYSIN_MEMBER is assigned a null character string, in which case
the value of the type attribute is O.
3. The value of the count attribute of &SYSIN_MEMBER (K'&SYSIN_MEMBER) is
equal to the number of characters assigned as a value to &SYSIN_MEMBER. If
&SYSIN_MEMBER is assigned a null character string, the value of the count
attribute is 0.
4. Throughout the use of a macro definition, the value of &SYSIN_MEMBER is
considered a constant.
&SYSIN_VOLUME System Variable Symbol
Use &SYSIN_VOLUME in a macro definition to obtain the volume identifier of the
first volume containing the data set from which the assembler is reading the source
module.
Chapter 7. How to specify macro definitions
271
z/VM and z/OS
If concatenated data sets are used to provide the source module,
&SYSIN_VOLUME has a value equal to the volume identifier of the first
volume containing the data set that contains the macro call instruction.
The local-scope system variable symbol &SYSIN_VOLUME is assigned a read-only
value each time a macro definition is called.
z/VM If the assembler runs on the CMS component of the z/VM operating
system, and the source module is being read from a Shared File System
CMS file, &SYSIN_VOLUME is assigned the value “** SFS”.
If the volume on which the input data set resides is not labeled,
&SYSIN_VOLUME is assigned a null character string.
Notes:
1. If the SOURCE user exit provides the data set information then the value in
&SYSIN_VOLUME is the value extracted from the Exit-Specific Information
block described in the section “Exit-Specific Information Block” in the HLASM
Programmer's Guide.
2. The value of the type attribute of &SYSIN_VOLUME (T'&SYSIN_VOLUME) is
U, unless &SYSIN_VOLUME is assigned a null character string, in which case
the value of the type attribute is O.
3. The value of the count attribute of &SYSIN_VOLUME (K'&SYSIN_VOLUME) is
equal to the number of characters assigned as a value to &SYSIN_VOLUME. If
&SYSIN_VOLUME is assigned a null character string, the value of the count
attribute is 0. The maximum length of this system variable symbol is 6.
4. Throughout the use of a macro definition, the value of &SYSIN_VOLUME is
considered a constant.
&SYSJOB System Variable Symbol
Use &SYSJOB to obtain the job name of the assembly job used to assemble your
source module. &SYSJOB has a global scope.
When the assembler runs on the CMS component of the VM operating systems,
&SYSJOB is assigned a value of (NOJOB).
Notes:
1. The value of the type attribute of &SYSJOB (T'&SYSJOB) is always U.
2. The value of the count attribute (K'&SYSJOB) is the number of characters
assigned.
&SYSLIB_DSN System Variable Symbol
Use &SYSLIB_DSN in a macro definition to obtain name of the data set from
which the assembler read the macro definition statements. If the macro definition
is a source macro definition, &SYSLIB_DSN is assigned the same value as
&SYSIN_DSN.
The local-scope system variable symbol &SYSLIB_DSN is assigned a read-only
value each time a macro definition is called.
When the assembler runs on the z/OS operating systems, the value of the
character string assigned to &SYSLIB_DSN is always the value stored in the JFCB
for SYSLIB.
272
HLASM V1R6 Language Reference
When the assembler runs on the CMS component of the VM operating systems,
and the macro definition is a library macro definition, &SYSLIB_DSN is assigned
the file name, file type, and file mode of the data set.
z/VSE When the macro definition is a library macro definition, &SYSLIB_DSN is
assigned the library name and sublibrary name of the z/VSE Librarian file.
Examples
Under z/OS, &SYSLIB_DSN might be assigned a value such as:
SYS1.MACLIB
Under CMS, &SYSLIB_DSN might be assigned a value such as:
DMSGPI MACLIB S2
Under z/VSE, &SYSLIB_DSN might be assigned a value such as:
IJSYSRS.SYSLIB
Notes:
1. If the LIBRARY user exit provides the data set information then the value in
&SYSLIB_DSN is the value extracted from the Exit-Specific Information block
described in the section “Exit-Specific Information Block” in the HLASM
Programmer's Guide.
2. The value of the type attribute of &SYSLIB_DSN (T'&SYSLIB_DSN) is always
U.
3. The value of the count attribute of &SYSLIB_DSN (K'&SYSLIB_DSN) is equal to
the number of characters assigned as a value to &SYSLIB_DSN.
4. Throughout the use of a macro definition, the value of &SYSLIB_DSN is
considered a constant.
&SYSLIB_MEMBER System Variable Symbol
Use &SYSLIB_MEMBER in a macro definition to obtain the name of the data set
member from which the assembler read the macro definition statements. If the
macro definition is a source macro definition, &SYSLIB_MEMBER is assigned the
same value as &SYSIN_MEMBER.
The local-scope system variable symbol &SYSLIB_MEMBER is assigned a read-only
value each time a macro definition is called.
Notes:
1. If the LIBRARY user exit provides the data set information then the value in
&SYSLIB_MEMBER is the value extracted from the Exit-Specific Information
block described in the section “Exit-Specific Information Block” in the HLASM
Programmer's Guide.
2. The value of the type attribute of &SYSLIB_MEMBER (T'&SYSLIB_MEMBER) is
U, unless &SYSLIB_MEMBER is assigned a null character string, in which case
the value of the type attribute is O.
3. The value of the count attribute of &SYSLIB_MEMBER (K'&SYSLIB_MEMBER)
is equal to the number of characters assigned as a value to &SYSLIB_MEMBER.
If &SYSLIB_MEMBER is assigned a null character string, the value of the count
attribute is 0.
4. Throughout the use of a macro definition, the value of &SYSLIB_MEMBER is
considered a constant.
Chapter 7. How to specify macro definitions
273
&SYSLIB_VOLUME System Variable Symbol
Use &SYSLIB_VOLUME in a macro definition to obtain the volume identifier of
the volume containing the data set from which the assembler read the macro
definition statements. If the macro definition is a source macro definition,
&SYSLIB_VOLUME is assigned the same value as &SYSIN_VOLUME.
The local-scope system variable symbol &SYSLIB_VOLUME is assigned a
read-only value each time a macro definition is called.
If the assembler runs on the CMS component of the VM operating system, and the
source module is being read from a Shared File System CMS file,
&SYSLIB_VOLUME is assigned the value ** SFS.
Notes:
1. If the LIBRARY user exit provides the data set information then the value in
&SYSLIB_VOLUME is the value extracted from the Exit-Specific Information
block described in the section “Exit-Specific Information Block” in the HLASM
Programmer's Guide.
2. The value of the type attribute of &SYSLIB_VOLUME (T'&SYSLIB_VOLUME)
is U, unless &SYSLIB_VOLUME is assigned a null character string, in which
case the value of the type attribute is O.
3. The value of the count attribute of &SYSLIB_VOLUME (K'&SYSLIB_VOLUME)
is equal to the number of characters assigned as a value to &SYSLIB_VOLUME.
If &SYSLIB_VOLUME is assigned a null character string, the value of the count
attribute is 0. The maximum length of this system variable symbol is 6.
4. Throughout the use of a macro definition, the value of &SYSLIB_VOLUME is
considered a constant.
&SYSLIN_DSN System Variable Symbol
Use &SYSLIN_DSN in a macro definition to obtain the name of the data set to
which the assembler is writing the object records when assembler option OBJECT,
GOFF, or XOBJECT is specified.
The local-scope system variable symbol &SYSLIN_DSN is assigned a read-only
value each time a macro definition is called.
z/OS The value of the character string assigned to &SYSLIN_DSN is always the
value stored in the JFCB for SYSLIN. If SYSLIN is allocated to DUMMY, or
a NULLFILE, the value in &SYSLIN_DSN is “NULLFILE”.
z/VM The value of the character string assigned to &SYSLIN_DSN is determined
as follows:
Table 41. Contents of &SYSLIN_DSN on CMS
SYSLIN Allocated To:
Contents of &SYSLIN_DSN:
CMS file
The 8-character file name, the 8-character file
type, and the 2-character file mode of the
file, each separated by a space
Dummy file (no physical I/O)
DUMMY
Punch
PUNCH
Labeled tape file
The data set name of the tape file
Unlabeled tape file
TAPn, where n is a value from 0 to 9, or A to
F.
274
HLASM V1R6 Language Reference
z/VSE
The value of the character string assigned to &SYSLIN_DSN is determined
as follows:
Table 42. Contents of &SYSLIN_DSN on z/VSE
SYSLNK Assigned To:
Contents of &SYSLIN_DSN:
Disk file
The file-id
Labeled tape file
The file ID of the tape file
Unlabeled tape file
SYSLNK
Examples:
On z/OS, &SYSLIN_DSN might be assigned a value such as:
IBMAPC.OBJ
On CMS, &SYSLIN_DSN might be assigned a value such as:
SAMPLE TEXT
A1
Notes:
1. If the OBJECT user exit provides the data set information then the value in
&SYSLIN_DSN is the value extracted from the Exit-Specific Information block
described in the section “Exit-Specific Information Block” in the HLASM
Programmer's Guide.
2. The value of the type attribute of &SYSLIN_DSN (T'&SYSLIN_DSN) is always
U.
3. The value of the count attribute of &SYSLIN_DSN (K'&SYSLIN_DSN) is equal
to the number of characters assigned as a value to &SYSLIN_DSN.
&SYSLIN_MEMBER System Variable Symbol
z/VSE The value of &SYSLIN_MEMBER is always null.
The value of the type attribute is O, and the value of the count attribute is
0.
z/VM and z/OS
You can use &SYSLIN_MEMBER in a macro definition to obtain the name
of the data set member to which the assembler is writing the object
module when the assembler option OBJECT, GOFF, or XOBJECT is
specified.
The local-scope system variable symbol &SYSLIN_MEMBER is assigned a
read-only value each time a macro definition is called.
If the library to which the assembler is writing the object records is not a
z/OS partitioned data set, &SYSLIN_MEMBER is assigned a null character
string.
Notes:
1. If the OBJECT user exit provides the data set information then the value in
&SYSLIN_MEMBER is the value extracted from the Exit-Specific Information
block described in the section “Exit-Specific Information Block” in the HLASM
Programmer's Guide.
Chapter 7. How to specify macro definitions
275
2. The value of the type attribute of &SYSLIN_MEMBER (T'&SYSLIN_MEMBER)
is U, unless &SYSLIN_MEMBER is assigned a null character string, in which
case the value of the type attribute is O.
3. The value of the count attribute of &SYSLIN_MEMBER (K'&SYSLIN_MEMBER)
is equal to the number of characters assigned as a value to
&SYSLIN_MEMBER. If &SYSLIN_MEMBER is assigned a null character string,
the value of the count attribute is 0.
&SYSLIN_VOLUME System Variable Symbol
Use &SYSLIN_VOLUME in a macro definition to obtain the volume identifier of
the object data set. The volume identifier is of the first volume containing the data
set. &SYSLIN_VOLUME is only assigned a value when you specify the OBJECT,
GOFF, or XOBJECT assembler option.
The local-scope system variable symbol &SYSLIN_VOLUME is assigned a
read-only value each time a macro definition is called.
If the assembler runs on the CMS component of the VM operating system, and the
assembler listing is being written to a Shared File System CMS file,
&SYSLIN_VOLUME is assigned the value ** SFS.
If the volume on which the data set resides is not labeled, &SYSLIN_VOLUME is
assigned a null character string.
Notes:
1. If the OBJECT user exit provides the data set information then the value in
&SYSLIN_VOLUME is the value extracted from the Exit-Specific Information
block described in the section “Exit-Specific Information Block” in the HLASM
Programmer's Guide.
2. The value of the type attribute of &SYSLIN_VOLUME (T'&SYSLIN_VOLUME)
is U, unless &SYSLIN_VOLUME is assigned a null character string, in which
case the value of the type attribute is O.
3. The value of the count attribute of &SYSLIN_VOLUME (K'
&SYSLIN_VOLUME) is equal to the number of characters assigned as a value
to &SYSLIN_VOLUME. If &SYSLIN_VOLUME is assigned a null character
string, the value of the count attribute is 0. The maximum length of this system
variable symbol is 6.
&SYSLIST System Variable Symbol
Use &SYSLIST instead of a positional parameter inside a macro definition; for
example, as a point of substitution. By varying the subscripts attached to
&SYSLIST, you can refer to any sublist entry in a macro call operand, or any
positional operands in a macro call. You can also refer to positional operands for
which no corresponding positional parameter is specified in the macro prototype
statement.
The local-scope system variable symbol &SYSLIST is assigned a read-only value
each time a macro definition is called.
&SYSLIST refers to the complete list of positional operands specified in a macro
instruction. &SYSLIST does not refer to keyword operands. However, &SYSLIST
cannot be specified as &SYSLIST without a subscript. One of the two following
forms must be used for references or as a point of substitution:
1. &SYSLIST(n) can be used to refer to the n-th positional operand
276
HLASM V1R6 Language Reference
2. If the n-th operand is a sublist, then &SYSLIST(n,m) can be used to refer to the
m-th operand in the sublist.
3. When referring to multilevel (nested) sublists in operands of macro
instructions, refer to elements of inner sublists by using the applicable number
of subscripts for &SYSLIST.
The subscripts n and m can be any arithmetic expression allowed in the operand of
a SETA instruction (See “SETA instruction” on page 355). The subscript n must be
greater than or equal to 0. The subscript m and any additional subscripts after m
must be greater than or equal to 1.
The examples show the values assigned to &SYSLIST according to the value of its
subscripts n and m.
Macro instruction:
------------------
NAME
MACALL
ONE,TWO,(3,(4,5,6),,8),,TEN,()
Use Within a
Macro Definition:
Value
See note:
---------------------
------------
---------
&SYSLIST(2)
TWO
&SYSLIST(3,1)
3
&SYSLIST(3,2,2)
5
&SYSLIST(4)
Null
1
&SYSLIST(12)
Null
1
&SYSLIST(3,3)
Null
2
&SYSLIST(3,5)
Null
2
&SYSLIST(2,1)
TWO
3
&SYSLIST(2,2)
Null
&SYSLIST(0)
NAME
4
&SYSLIST(3)
(3,(4,5,6),,8)
&SYSLIST(11)
()
&SYSLIST(11,1)
Null
2
Note:
1. If the position indicated by n refers to an omitted operand, or refers to an entry
past the end of the list of positional operands specified, the null character
string is substituted for &SYSLIST(n).
2. If the position (in a sublist) indicated by the second subscript, m, refers to an
omitted entry, or refers past the end of the list of entries specified in the sublist
referred to by the first subscript n, the null character string is substituted for
&SYSLIST(n,m).
3. If the n-th positional operand is not a sublist, &SYSLIST(n,1) refers to the
operand. However, &SYSLIST(n,m), where m is greater than 1, causes the null
character string to be substituted.
4. If the value of subscript n is 0, then &SYSLIST(n) is assigned the value
specified in the name field of the macro instruction, except when it is a
sequence symbol.
Attribute references can be made to the previously described forms of &SYSLIST.
The attributes are the attributes inherent in the positional operands or sublist
entries to which you refer. However, the number attribute of &SYSLIST
(N'&SYSLIST) is different from the number attribute described in “Data attributes”
on page 325. One of two forms can be used for the number attribute:
Chapter 7. How to specify macro definitions
277
v To indicate the number of positional operands specified in a call, use the form
N'&SYSLIST.
v To indicate the number of sublist entries that have been specified in a positional
operand, use the form N'&SYSLIST(n).
v To indicate the number of entries in nested sublists, specify the appropriate set
of subscripts need to reference the selected sublist.
Notes:
1. N'&SYSLIST includes any positional operands that are omitted. Positional
operands are omitted by coding a comma where an operand is expected.
2. N'&SYSLIST(n) includes those sublist entries specifically omitted by specifying
the comma that normally follows the entry.
3. If the operand indicated by n is not a sublist, N'&SYSLIST(n) is 1. If it is
omitted, N'&SYSLIST(n) is 0.
The COMPAT(SYSLIST) assembler option instructs the assembler to treat sublists in
macro instruction operands as character strings, not sublists. See the section
“COMPAT” in the HLASM Programmer's Guide for a description of the
COMPAT(SYSLIST) assembler option.
Examples of sublists:
Macro Instruction
N’&SYSLIST
MACLST
1,2,3,4
4
MACLST
A,B,,D,E
5
MACLST
,A,B,C,D
5
MACLST
(A,B,C),(D,E,F)
2
MACLST
0
MACLST KEY1=A,KEY2=B
0
MACLST A,B,KEY1=C
2
N’&SYSLIST(2)
MACSUB A,(1,2,3,4,5),B
5
MACSUB A,(1,,3,,5),B
5
MACSUB A,(,2,3,4,5),B
5
MACSUB A,B,C
1
MACSUB A,,C
0
MACSUB A,(),C
1
MACSUB A,KEY=(A,B,C)
0
MACSUB
0
&SYSLOC System Variable Symbol
Use &SYSLOC in a macro definition to generate the name of the location counter
in effect. If you have not coded a LOCTR instruction between the macro
instruction and the preceding START, CSECT, RSECT, DSECT, or COM instruction,
the value of &SYSLOC is the same as the value of &SYSECT.
The assembler assigns to the system variable symbol &SYSLOC a local read-only
value each time a macro definition containing it is called. The value assigned is the
symbol representing the name of the location counter in use at the point where the
macro is called.
&SYSLOC can only be used in macro definitions; it has local scope.
Notes:
1. The value of the type attribute of &SYSLOC (T'&SYSLOC) is always U.
278
HLASM V1R6 Language Reference
2. The value of the count attribute (K'&SYSLOC) is equal to the number of
characters assigned as a value to &SYSLOC.
3. Throughout the use of a macro definition, the value of &SYSLOC is considered
a constant.
&SYSMAC System Variable Symbol
By varying the subscripts attached to the &SYSMAC you can refer to the name of
any of the macros called between open code and the current nesting level, that is,
&SYSMAC(&SYSNEST) returns 'OPEN CODE'. Valid subscripts are 0 to
&SYSNEST. If &SYSMAC is used with a subscript greater than &SYSNEST, a null
character string is returned.
&SYSMAC with no subscript is treated as &SYSMAC(0) and so provides the name
of the macro being expanded. This is not considered to be an error and so no
message is issued.
The local-scope system variable symbol &SYSMAC is assigned a read-only value
each time a macro definition is called.
Notes:
1. The value of the type attribute of &SYSMAC (T'&SYSMAC(n)) is U, unless
&SYSMAC(n) is assigned a null character string, in which case the value of the
type attribute is O.
2. The value of the count attribute (K'&SYSMAC(n)) is equal to the number of
characters assigned as a value to &SYSMAC(n).
&SYSM_HSEV System Variable Symbol
Use &SYSM_HSEV to get the highest MNOTE severity so far for the assembly.
The global-scope system variable symbol &SYSM_HSEV is assigned a read-only
value. The assembler compares this value with the severity of MNOTE assembler
instructions as they are encountered and, if lower, updates it with the higher value.
Notes:
1. The value of the variable symbol is supplied as three numeric characters, not as
an arithmetic (binary) value.
2. The value of the type attribute of &SYSM_SEV (T'&SYSM_SEV) is always N.
3. The value of the count attribute (K'&SYSM_SEV) is always 3.
4. The value of &SYSM_HSEV 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 Figure 34 on page 280 the &SYSM_HSEV variable is updated immediately when
an MNOTE is issued with a higher severity.
&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.
Chapter 7. How to specify macro definitions
279
Notes:
1. The value of the variable symbol is supplied as three numeric characters, not as
an arithmetic (binary) value.
2. The value of the type attribute of &SYSM_SEV (T'&SYSM_SEV) is always N.
3. The value of the count attribute (K'&SYSM_SEV) is always 3.
4. 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 Figure 34 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
Figure 34. Example of the behavior of the &SYSM_HSEV and &SYSM_SEV variables
&SYSNDX System Variable Symbol
For each macro invocation, a new value of &SYSNDX is assigned. The previous
value is incremented by 1. Thus, you can attach &SYSNDX to the end of a symbol
inside a macro definition to generate a unique suffix for that symbol each time you
call the definition. Although an apparently identical symbol is to be generated by
two or more calls to the same definition, the suffix provided by &SYSNDX
produces two or more unique symbols. For example, the symbol ABC&SYSNDX
280
HLASM V1R6 Language Reference
|
|