:GENERATE
Use the :GENERATE statement to control how script lines are handled during execution. It lets you specify which script lines are processed when restart points are defined, and whether data lines are written in uppercase or lowercase.
Important Considerations
Restarting executable objects
The generation mode defined in a :GENERATE statement controls how script lines are handled when an executable object is restarted. The mode remains in effect until one of the following is processed: the next :GENERATE statement containing a generation mode, or the next :RESTART statement.
When an object is restarted without a :GENERATE statement, all script lines up to the first :RESTART statement are processed, as well as all lines after the specified restart point.
Uppercase and lowercase characters
With the exception of script variables, text in data lines is left untouched and transferred to the target system as-is. Variables are replaced with their values when the object is activated. For more information, see Data Lines and Job Control Language.
Some target systems require data lines to be formatted in a specific way.
Syntax
: GEN[ERATE] generation mode
Parameters
| Parameter | Description | Allowed Values |
|---|---|---|
| generation mode | Controls how script lines are processed during execution |
|
Examples
The following example defines three restart points with :RESTART statements and uses :GENERATE statements to control which lines are processed on restart.
: PRINT "Script start"
: RESTART R1
: PRINT "Point R1"
: GENERATE ON_RESTART_ALWAYS
: PRINT "ON_RESTART_ALWAYS"
: GENERATE ON_RESTART_CHECK
: RESTART R2
: PRINT "Point R2"
: RESTART R3
: PRINT "Point R3"
: GENERATE ON_RESTART_NEVER
: PRINT "Script end"
When the object restarts at restart point R1, the following lines are printed in the activation report:
2005-01-31 12:17:05 - U0020408 Script start
2005-01-31 12:17:05 - U0020408 Point R1
2005-01-31 12:17:05 - U0020408 ON_RESTART_ALWAYS
2005-01-31 12:17:05 - U0020408 Point R2
2005-01-31 12:17:05 - U0020408 Point R3
When the object restarts at restart point R2, the following lines are printed:
2005-01-31 12:17:23 - U0020408 Script start
2005-01-31 12:17:23 - U0020408 ON_RESTART_ALWAYS
2005-01-31 12:17:23 - U0020408 Point R2
2005-01-31 12:17:23 - U0020408 Point R3
When the object restarts at restart point R3, the following lines are printed:
2005-01-31 12:17:48 - U0020408 Script start
2005-01-31 12:17:48 - U0020408 ON_RESTART_ALWAYS
2005-01-31 12:17:48 - U0020408 Point R3
The following example converts data line text to uppercase.
: GEN UPPER_CASE
fs $AE.
See also: