Script Statement: This controls the processing of script lines during the execution of a script.
:GEN[ERATE]Generation Mode
Syntax |
Description/Format |
---|---|
Generation Mode |
Generation modes for restarts:
Generation modes for DATA lines:
|
Various expressions can be passed on to the :GENERATE statement as Generation Modes. On the one hand, a Generation Mode controls the handling of the script lines when an executable object is restarted. On the other hand, they can be used to determine whether DATA lines should be written in uppercase or lowercase letters.
Restarting executable objects
The Generation Mode can be used when restarting an executable object in order to define the handling of script lines during script execution. This definition is valid until
If :GENERATE is not used for restarting an object, all script lines until the first :RESTART statement will be processed and also all lines that are located after the indicated restart point.
Uppercase and lowercase characters
Text in DATA lines is generally left untouched and transferred to the target system as it was. Script variables -which can be part of DATA lines- are exempted. They are supplied with values (in modified form) with the activation of an object that contain such a script.
Some target systems require the DATA lines to be in a certain format. The operating system BS2000, for example, processes JCL statements (Job Control Language) only when they are capitalized which means that any command would have to be formatted in the Automation Engine. The :GENERATE statement provides several generation modes so that restrictions of the specific target system can be avoided when writing scripts.
The first example shows how :GENERATE can be used for restarting an object and then the different report outputs resulting from the specified restart points are listed.
: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"
Restart with R1:
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
Restart with R2:
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
Restart with R3:
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
In the following example, the text of the DATA lines is converted to uppercase letters.
:GEN UPPER_CASE
fs $AE.
See also:
Script element | Description |
---|---|
This is used to set restart points in an executable object. |
Script Elements - Script Structure and Processing
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by function