TRANSLATE – Define rules for life-cycle translation
Use the TRANSLATE
command to set
up a series of rules to translate values of specific fields, or types
of fields in the Batch Loader output generated by Workload Automation Programming Language.
This command affects only Batch Loader output.
TRANSLATE [[<type>|<field>] OLD(<name>) NEW(<name>)]
[[<type>|<field>] LIST(<member>) [DLM(=|<char>)]]
[[<type>|<field>] FILTER(<mask>) OVERLAY(<mask>)]
[[<type>|<field>] RULES(<member>) [DLM(=|<char>)]]
[OFF|ON]
TRANSLATE
command can generate
a single rule, or reference a set of rules, for an individual field
or type of field. The following list shows the available types of
field:AD
- Application name
CL
- Calendar name
JS
- Job name
OW
- Owner ID
PR
- Period name (includes Run Cycle Group Name)
SR
- Special Resource Name
- When processing
TRANSLATE
rules, Workload Automation Programming Language first checks if anOLD
/NEW
pair of keywords is defined for the field. AFILTER
/OVERLAY
pair is processed only if there is no matching pair ofOLD
/NEW
keywords. - The content of the
ETTNAME
field is automatically considered to be a field of typeSR
whenETTTYPE
is set toR
andJS
whenETTYPE
is set toJ
. - The content of the
ADRPER
field is automatically considered to be a field type of PR whenADRTYPE
is set toN
orX
, otherwise the field type is not set. - Periods contained within rule text are translated for run cycles in Applications and Run Cycle Groups.
The following restrictions apply to the TRANSLATE
command:
TRANSLATE
rules can act only upon the value of the field being translated. You cannot define a rule that relies upon the value of other fields.- The
ETTNAME
field can contain both job names and application names, if you define a rule specifically for the fieldETTNAME
you must consider this in the design of your rules, because the automatic detection of the content type will be overridden by your rule. - The
ADRPER
field can contain both period names or just run cycle names, if you define a rule specifically for the fieldADRPER
you must consider this in the design of your rules, because the automatic detection of the content type will be overridden by your rule.
The following types of rule exist:
- Absolute rules look for an
OLD
value and exchange it for aNEW
value. An entire set of absolute rules can be defined at the same time by using theLIST
keyword to refer to an external member containing a line for eachOLD
/NEW
pair separated by an equal sign (=). - Filter rules look for entries matching the
FILTER
andOVERLAY
a mask on the first match. A whole set of filter rules can be defined at the same time by using theRULES
keyword to refer to an external member containing a line for eachFILTER
/MASK
pair separated by the equal sign (=). - To provide multiple absolute or filter rules for the same field type, you can
set multiple
OLD/NEW
andFILTER/OVERLAY
keyword pairs in the sameTRANSLATE
statement.
The TRANSLATE OFF
command can be used to
stop the existing rules being processed in any commands that follows.
Then issue a TRANSLATE ON
command to turn
processing back on at a later point in the SYSIN. Defining any new
rule with the TRANSLATE
command will also
turn translation processing back on, if it had been turned off.
When a field is being processed for translation, the following actions are taken:
- The field value is checked for an entry in the absolute list. If one is found, the new value is substituted at this point, and the new value is passed on for filter processing.
- Each filter value is checked, in the order they were defined, for a match. If a match is found then no more filter rules are evaluated.
- If a match was made the
OVERLAY
value is used to modify the value.
The FILTER
and OVERLAY
keywords
can be a combination of characters and the following wildcard characters:
- Percent sign (%) equates to any single character.
- Asterisk (*) equates to any number of characters.
For example:
FILTER(Z*)
looks for anything beginning with Z.
FILTER(%%P*)
looks for anything with P in the
third position.
FILTER(%%P*) OVERLAY(%%T*)
replaces P in the third
character position with T.
The order of filter rules is important, you can use some rules
to exclude certain values from processing, by giving the FILTER
and
the OVERLAY
keywords the same value.
TRANSLATE JS FILTER(Z*) OVERLAY(Z*)
FILTER(%%T*) OVERLAY(%%P*)