COPY instruction

Use the COPY instruction to obtain source statements from a source language library and include them in the program being assembled. You can thereby avoid writing the same, often-used sequence of code over and over.

Read syntax diagramSkip visual syntax diagram>>-+-----------------+--COPY--member---------------------------><
   '-sequence_symbol-'                
 
sequence_symbol
is a sequence symbol.
member
is an ordinary symbol that identifies a source language library member to be copied from either a system macro library or a user macro library. In open code it can also be a variable symbol that has been assigned a valid ordinary symbol.

The source statements that are copied into a source module:

Notes:
  1. The COPY instruction can also be used to copy statements into source macro definitions.
  2. The rules that govern the occurrence of assembler language statements in a source module also govern the statements copied into the source module.
  3. Whenever the assembler processes a COPY statement, whether it is in open code or in a macro definition, the assembler attempts to read the source language library member specified in the COPY statement. This means that all source language library members specified by COPY statements in a source program, including those specified in macro definitions, must be available during the assembly. The HLASM Programmer's Guide describes how to specify the libraries when you run the assembler, in these sections:
  4. If an END instruction is encountered in a member during COPY processing, the assembly is ended. Any remaining statements in the COPY member are discarded.

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