FIND MACRO or FIND COPY

The assembler calls the exit with a request type of 7 (FIND MACRO) whenever the assembler cannot find an operation code and the exit issued a return code on OPEN of either 4 or 8. The member name field contains the operation code, and is the name of the macro definition that the assembler is searching for.

The assembler calls the exit with a request type of 8 (FIND COPY) whenever the assembler processes a COPY instruction and the exit issued a return code on OPEN of either 4 or 8. The member name field contains the name of the copy code member.

If the user exit is supplying the library records, the exit can set the return code in the Exit Parameter List to one of the following:

0
Indicates that the exit supplies the library records. The assembler calls the user exit with later READ calls to retrieve each record.
Note:
A reason code of 8 requests redrive of the exit.
4
Indicates that the exit is not supplying the macro or copy member, and is equivalent to not finding the member in the library.
Note:
A reason code of 8 requests redrive of the exit.

If both the assembler and the user exit are supplying the library records, the exit can set the return code in the Exit Parameter List to one of the following:

0
Indicates that the exit supplies the library records. The assembler calls the user exit with later READ calls to retrieve each record.
Note:
A reason code of 8 requests redrive of the exit.
4
Indicates that the exit is not supplying the macro or copy member, and is equivalent to not finding the member in the library. On return from the exit, the assembler attempts to find the member in the library. If the assembler finds the member, it calls the user exit with later PROCESS MACRO or PROCESS COPY calls passing each record read from the library.
Note:
A reason code of 8 requests redrive of the exit.

System variables

If you wish to provide the assembler with the values for the system variables &SYSLIB_DSN, &SYSLIB_MEMBER, and &SYSLIB_VOLUME, the user exit must set the return code to 0, the reason code to 4, and place the values in the data set name, member name, and volume serial fields of the exit-specific information block.

If the exit does not supply the data set information, the system variables are set to null, and the library data set details are not shown in the Diagnostic Cross Reference and Assembler Summary section of the listing, nor are they included in the ADATA Library record.

Nesting COPY instructions and macro definitions

The assembler lets you code COPY instructions and macro call instructions in copy code members. It also lets you code COPY instructions in macro definitions. This type of coding is described as nesting.

If the exit is processing a member, and supplies a record to the assembler containing a COPY instruction, or a macro call instruction, the assembler calls the exit with a request type of FIND COPY or FIND MACRO, respectively. In this case, the exit needs to save the position in the currently active member before reading the new copy code or macro member. This enables the exit to resume processing the currently active member after it finishes with the new member.

The assembler indicates that it is processing a new (or nested) member by setting the options field to 3. When the assembler finishes processing the new member and resumes the previous (or outer) member, it issues a FIND call to the exit with the options field set to 2 indicating that the previous member is resumed. After the FIND call is complete, the assembler continues with PROCESS or READ calls to the exit for the previous member.

When the assembler calls the exit with a FIND COPY or FIND MACRO request, and the options field is set to 3, the exit should save the current member control information in a stack.

When the assembler calls the exit with a FIND COPY or FIND MACRO request, and the options field is set to 2, the exit should restore the previous member control information from the stack. The next READ request expects the next record from the previous member.

The assembler does not limit the number of levels of nesting.

There is a corresponding FIND (resume) request for every successful nested FIND request, except under the following situations:

If the FIND COPY or FIND MACRO is unsuccessful, the position in the currently active member should not be affected.


[ Top of Page | Previous Page | Next Page | Contents | Index ]