The AINSERT instruction inserts records into the input stream. These records are queued in an internal buffer until the macro generator has completed expanding the current outermost macro instruction. At that point the internal buffer queue provides the next record or records. An operand controls the sequence of the records within the internal buffer queue.
|
The rules that apply to this character string are:
Example:
MACRO
MAC1
.
.A AINSERT 'INSERT RECORD NUMBER ONE',FRONT Insert record into the input stream
.B AINSERT 'INSERT RECORD NUMBER TWO',FRONT Insert record at the top of the input stream
.C AINSERT 'INSERT RECORD NUMBER THREE',BACK Insert record at the bottom of the input stream
.
.
.
&FIRST AREAD Retrieve record TWO from the top of the input stream
.
.D AINSERT 'INSERT RECORD NUMBER FOUR',FRONT Insert record at the top of the input stream
.
&SECOND AREAD Retrieve record FOUR from the top of the input stream
.
MEND
CSECT
.
MAC1
.
ENDIn this example the variable &FIRST receives the operand of the AINSERT statement created at .B. &SECOND receives the operand of the AINSERT statement created at .D. The operand of the AINSERT statements at .A and .C are in the internal buffer in the sequence .A followed by .C and are the next statements processed when the macro generator has finished processing.
[ Top of Page | Previous Page | Next Page | Contents | Index ]