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.
- You can include only string constants, STL variable names, and STL comments in the message generation statements included in the STL program.
- The STL Translator generates one output line in a message generation deck for each input line in the STL program.
- 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.
- STL variable names are replaced by the save areas, counters, and switches used to represent them in message generation statements.
- No syntax checking is done and offsets are not added for save areas when the save area number is included as a variable name.
- 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.
- When the STL Translator finds an @ENDGENERATE statement, generate mode ends.
- 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.
- The LABEL message generation statement should not be coded. It causes errors when tracing your STL program.
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).
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