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
TRANSLATErules, Workload Automation Programming Language first checks if anOLD/NEWpair of keywords is defined for the field. AFILTER/OVERLAYpair is processed only if there is no matching pair ofOLD/NEWkeywords. - The content of the
ETTNAMEfield is automatically considered to be a field of typeSRwhenETTTYPEis set toRandJSwhenETTYPEis set toJ. - The content of the
ADRPERfield is automatically considered to be a field type of PR whenADRTYPEis set toNorX, 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:
TRANSLATErules 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
ETTNAMEfield can contain both job names and application names, if you define a rule specifically for the fieldETTNAMEyou must consider this in the design of your rules, because the automatic detection of the content type will be overridden by your rule. - The
ADRPERfield can contain both period names or just run cycle names, if you define a rule specifically for the fieldADRPERyou 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
OLDvalue and exchange it for aNEWvalue. An entire set of absolute rules can be defined at the same time by using theLISTkeyword to refer to an external member containing a line for eachOLD/NEWpair separated by an equal sign (=). - Filter rules look for entries matching the
FILTERandOVERLAYa mask on the first match. A whole set of filter rules can be defined at the same time by using theRULESkeyword to refer to an external member containing a line for eachFILTER/MASKpair separated by the equal sign (=). - To provide multiple absolute or filter rules for the same field type, you can
set multiple
OLD/NEWandFILTER/OVERLAYkeyword pairs in the sameTRANSLATEstatement.
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
OVERLAYvalue 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*)