Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Item translation z/OS ISPF Dialog Tag Language Guide and Reference SC19-3620-00 |
|
Allows you to translate an internal variable value to a displayed value (or vice-versa) on an item-for-item basis. To specify this translation, either code FORMAT=NONE on the XLATL tag or omit the FORMAT attribute because this is the default. You define the list of possible internal values and the corresponding display values they should be translated to, or from, using the XLATI (translate item) tags nested within the XLATL tag. To specify an internal value (the value in the variable pool) for a translate item, use the VALUE attribute on the XLATI tag. The XLATI tag text specifies what the user sees (for output) and enters (for input). The display value is the XLATI tag text. If a display value of all blanks or a display value in which leading, trailing, or embedded blanks are preserved is desired, use the literal (LIT) tag and its required end tag to indicate that blanks are significant. An explicit match is achieved during translation processing as
follows:
Omitting both the internal value and the display value does not produce an explicit match. This case is discussed further on in this topic. Translate list processing is case-sensitive. To ensure that a match results when the user enters the correct display value but in a different or mixed case, code an uppercase conversion translate list before the value translate list. Here is an example where the variable class dayc uses
an internal value for days of the week that is different from the
display value. The comparisons are on uppercase values, because FORMAT=UPPER
is provided before the item translation list.
This figure shows how variable values of variable class dayc are translated on input and output. Figure 1. Variable translation
The previous example shows one translate list with a finite number of translation items. This example assumes that the only possible internal values are 1-7 and the only possible display values are the days of the week. For input fields, a match must be found in this list, or the translation fails and message liba004 is displayed to the user. Here is an example which allows allow a nonmatching value to be
passed on for further processing (either to another translate list
or to the validity checks that follow) by coding an XLATI tag without
an internal value or a display value, to indicate that any value is
acceptable:
Because multiple translate lists are permitted, we can expand this
example to accept either the days of the week spelled out or their
accepted abbreviations. Because the last XLATI tag in the first translate
list has no internal or displayed value, the input value are passed
on for further translate list or validity checking.
It is possible to omit only the internal value to indicate that any internal value is acceptable. This affects input and output translate processing differently. When translating on input, the value is not translated before being stored in the variable pool. When translating on output, any value not already matched is translated to the displayed value. In the following example, the branchc variable
class illustrates translate processing when only the internal value
is omitted.
Figure 2. Variable translation
It is also possible to omit only the display value to indicate that any display value is acceptable. This affects input and output translate processing differently. When translating on input, any value not already matched is translated to the internal value. When translating on output, the internal value is not translated before it is displayed. Here is a similar example, but with the branchc variable
class changed, to show translate processing when only the display
value is omitted:
Figure 3. Variable translation
It is possible to specify that less than the full input value be entered by the use of the TRUNC attribute. Output translation is not affected. We'll change the branchc variable class again to illustrate:
Figure 4. Variable translation
|
Copyright IBM Corporation 1990, 2014
|