HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Assign character string value

HLASM Language Reference
SC26-4940-06

The first format of AREAD functions in much the same way as symbolic parameters, but instead of providing your input to macro processing as part of the macro instruction, you can supply full input records from either the AINSERT buffer (if any are present), or from the records in the primary input stream that follow immediately after the macro instruction. Any number of successive records can be read into the macro for processing. If no records remain, a null value is assigned, but no diagnostic message is issued.

SETC_symbol can be subscripted. When the assembler encounters a Format-1 AREAD statement during the processing of a macro instruction, it reads the source record following the macro instruction and assigns an 80-character string to the SETC symbol in the name field. For nested macros, it reads the record following the outermost macro instruction.

If no operand is specified, the record to be read by AREAD is printed in the listing and assigned a statement number. The AREAD action is indicated in the listing by a minus sign between the statement number and the first character of the record.

Repeated AREAD instruction statements read successive records. In the following example, the input record starting with INRECORD1 is read by the first AREAD statement, and assigned to the SETC symbol &VAL. The input record starting with INRECORD2 is read by the second AREAD statement, and assigned to the SETC symbol &VAL1.

Example:
         MACRO
         MAC1
         .
&VAL     AREAD
         .
&VAL1    AREAD
         .
         MEND
         CSECT
         .
         MAC1
INRECORD1 THIS IS THE STATEMENT TO BE PROCESSED FIRST
INRECORD2 THIS IS THE NEXT STATEMENT
         .
         END

The records read by the AREAD instruction can be in code brought in with the COPY instruction, if the macro instruction employing the AREAD appears in the COPY member. Otherwise the COPY instruction may be read as an ordinary text line.

If no more records exist in the code brought in by the COPY instruction, subsequent records are read from the AINSERT buffer or the primary input stream.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014