Specifying Multilingual Metadata in a Master File

How to:

Reference:

The FILE declaration in a Master File can have a REMARKS or DESCRIPTION attribute that displays when browsing through Master Files using front-end tools, such as the App Studio Report canvas. Each FIELD declaration can have a DESCRIPTION attribute that provides documentation about that field and can be displayed instead of the field name in those tools. A FIELD declaration can also specify a TITLE attribute that provides a default column heading (title) in a report.

Master Files support descriptions in multiple languages. The description used depends on the value of the LANG parameter and whether a DESC_ln attribute is specified in the Master File, where ln identifies the language to which the description applies. In order to display these descriptions properly, all of the languages used must be consistent with your NLS configuration.

In a report, a column's heading is determined by:

  1. A heading specified in the report request using the AS phrase.
  2. A TITLE attribute in the Master File, if no AS phrase is specified in the request and SET TITLES=ON.
  3. The field name specified in the Master File, if no AS phrase or TITLE attribute is specified, or if SET TITLES=OFF.

Syntax: How to Specify Multilingual DESCRIPTION and TITLE Attributes

For a file declaration in a Master File, use the following syntax:

FILE = filename,
   .
   .
   .
{REMARKS|DESC} = default_desc 
DESC_ln = desc_for_ln 
   .
   .
   .
FIELDNAME = field, ...
   .
   .
   .
TITLE = default_column_heading 
TITLE_ln = column_heading_for_ln 
   .
   .
   .
DESC = default_desc 
DESC_ln = desc_for_ln 
   .
   .
   .

For a field declaration in a Master File, use the following syntax:

FIELDNAME = field, ...
   .
   .
   .
TITLE = default_column_heading 
TITLE_ln = column_heading_for_ln 
   .
   .
   .
DESC = default_desc 
DESC_ln = desc_for_ln 
   .
   .
   .

where:

field

Is a field in the Master File.

default_column_heading

Is the column heading to use when SET TITLES=ON and either the LANG parameter is set to the default language for the server, or another language is set but the Master File has no corresponding TITLE_ln attribute for that field. This column heading is also used if an the ln value is invalid.

TITLE_ln

Specifies the language to which the associated column heading applies.

column_heading_for_ln

Specifies the text of the column heading for the specified language. That column heading is used when SET TITLES=ON, the LANG parameter is set to a non-default language for the server, and the Master File has a corresponding TITLE_ln attribute, where ln is the two-digit code for the language specified by the LANG parameter. Valid values for ln are the two-letter ISO 639 language code abbreviations.

default_desc

Is the description to use when either the LANG parameter is set to the default language for the server, or another language is set but the Master File has no corresponding DESC_ln attribute for that field. This description is also used if an the ln value is invalid.

DESC_ln

Specifies the language to which the associated description applies.

desc_for_ln

Specifies the description text for the specified language. This description is used when the LANG parameter is set to a non-default language for the server and the Master File has a corresponding DESC_ln attribute. Valid values for ln are two-letter ISO 639 language code abbreviations, as shown in the following table.

Language Name

Two-Letter Language Code

Three-Letter Language Abbreviation

Arabic

ar

ARB

Baltic

lt, lv

BAL

Chinese - Simplified GB

zh

PRC

Chinese - Traditional Big-5

tw

ROC

Czech

cs

CZE

Danish

da

DAN

Dutch

nl

DUT

English - American

en

AME or ENG

English - UK

uk

UKE

Finnish

fi

FIN

French - Canadian

fc

FRE

French - Standard

fr

FRE

German - Austrian

at

GER

German - Standard

de

GER

Greek

el

GRE

Hebrew

iw

HEW

Italian

it

ITA

Japanese - Shift-JIS(cp942) on ascii cp939 on EBCDIC

ja

JPN

Japanese - EUC(cp10942) on ascii (UNIX)

je

JPE

Korean

ko

KOR

Norwegian

no

NOR

Polish

pl

POL

Portuguese - Brazilian

br

POR

Portuguese - Portugal

pt

POR

Russian

ru

RUS

Spanish

es

SPA

Swedish

sv

SWE

Thai

th

THA

Turkish

tr

TUR

Syntax: How to Activate the Use of a Language

Issue the SET LANG command in a supported profile, on the command line, or in a FOCEXEC to set the language of error messages when set for a Reporting Server and localize report titles if the Master File contains alternate language TITLE attributes.

For information on using SET LANG to localize a report, see Creating Multi-Locale Applications.

The syntax is as follows:

SET LANG = lng

or

SET LANG = ln
In the nlscfg.err NLSCGF ERRORS configuration file, issue the following command:
LANG = lng

where:

lng

Is the three-letter abbreviation for the language.

ln

Is the two-letter ISO language code.

Note: If SET LANG is used in a procedure, its value will override the values set in nlscfg.err or in any profile.

Reference: Usage Notes for Multilingual Metadata

  • To generate the correct characters, all languages used must be on the code page specified at server startup. To change the code page, you must stop and restart the server with the new code page.
  • Master Files should be stored using the server code page used by FOCUS.
  • Multilingual descriptions are supported with all fields described in the Master File, including DEFINE and COMPUTE fields.
  • The user must create the NLSCFG file. On z/OS, the NLSCFG file must be a member in the concatenation of data sets allocated to DDNAME ERRORS. On z/VM, it must have filetype ERRORS.
  • If you issue a HOLD command, only one TITLE attribute is propagated to the HOLD Master File. Its value is the column heading that would have appeared on the report output.

Example: Using Multilingual Descriptions in a Master File

The following Master File for the CENTINV data source specifies French descriptions (DESC_FR) and Spanish descriptions (DESC_ES) as well as default descriptions (DESC) for the PROD_NUM and PRODNAME fields:

FILE=CENTINV, SUFFIX=FOC, FDFC=19, FYRT=00
 SEGNAME=INVINFO, SEGTYPE=S1, $
  FIELD=PROD_NUM, ALIAS=PNUM, FORMAT=A4, INDEX=I,
   DESCRIPTION='Product Number'
   DESC='Product Number',
   DESC_ES='Numero de Producto',
   DESC_FR='Nombre de Produit', $
  FIELD=PRODNAME, ALIAS=PNAME, FORMAT=A30,
   WITHIN=PRODCAT,
   DESCRIPTION='Product Name'
   DESC_FR='Nom de Produit',
   DESC_ES='Nombre de Producto', $
  FIELD=QTY_IN_STOCK, ALIAS=QIS, FORMAT=I7,
   DESCRIPTION='Quantity In Stock', $
  FIELD=PRICE, ALIAS=RETAIL, FORMAT=D10.2,
   TITLE='Price:',
   DESCRIPTION=Price, $

Example: Using Multilingual Titles in a Request

The following Master File for the CENTINV data source specifies French titles (TITLE_FR) and Spanish titles (TITLE_ES) as well as default titles (TITLE) for the PROD_NUM and PRODNAME fields:

FILE=CENTINV, SUFFIX=FOC, FDFC=19, FYRT=00
 SEGNAME=INVINFO, SEGTYPE=S1, $
  FIELD=PROD_NUM, ALIAS=PNUM, FORMAT=A4, INDEX=I,
   TITLE='Product,Number:',
   TITLE_FR='Nombre,de Produit:',
   TITLE_ES='Numero,de Producto:',
   DESCRIPTION='Product Number', $
  FIELD=PRODNAME, ALIAS=PNAME, FORMAT=A30,
   WITHIN=PRODCAT,
   TITLE='Product,Name:',
   TITLE_FR='Nom,de Produit:',
   TITLE_ES='Nombre,de Producto:'
   DESCRIPTION='Product Name', $
  FIELD=QTY_IN_STOCK, ALIAS=QIS, FORMAT=I7,
   TITLE='Quantity,In Stock:',
   DESCRIPTION='Quantity In Stock', $
  FIELD=PRICE, ALIAS=RETAIL, FORMAT=D10.2,
   TITLE='Price:',
   DESCRIPTION=Price, $

The default language for the server code page is English and, by default, SET TITLES=ON. Therefore, the following request, uses the TITLE attributes to produce column headings that are all in English:

TABLE FILE CENTINV
PRINT PROD_NUM PRODNAME PRICE
WHERE PRICE LT 200
END

The output is:

Product  Product
Number:  Name:                                 Price:
-------  -------                               ------
1004     2 Hd VCR LCD Menu                     179.00
1008     DVD Upgrade Unit for Cent. VCR        199.00
1026     AR3 35MM Camera 10 X                  129.00
1028     AR2 35MM Camera 8 X                   109.00
1030     QX Portable CD Player                 169.00
1032     R5 Micro Digital Tape Recorder         89.00

Now, issue either of the following commands to set the language to Spanish, and run the same request:

  • SET LANG = SPA
  • SET LANG = ES

The output now displays column headings from the TITLE_ES attributes where they exist (Product Number and Product Name). Where no Spanish title is specified (the Price field), the column heading in the TITLE attribute appears:

Numero        Nombre
de Producto:  de Producto:                          Price:
------------  ------------                          ------
1004          2 Hd VCR LCD Menu                     179.00
1008          DVD Upgrade Unit for Cent. VCR        199.00
1026          AR3 35MM Camera 10 X                  129.00
1028          AR2 35MM Camera 8 X                   109.00
1030          QX Portable CD Player                 169.00
1032          R5 Micro Digital Tape Recorder         89.00

WebFOCUS

Feedback