Problem solve Get help with specific problems with your technologies, process and projects.

Display messages, screens in a different language

Using the MSGCON keyword, you can easily display messages in different languages.

Dwight Beech

The MSGCON keyword, used in Screen Design Aid (SDA) and Report Layout Utility (RLU), is slick for displaying/reporting descriptions in different languages.

A few years ago I worked on a project installing a financials package in a foreign country. The user group wanted the ability to have application access in two languages. The display screens and reports of the software package utilized the MSGCON keyword within its source. It was quite simple to set up the screens and reports to display in a different language. The software package had all forms of text within message files (i.e. labels, error messages, report headings). The company hired translators, and they translated the text within the message files to another language.

Once the translation was complete I recompiled the display files (setting of LVLCHK *NO) into a second library. When users signed on, their language library containing compiled displays and report files would be inserted into the library list. A French-speaking user would have the library FRENCH inserted first to access the French language objects.

I have three libraries set up, ENGLISH, FRENCH and SOURCE. The ENGLISH and FRENCH libraries contain the display file object code called TESTMSGF and their respective message files called LANGUAGE. The SOURCE library contains the source files for display and report files. The display file and the CLP are both called TESTMSGF.

How the MSGCON keyword is set up

The MSGCON keyword allows you to copy a message from a message file to the display or menu you are creating.

  1. Type +M(nn), where nn is the number that determines the length of the constant, on the work screen and press Enter. The Define Message Constant display appears.
  2. Type the library name, message file name, and the message identifier for the message you want to have appear as a constant on the display you are creating and press Enter.

Note: To change the message identifier of an existing message field, type a question mark in the attribute position and press Enter. The Define Message Constant display appears.


030 -- Length of constant
TST0003 -- Message identifier
*LIBL/LANGUAGE -- Message file

The DDS source code

     A*%%TS  SD  20030110  134941  SOURCE      REL-V4R4M0  5769-PW1
     A                                      DSPSIZ(24 80 *DS3)
     A                                      MSGLOC(24)
     A                                      PRINT
     A                                      CF03(03 'EXIT PROGRAM')
     A*  92/03/18  14:49:51    SOURCE      REL-R03M00  5728-PW1
     A          R DATACTL
     A*%%TS  SD  20030110  134941  SOURCE      REL-V4R4M0  5769-PW1
     A                                  1 28MSGCON(030 TST0003 *LIBL/LANGUAGE)
     A                                      DSPATR(HI)
     A                                      DSPATR(RI)
     A                                  4 13MSGCON(015 TST0001 *LIBL/LANGUAGE)
     A                                      COLOR(BLU)
     A            @CO           30A  B  4 30
     A                                  7 13MSGCON(015 TST0002 *LIBL/LANGUAGE)
     A                                      COLOR(BLU)
     A            @ADD1         30A  B  7 30
     A            @ADD2         30A  B  8 30
     A            @ADD3         30A  B  9 30

The CLP source code

/*  TESTMSGF – Test message files commands                          */
/*                                                                  */
/*                                                                  */
/*                                                                  */
/*                                                                  */
             DCLF       FILE(TESTMSGF)

Examples of English and French screens

Figure 1: English version


Figure 2: French version

About the author: Dwight Beech is superintendent, application support, at Cameco Corp. in Saskatoon, Saskatchewan, Canada, where he manages the operation of the application support group supporting 35 business applications.


  • Does Domino/Notes have multi-language support?
    A user asks, "Can a Domino implementation support several languages or is there anything that comes close to the multi-language concept of the iSeries?" Site expert John Brandt outlines what Domino is capable of.
  • Why can't I get my printer to print Chinese characters?
    This user created a remote output queue in iSeries. He then sends the spool files to a HP LJ4100 with Jetdirect and a built in Chinese fonts library. For the English documents, it works perfectly. But it cannot print any Chinese character. Read what site expert Tim Granatir advised.
  • Build a multi-language PRTF
    One member is trying to build a multi-language DSPF and PRTF. The DSPF isn't a problem, but he needs help with the PRTF. Former site expert Pascal Jacquemain offered some assistance.

Dig Deeper on iSeries CL programming