HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

AREAD Instruction Assign Local Time ►►──SETC_symbol──AREAD──┬─CLOCKB─┬─────────────────────────────────►◄ └─CLOCKD─┘ SETC_symbol is a SETC symbol. See “SETC Instruction” on page 369. NOSTMT specifies that the statement to be read by the AREAD instruction is printed in the assembly listing, but not given any statement number. NOPRINT specifies that the statement does not appear in the listing, and no statement number is assigned to it. CLOCKB assigns an 8-character string to SETC_symbol containing the local time in hundredths of a second since midnight. CLOCKD assigns an 8-character string to SETC_symbol containing the local time in the format HHMMSSTH, where HH is a value between 00 and 23, MM and SS each have a value between 00 and 59, and TH has a value between 00 and 99. Assign Character String Value 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 statements can be read into the macro for processing. SETC_symbol may be subscripted. When the assembler encounters a Format-1 AREAD statement during the processing of a macro instruction, it reads the source statement following the macro instruction and assigns an 80-character string to the SETC symbol in the name field. In the case of nested macros, it reads the statement following the outermost macro instruction. If no operand is specified, the statement 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 statements. 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: 258 HLASM V1R5 Language Reference

ASPACE Instruction &VAL &VAL1 MACRO MAC1 . AREAD . 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 appears in such code. If no more records exist in the code brought in by the COPY instruction, subsequent statements are read from the AINSERT buffer or the primary input stream. Assign Local Time of Day The second format of AREAD functions in much the same way as a SETC instruction, but instead of supplying the value you want assigned to the SETC symbol as a character string in the operand of the AREAD instruction, the value is provided by the operating system in the form of an 8-character string containing the local time. A Format-2 AREAD instruction does not cause the assembler to read the statement following the macro instruction. Example: MACRO MAC2 . &VAL AREAD CLOCKB DC C'&VAL' &VAL1 AREAD CLOCKD DC C'&VAL1' . MEND When the macro definition described above is called, the following statements are generated: MAC2 + DC C'32514' + DC C'9154' ASPACE Instruction Use the ASPACE instruction to insert one or more blank lines in the listing of a macro definition in your source module. This separates sections of macro definition code on the listing page. ►►──┬─────────────────┬──ASPACE──┬─────────────────┬───────────────►◄ └─sequence_symbol─┘ └─number_of_lines─┘ Chapter 7. How to Specify Macro Definitions 259

ASPACE Instruction<br />

&VAL<br />

&VAL1<br />

MACRO<br />

MAC1<br />

.<br />

AREAD<br />

.<br />

AREAD<br />

.<br />

MEND<br />

CSECT<br />

.<br />

MAC1<br />

INRECORD1 THIS IS THE STATEMENT TO BE PROCESSED FIRST<br />

INRECORD2 THIS IS THE NEXT STATEMENT<br />

.<br />

END<br />

The records read by the AREAD instruction can be in code brought in with the<br />

COPY instruction, if the macro instruction appears in such code. If no more<br />

records exist in the code brought in by the COPY instruction, subsequent<br />

statements are read from the AINSERT buffer or the primary input stream.<br />

Assign Local Time of Day<br />

The second format of AREAD functions in much the same way as a SETC<br />

instruction, but instead of supplying the value you want assigned to the SETC<br />

symbol as a character string in the operand of the AREAD instruction, the value is<br />

provided by the operating system in the form of an 8-character string containing the<br />

local time. A Format-2 AREAD instruction does not cause the assembler to read<br />

the statement following the macro instruction.<br />

Example:<br />

MACRO<br />

MAC2<br />

.<br />

&VAL AREAD CLOCKB<br />

DC C'&VAL'<br />

&VAL1 AREAD CLOCKD<br />

DC C'&VAL1'<br />

.<br />

MEND<br />

When the macro definition described above is called, the following statements are<br />

generated:<br />

MAC2<br />

+ DC C'32514'<br />

+ DC C'9154'<br />

ASPACE Instruction<br />

Use the ASPACE instruction to insert one or more blank lines in the listing of a<br />

macro definition in your source module. This separates sections of macro definition<br />

code on the listing page.<br />

►►──┬─────────────────┬──ASPACE──┬─────────────────┬───────────────►◄<br />

└─sequence_symbol─┘<br />

└─number_of_lines─┘<br />

Chapter 7. How to Specify Macro Definitions 259

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!