General advantages in using macros
The main use of a macro is to insert assembler language statements into your source program each time the macro definition is called by a macro instruction. Values, represented by positional or keyword symbolic parameters, can be passed from the calling macro instruction to the statements within the body of a macro definition. The assembler can use global SET symbols and absolute ordinary symbols created by other macros and by open code.
The assembler assigns attribute values to the ordinary symbols and variable symbols that represent data. By referencing the data attributes of these symbols, or by varying the values assigned to these symbols, you can control the logic of the macro processing, and, in turn, control the sequence and contents of generated statements.
The assembler replaces the macro call with the statements generated from the macro definition. The generated statements are then processed like open code source statements.
Using macros gives you a flexibility similar to that provided by a problem-oriented language. You can use macros to create your own procedural language, tailored to your specific applications.