Generating END statements

Because no variable symbol substitution is carried out during lookahead, consider the following effects of using macro, AINSERT or open code substitution to generate END statements that separate source modules assembled in one job step (BATCH assembler option). If a symbol is undefined within a module, lookahead might read statements past the point where the END statement is to be generated. Lookahead stops when:
  1. It finds the symbol
  2. It finds an END statement
  3. It reaches the end of the source input data set
In the first two cases, the assembler begins the next module at the statement after lookahead stopped, which might be after the point where you wanted to generate the END statement.