Including message generation statements in STL programs

You may want to include one or more message generation statements in an STL program. For example, you have existing message generation decks that you want to include into an STL program. Message generation statements to be included in an STL program must be preceded by an @GENERATE statement (which can also be coded @GEN) and followed by an @ENDGENERATE statement (which can also be coded @ENDGEN). The STL Translator uses the message generation statements between the @GENERATE and @ENDGENERATE statements as input lines and places them unchanged in the output. The statements included in the message generation deck produced by the STL Translator are the output lines.

When the STL Translator finds an @GENERATE statement, it enters "generate mode." While in this mode, the translator processes subsequent lines in your STL program according to the following rules:
  1. You can include only string constants, STL variable names, and STL comments in the message generation statements included in the STL program.
  2. The STL Translator generates one output line in a message generation deck for each input line in the STL program.
  3. When the STL program is translated, the STL Translator copies string constants directly into the output line. You can use named constants in your input statements. Their declared values are substituted for the constant name.
  4. STL variable names are replaced by the save areas, counters, and switches used to represent them in message generation statements.
  5. No syntax checking is done and offsets are not added for save areas when the save area number is included as a variable name.
  6. The output line resulting from the translation must not contain more than 72 characters. Longer output lines result in an error message. Thus, when coding input lines, you must be sure that expansion of named constants and variable names will not result in an output line that is too long.
  7. When the STL Translator finds an @ENDGENERATE statement, generate mode ends.
  8. While in generate mode, the STL Translator assigns a new message generation statement number to each output line that does not begin with 15 blanks. Be sure to code 15 blanks at the beginning of each line that does not begin a new message generation statement. For example, if you want to continue a line, make sure the continued line begins with at least 15 blanks. Failure to do this can cause errors when tracing your STL program.
  9. The LABEL message generation statement should not be coded. It causes errors when tracing your STL program.
Note: WSim interprets a non-blank character in column 1 of an output message generation statement as a label. Be careful to include leading blanks in your generate mode input where necessary.

The example below shows how to use the @GENERATE statement in an STL program. This example calls a user exit routine.

Input lines are coded as string constants. Input lines must be enclosed in STL string delimiter characters (either single or double quotation marks).

Rules for using string delimiter characters in input lines differ from those used for STL statements. See @GENERATE for an explanation of these rules.
example: msgtxt
/***********************************************************************/
/*                     @GENERATE Example                               */
/* Notice that message generation statements are coded as string       */
/* constants.                                                          */
************************************************************************/
 .
 .
 .
@generate
'         DATASAVE AREA='stringvar',TEXT=($RECALL,U+0,8$)'
@endgenerate
 .
 .
 .
endtxt
Note: If you code a network definition in your STL input, you can also include message generation decks between the @NETWORK and @ENDNETWORK statements. See Including network definition statements in STL for more information.