Macro and conditional assembly language summary

This appendix summarizes the macro and conditional assembly language described in Part 3 of this publication. Table 1 indicates which macro and conditional assembly language elements can be used in the name and operand entries of each statement. Table 3 summarizes the expressions that can be used in macro instruction statements. Table 5 summarizes the attributes that can be used in each expression. Table 6 summarizes the variable symbols that can be used in each expression. Table 7 summarizes the system variable symbols that can be used in each expression.
Table 1. Macro language elements (part 1)
Statement Variable Symbols Sequence
Symbol
Symbolic
Parameter
Global-scope SET Symbols² Local SET Symbols²
SETA SETB SETC SETA SETB SETC
MACRO                
Prototype Statement Name Operand              
GBLA Operand11 Operand Operand11 Operand11 Operand11 Operand11 Operand11 Name
GBLB Operand11 Operand11 Operand Operand11 Operand11 Operand11 Operand11 Name
GBLC Operand11 Operand11 Operand11 Operand Operand11 Operand11 Operand11 Name
LCLA Operand11 Operand11 Operand11 Operand11 Operand Operand11 Operand11 Name
LCLB Operand11 Operand11 Operand11 Operand11 Operand11 Operand Operand11 Name
LCLC Operand11 Operand11 Operand11 Operand11 Operand11 Operand11 Operand Name
Model Statement Name Operation Operand Name Operation Operand Name Operation Operand Name Operation Operand Name Operation Operand Name Operation Operand Name Operation Operand Name
SETA Name12 Operand3 Name Operand Name12 Operand4 Name12 Operand10 Name Operand Name12 Operand4 Name12 Operand10  
SETAF Name12 Operand3, 13 Name Operand13 Name12 Operand4,13 Name10,12Operand13 Name Operand13 Name12 Operand4,13 Name10,12 Operand13  
SETB Name12 Operand7 Name12 Operand7 Name Operand Name12 Operand7 Name12 Operand7 Name Operand Name12 Operand7  
SETC Name12 Operand Name12 Operand8 Name12 Operand9 Name Operand Name12 Operand8 Name12 Operand9 Name Operand   Operand
SETCF Name12 Operand13 Name12 Operand8,13 Name12 Operand9,13 Name Operand13 Name12 Operand8,13 Name12 Operand9,13 Name Operand13  
ACTR Operand3 Operand Operand4 Operand3 Operand Operand4 Operand3 Name
AEJECT               Name
AINSERT Operand Operand Operand Operand Operand Operand Operand Name
AGO               Name Operand
AIF Operand7 Operand7 Operand Operand7 Operand7 Operand Operand7 Name Operand
ANOP Name
AREAD Name12 Name12 Name12 Name Name12 Name12 Name  
ASPACE Operand3 Operand Operand4 Operand3 Operand Operand4 Operand3 Name
MEXIT Name
MNOTE Operand Operand Operand Operand Operand Operand Operand Name
MEND Name
Outer Macro   Name Operand Name Operand Name Operand Name Operand Name Operand Name Operand Name
Inner Macro Name Operand Name Operand Name Operand Name Operand Name Operand Name Operand Name Operand Name
Notes:
  1. Variable symbols in macro instructions are replaced by their values before processing.
  2. Depending upon their values, system variable symbols with global scope can be used in the same way as global SET symbols, and system variable symbols with local scope can be used in the same way as local SET symbols.
  3. Only if value is self-defining term.
  4. Converted to arithmetic 0 or 1.
  5. Only in character relations.
  6. Only in arithmetic relations.
  7. Only in arithmetic or character relations.
  8. Converted to an unsigned number.
  9. Converted to character 0 or 1.
  10. Only if one to ten decimal digits, not greater than 2147483647.
  11. Only in created SET symbols if value of parenthesized expression is an alphabetic character followed by 0 to 61 alphanumeric characters.
  12. Only in created SET symbols (as described above) and in subscripts (see SETA statement).
  13. The first operand of a SETAF or SETCF instruction must be a character (SETC) expression containing or evaluating to an eight byte module name.
Table 2. Macro language elements (part 2)
Statement Attributes Type
Length Scale Integer Count Number Defined Operation
Code
 
MACRO                
Prototype Statement                
GBLA                
GBLB                
GBLC                
LCLA                
LCLB                
LCLC                
Model Statement                
SETA   Operand Operand Operand Operand Operand Operand  
SETAF   Operand13 Operand13 Operand13 Operand13 Operand13    
SETB Operand5 Operand6 Operand6 Operand6 Operand6 Operand6 Operand6 Operand5
SETC Operand Operand
SETCF Operand13              
ACTR Operand Operand Operand Operand Operand    
AEJECT                
AGO                
AIF Operand5 Operand6 Operand6 Operand6 Operand6 Operand6 Operand Operand
ANOP                
AREAD                
ASPACE Operand Operand Operand Operand Operand    
MEXIT                
MNOTE                
MEND                
Outer Macro                
                 
Notes:
  1. Variable symbols in macro instructions are replaced by their values before processing.
  2. Depending upon their values, system variable symbols with global scope can be used in the same way as global SET symbols, and system variable symbols with local scope can be used in the same way as local SET symbols.
  3. Only if value is self-defining term.
  4. Converted to arithmetic 0 or 1.
  5. Only in character relations.
  6. Only in arithmetic relations.
  7. Only in arithmetic or character relations.
  8. Converted to an unsigned number.
  9. Converted to character 0 or 1.
  10. Only if one to ten decimal digits, not greater than 2147483647.
  11. Only in created SET symbols if value of parenthesized expression is an alphabetic character followed by 0 to 61 alphanumeric characters.
  12. Only in created SET symbols (as described above) and in subscripts (see SETA statement).
  13. The first operand of a SETAF or SETCF instruction must be a character (SETC) expression containing or evaluating to an eight byte module name.

Table 3. Conditional assembly expressions
Expression
Arithmetic
Expressions
Character
Expressions
Logical
Expressions
Can
contain
Self-defining terms 

Absolute, predefined ordinary symbols

Length, scale, integer, count, defined, and number attributes

SETA and SETB symbols

SETC symbols whose values are a self-defining term

Symbolic parameters if the corresponding operand is a self-defining term

Built-in Functions

&SYS_HLASM_DATE

&SYSDATC

&SYSLIST(n) if the corresponding operand is a self-defining term

&SYSLIST (n,m) if the corresponding operand is a self-defining term

&SYSOPT_DBCS, &SYSOPT_RENT, and &SYSOPT_XOBJECT

&SYSM_HSEV and &SYSM_SEV

&SYSNDX, &SYSNEST, and &SYSSTMT

Any combination of characters (including double-byte characters, if the DBCS assembler option is specified) enclosed in apostrophes  

Any variable symbol enclosed in apostrophes 

A concatenation of variable symbols and other characters enclosed in apostrophes

Built-in Functions

A type or operation code attribute reference

Substrings

 
A 0 or a 1

Absolute, predefined ordinary symbols

SETB symbols

Arithmetic relations

Character relations

Arithmetic value

Operations +, - (unary and binary), *, and /; 

Parentheses permitted

Concatenation, with a period (.), or by juxtaposition; substrings AND, OR, NOT, XOR 

Parentheses permitted

Range of values -2³¹ to +2³¹-1 0 through 4064 characters 0 (false) or 1 (true)
Used in SETA operands

Arithmetic relations

Created SET symbols

Subscripted SET symbols

&SYSLIST subscripts

Substring notation

Sublist notation

SETC operands 

Character relations

Created SET symbols

SETB operands 

AIF operands

Created SET symbols

Built-in functions fall into the following categories:

Table 4. Built-in functions
Value Type Functions
Arithmetic AND, B2A, C2A, D2A, DCLEN, FIND, INDEX, NOT, OR, SLA, SLL, SRA, SRL, X2A, XOR
Logical AND, AND NOT, ISBIN, ISDEC, ISHEX, ISSYM, NOT, OR, OR NOT, XOR, XOR NOT
Character A2B, A2C, A2D, A2X, B2C, B2D, B2X, BYTE, C2B, C2D, C2X, D2B, D2C, D2X, DCVAL, DEQUOTE, DOUBLE, LOWER, SIGNED, UPPER, X2B, X2C, X2D
Table 5. Attributes
Attribute Notation Can be used with:
Can be used only if
Type Attribute is:
Can be used in:
Type T' Ordinary symbols defined in open code; symbolic parameters inside macro definitions; &SYSLIST(n), &SYSLIST(n,m) inside macro definitions; SET symbols; all system variable symbols Any value SETC expressions 

Character relations

Length L' Ordinary symbols defined in open code; symbolic parameters inside macro definitions; &SYSLIST(n), and &SYSLIST(n,m) inside macro definitions Any value except M, N, O, T, U SETA and ordinary arithmetic expressions
Scale S' Ordinary symbols defined in open code; symbolic parameters inside macro definitions; &SYSLIST(n), and &SYSLIST(n,m) inside macro definitions H,F,G,D,E,L,K,P, and Z SETA and ordinary arithmetic expressions
Integer I' Ordinary symbols defined in open code; symbolic parameters inside macro definitions; &SYSLIST(n), and &SYSLIST(n,m) inside macro definitions H,F,G,D,E,L,K,P, and Z SETA and ordinary arithmetic expressions
Count K' Symbolic parameters inside macro definitions; &SYSLIST(n), and &SYSLIST(n,m) inside macro definitions; SET symbols; all system variable symbols Any letter or @ or $ SETA and ordinary arithmetic expressions
Number N' Symbolic parameters, &SYSLIST and &SYSLIST(n) inside macro definitions, with dimensioned SET symbols Any value SETA and ordinary arithmetic expressions
Defined D' Ordinary symbols defined in open code; symbolic parameters inside macro definitions; &SYSLIST and &SYSLIST(n) inside macro definitions; SETC symbols whose value is an ordinary symbol Any value except M, N, O, T, U SETA arithmetic expressions
Operation Code O' A character string, or variable symbol containing a character string. @, $, and any letter except N, O and (only sometimes) U SETC expressions

Character relations

Refer to How to write conditional assembly instructions for usage restrictions of the attributes in Table 5.
Table 6. Variable symbols
Variable
Symbol
Declared
by:
Initialized
or set to:
Value changed
by:
Can be used
in:
Symbolic1 parameter Prototype statement Corresponding macro instruction operand Constant throughout definition Arithmetic expressions if operand is self-defining term

Character expressions

SETA LCLA or GBLA instruction 0 SETA instruction Arithmetic expressions

Character expressions

Logical expressions

SETB LCLB or GBLB instruction 0 SETB instruction Arithmetic expressions

Character expressions

Logical expressions

SETC LCLC or GBLC instruction String of length 0 (null) SETC instruction Arithmetic expressions if value is self-defining term

Character expressions

Logical expressions if value is self-defining term

Notes:
  1. Can be used only in macro definitions.
Table 7. System variable symbols
System Variable Symbol Avail- ability¹ Type² Type Attr.³ Scope Initialized or set to Value changed by Can be used in
&SYS_HLASM_DATE HLA6 C,A N G PTF build date Constant throughout assembly Arithmetic expressions

Character expressions

&SYS_HLASM_PTF HLA6 C U G PTF level Constant throughout assembly Character expressions
&SYS_HLASM_RPM HLA6 C U G RPM level Constant throughout assembly Character expressions
&SYSADATA_DSN HLA2 C U,O L Current associated data file Constant throughout assembly Character expressions
&SYSADATA_MEMBER HLA2 C U,O L Current associated data file member name Constant throughout assembly Character expressions
&SYSADATA_VOLUME HLA2 C U,O L Current associated data file volume identifier Constant throughout assembly Character expressions
&SYSASM HLA1 C U G Assembler name Constant throughout assembly Character expression
&SYSCLOCK HLA3 C U L Current date and time Constant throughout macro expansion Character expressions
&SYSDATC HLA1 C,A N G Assembly date (with century) Constant throughout assembly Arithmetic expressions

Character expressions

&SYSDATE AsmH C U G Assembly date Constant throughout assembly Character expressions
&SYSECT All C U L Name of control section in effect where macro instruction appears Constant throughout definition; set by START, CSECT, RSECT, CATTR, DSECT, or COM Character expressions
&SYSIN_DSN HLA1 C U L Current primary input data set name Constant throughout definition Character expressions
&SYSIN_MEMBER HLA1 C U,O L Current primary input member name Constant throughout definition Character expressions
&SYSIN_VOLUME HLA1 C U,O L Current primary input volume identifier Constant throughout definition Character expressions
&SYSJOB HLA1 C U G Source module assembly job name Constant throughout assembly Character expressions
&SYSLIB_DSN HLA1 C U L Current macro library filename Constant throughout definition Character expressions
&SYSLIB_MEMBER HLA1 C U,O L Current macro library member name Constant throughout definition Character expressions
&SYSLIB_VOLUME HLA1 C U,O L Current macro library volume identifier Constant throughout definition Character expressions
&SYSLIN_DSN HLA2 C U L Current object data set name Constant throughout assembly Character expressions
&SYSLIN_MEMBER HLA2 C U,O L Current object data set member name Constant throughout assembly Character expressions
&SYSLIN_VOLUME HLA2 C U,O L Current object data set volume identifier Constant throughout assembly Character expressions
&SYSLIST All C any L Not applicable Not applicable N'&SYSLIST in arithmetic expressions
&SYSLIST(n)
&SYSLIST(n,m)
All C any L Corresponding macro instruction operand Constant throughout definition Arithmetic expressions if operand is self-defining term

Character expressions

&SYSLOC AsmH C U L Location counter in effect where macro instruction appears Constant throughout definition; set by START, CSECT, RSECT, DSECT, COM, and LOCTR Character expressions
&SYSMAC HLA3 C U,O L Macro name Constant throughout definition Arithmetic expressions
&SYSMAC(n)₁ HLA3 C U,O L Ancestor macro name Constant throughout definition Arithmetic expressions
&SYSM_HSEV HLA3 A N G 0 Mnote Arithmetic expressions
&SYSM_SEV HLA3 A N G 0 At nesting and unnesting of macros, from MNOTE Arithmetic expressions
&SYSNDX All C N L Macro instruction index Constant throughout definition; unique for each macro instruction Arithmetic expressions

Character expressions

&SYSNEST HLA1 A N L Macro instruction nesting level Constant throughout definition; unique for each macro nesting level Arithmetic expressions

Character expressions

&SYSOPT_ASCII HLA6 C,A N G xxx option value Constant throughout assembly Arithmetic expressions

Character expressions

&SYSOPT_CA HLA6 C,A N G xxx option value ACONTROL xxx statements Arithmetic expressions

Character expressions

&SYSOPT_CE HLA6 C,A N G xxx option value ACONTROL xxx statements Arithmetic expressions

Character expressions

&SYSOPT_CODEPAGE HLA6 C,A N G xxx option value Constant throughout assembly Arithmetic expressions

Character expressions

&SYSOPT_CU HLA6 C,A N G xxx option value ACONTROL xxx statements Arithmetic expressions

Character expressions

&SYSOPT_CURR_OPTABLE HLA6 C U G Current OPTABLE ACONTROL OPTABLE statements Character expressions
&SYSOPT_DBCS HLA1 B N G DBCS assembler option indicator Constant throughout assembly Arithmetic expressions

Character expressions

Logical expressions

&SYSOPT_EBCDIC HLA6 C,A N G xxx option value Constant throughout assembly Arithmetic expressions

Character expressions

&SYSOPT_OPTABLE HLA3 C U G OPTABLE assembler option value Constant throughout assembly Character expressions
&SYSOPT_RENT HLA1 B N G RENT assembler option indicator Constant throughout assembly Arithmetic expressions

Character expressions

Logical expressions

&SYSOPT_UNICODE HLA6 C,A N G xxx option value Constant throughout assembly Arithmetic expressions

Character expressions

&SYSOPT_XOBJECT HLA3 B N G XOBJECT assembler option indicator Constant throughout assembly Arithmetic expressions

Character expressions

Logical expressions

&SYSPARM All C U,O G User defined or null Constant throughout assembly Arithmetic expressions if value is self-defining term

Character expressions

&SYSPRINT_DSN HLA2 C U L Current assembler listing data set name Constant throughout assembly Character expressions
&SYSPRINT_MEMBER HLA2 C U,O L Current assembler listing data set member name Constant throughout assembly Character expressions
&SYSPRINT_VOLUME HLA2 C U,O L Current assembler listing data set volume identifier Constant throughout assembly Character expressions
&SYSPUNCH_DSN HLA2 C U L Current object data set name Constant throughout assembly Character expressions
&SYSPUNCH_MEMBER HLA2 C U,O L Current object data set member name Constant throughout assembly Character expressions
&SYSPUNCH_VOLUME HLA2 C U,O L Current object data set volume identifier Constant throughout assembly Character expressions
&SYSSEQF HLA1 C U,O L Outer-most macro instruction identification- sequence field Constant throughout definition Character expressions
&SYSSTEP HLA1 C U G Source module assembly job step name Constant throughout assembly Character expressions
&SYSSTMT HLA1 C,A N G Next statement number Assembler increments each time a statement is processed Arithmetic expressions

Character expressions

&SYSSTYP HLA1 C U,O L Type of control section in effect where macro instruction appears Constant throughout definition; set by START, CSECT, RSECT, DSECT, or COM Character expressions
&SYSTEM_ID HLA1 C U G Assembly operating system environment identifier Constant throughout assembly Character expressions
&SYSTERM_DSN HLA2 C U L Current terminal data set name Constant throughout assembly Character expressions
&SYSTERM_MEMBER HLA2 C U,O L Current terminal data set member name Constant throughout assembly Character expressions
&SYSTERM_VOLUME HLA2 C U,O L Current terminal data set volume identifier Constant throughout assembly Character expressions
&SYSTIME AsmH C U G Source module assembly time Constant throughout assembly Character expressions
&SYSVER HLA1 C U G Assembler release level Constant throughout assembly Character expressions
Notes:
  1. Availability:
    • All refers to all assemblers, including the DOS/VSE Assembler.
    • AsmH refers to Assembler H Version 2 and High Level Assembler.
    • HLA1 refers to High Level Assembler Release 1.
    • HLA2 refers to High Level Assembler Release 2.
    • HLA3 refers to High Level Assembler Release 3.
    • HLA4 refers to High Level Assembler Release 4.
    • HLA5 refers to High Level Assembler Release 5.
    • HLA6 refers to High Level Assembler Release 6.
  2. Type:
    • A refers to Arithmetic.
    • B refers to Boolean.
    • C refers to Character.
  3. Type Attr:
    • N refers to Numeric (self-defining term).
    • O refers to Omitted.
    • U refers to Undefined, unknown, deleted, or unassigned.
  4. Scope:
    • L refers to Local - only in macro.
    • G refers to Global - in entire program.