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]
     
A single 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
Note:
  1. When processing TRANSLATE rules, Workload Automation Programming Language first checks if an OLD/NEW pair of keywords is defined for the field. A FILTER/OVERLAY pair is processed only if there is no matching pair of OLD/NEW keywords.
  2. The content of the ETTNAME field is automatically considered to be a field of type SR when ETTTYPE is set to R and JS when ETTYPE is set to J.
  3. The content of the ADRPER field is automatically considered to be a field type of PR when ADRTYPE is set to N or X, otherwise the field type is not set.
  4. 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 field ETTNAME 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 field ADRPER 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 a NEW value. An entire set of absolute rules can be defined at the same time by using the LIST keyword to refer to an external member containing a line for each OLD/NEW pair separated by an equal sign (=).
  • Filter rules look for entries matching the FILTER and OVERLAY a mask on the first match. A whole set of filter rules can be defined at the same time by using the RULES keyword to refer to an external member containing a line for each FILTER/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 and FILTER/OVERLAY keyword pairs in the same TRANSLATE statement.
Note: For fields that contain an equal sign (=), you can remap the equal sign delimiter to another character by using the DLM keyword.

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:

  1. 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.
  2. 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.
  3. 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.

For example, you used names beginning with Z for all your dummy operations on a non-reporting workstation. These jobs never need to be modified. Their batch jobs begin with characters different from Z, and have the phase of the life-cycle as the third character in the job name. The following rules will convert test jobs to production jobs, without changing the names of the dummy jobs:
TRANSLATE JS FILTER(Z*) OVERLAY(Z*) 
         FILTER(%%T*) OVERLAY(%%P*)