The XLATI tag defines an individual list
element in a translate list.
Syntax
>>-<XLATI--+----------------------+-->--+-----------------+----->
'-VALUE=internal-value-' '-displayed-value-'
>--+----------+------------------------------------------------><
'-</XLATI>-'
Parameters
- VALUE=internal-value
- ISPF
saves this value in the variable pool when translating on input and
retrieves it from the variable pool when translating on output. If
the internal-value contains characters other
than A-Z, a-z, and 0-9, you must enclose the value in quotes.
Omitting
this attribute indicates that any value is acceptable. When translating
on input, ISPF does not translate the displayed-value before
storing it in the pool. When translating on output, ISPF translates
to the displayed-value any value that is
not already matched.
- displayed-value
- This attribute specifies the displayed value that must be matched
when doing a translation on input and the result when doing a translation
on output. The test for a translation match is case-sensitive. Any
characters, including embedded blanks, are allowed in the displayed-value.
If the value has blanks that you want preserved, or the value consists
of only blanks, the value should be coded within the LIT (Literal)
tag. If the LIT tag is not used, all blanks are stripped and any value
with only blanks indicated that no value was specified.
Omitting
this value indicates that any value is acceptable. When translating
on output, this means that the internal-value is
not to be translated before being displayed. When translating on input,
it means that any value not already matched is to translate to the internal-value.
Comments
The
XLATI tag defines an individual list element in a translate list.
As many XLATI tags as are necessary (up to a limit of 126) to accomplish
the desired translation can be included within the translation list.
Each
XLATI tag provides information necessary to translate a displayed-value to
an internal-value and vice versa. Translation
is done in the order given by the tags. Translation stops when a match
is found. An XLATI tag that omits both internal-value and displayed-value has
this effect: when translating on output the variable value is displayed,
and when translating on input the entered value is stored in the variable.
The
ISPF TRANS() function is used for all translations. When translating
on output, ISPF )INIT panel logic translates the internal-value to
the displayed-value. When translating on
input, ISPF )PROC panel logic translates the displayed-value to
the internal-value. The test for a translation
match is case-sensitive. You can code an XLATL FORMAT=UPPER definition
before an XLATL definition that contains XLATI tags to convert user
input to uppercase before the translate list is processed.
Restrictions
You
must code the XLATI tag within an XLATL definition. See XLATI (Translate Item) for a complete description of this tag.
Processing
Table 1. Tags you can code within an XLATI definitionTag |
Reference |
Usage |
Required |
---|
LIT |
LIT (Literal) |
Multiple |
No |
Examples
Here
is source file markup that contains a variable class with a translate
list that performs input and output translation on values assigned
to the winter months. The associated variable declarations and fields
are also shown.
<!DOCTYPE DM SYSTEM>
<VARCLASS NAME=monthcls type='char 3'>
<XLATL FORMAT=upper>
</XLATL>
<XLATL MSG=abcd003>
<XLATI VALUE=11>NOV
<XLATI VALUE=12>DEC
<XLATI VALUE=01>JAN
<XLATI VALUE=02>FEB
<XLATI VALUE=03>MAR
</XLATL>
<VARCLASS NAME=costcls TYPE='numeric 6' MSG=abcd001>
<VARCLASS NAME=typecls TYPE='char 4'>
<XLATL FORMAT=upper>
</XLATL>
<CHECKL MSG=abcd002>
<CHECKI TYPE=values Parm1=EQ Parm2= 'GAS OIL ELEC'>
</CHECKL>
<VARLIST>
<VARDCL NAME=month VARCLASS=monthcls>
<VARDCL NAME=cost VARCLASS=costcls>
<VARDCL NAME=heat VARCLASS=typecls>
</VARLIST>
<PANEL NAME=xlati KEYLIST=keylxmp>Heating Cost Survey
<TOPINST>Complete the information below and then press Enter.
<AREA>
<DTACOL PMTWIDTH=20 DESWIDTH=30>
<DTAFLD DATAVAR=month ENTWIDTH=3>Winter month
<DTAFLDD>Enter Nov, Dec, Jan, Feb, or Mar
<DTAFLD DATAVAR=cost ENTWIDTH=6>Heating cost
<DTAFLD DATAVAR=heat ENTWIDTH=4>Type of heating
<DTAFLDD>Enter Oil, Gas, or Elec
</DTACOL>
</AREA>
<BOTINST>Thank you for your participation.
</PANEL>
<MSGMBR NAME=abcd00>
<MSG SUFFIX=1>Heating cost must be numeric
<MSG SUFFIX=2>Type of heating must be "Gas", "Oil", or "Elec"
<MSG SUFFIX=3>Winter month must be "Nov","Dec", "Jan", "Feb", or "Mar"
</MSGMBR>