IBM i translators

A translator defines a remote command performed on a file during a build. The command used is based on whether the object exists.

You can select and order translators in a language definition. During a build, each translator in a given language definition is invoked for every file associated with that language definition. You can create translators from the Team Artifacts view by expanding these nodes: Enterprise Extensions > System Definitions > IBM i > Language Definitions. Optionally, you can select File > New > Other > Enterprise Extensions > IBM i > Translator from the main menu.

Each translator represents an operation that must be performed on buildable files that are associated with a language definition. For example, if you wanted to compile a CLP source member into a *PGM object and subsequently change the object ownership of that *PGM object, that CLP source member might be associated with a language definition which contains two translators: one for compiling the CLP source, and another to execute the CHGOBJOWN command on the *PGM object.

Variables can be used in the translator command strings. Variables have the following characteristics:
  1. Variables appear in command lines preceded by the "&" symbol. A variable name is terminated by a white space or an optional ".".  The optional "." can be used in the cases where you want the variable value to be immediately followed by a non white space character. Example: "&DAY.DAY" could expand at build time to "MONDAY".
  2. There are several special variables as shown in the following table.
     Name    Description   Usage
    &F Physical file name (internal)
    &L Library name (internal)
    &N Member name (internal)
    &X Object description (internal)
    &SRCLIB Source library (internal)
    &OBJLIB Object library (internal)
    &SP Search path (internal)
    &O Output name (internal)
    &*_ATTRIBUTE Values gathered from link-edit files (calculated)
  3. User variables must have their default values assigned in the translator.
  4. Variable values can be overridden at two places:
    • At the source control level through Engineering Workflow Management. Values entered here have highest precedence.
    • At the build definition level. Values entered here have second highest precedence. Notice that variables are entered in the standard Properties user interface. Variable names must be qualified with the prefix
  5. Variable substitution occurs at build time. You can examine the expanded command strings in the build log. With the RPGLE translator, the following list shows the variable substitutions that take place at build time:
    • The command that is specified in the translator editor
    • The command that is expanded during build time

Link-Edit file support is an extension of variable support and important in IBM i dependency builds. Link-Edit support enables you to specify command attributes in source members.

To use the Link-Edit support in a translator, select the Inspect built object and update build map option in the translator. Link-edit variable names should use the "_ATTRIBUTE" suffix. Attributes can be referenced as variables in translator Commands fields. Attribute variables used in command strings are substituted with the values extracted from the link-edit file at build time. Expanded command strings can be found in the build log file.

video icon Video channel
Software Education channel

learn icon Courses

IoT Academy
Skills Gateway

ask icon Community forums library

support icon Support

IBM Support Community
Deployment wiki