Use MSGCON to display a MSGID from a MSGF

  • Home
  • /
  • Blog
  • /
  • Use MSGCON to display a MSGID from a MSGF

November 24, 2016

By using MSGCON (message constant) keyword.

You use MSGCON, a field-level keyword to declare the text for constant fields is contained in a message description.

Years ago, this was used by a lot of companies to create multilingual display files.

The idea was that you could remove the ENGLISH language fields from every *DSPF and replace with MSGCON links to message files. Then you can ship your application with a ENGLISH, SPANISH, FRENCH or whatever language translated message file and *boom* the application is displayed in that language.

Personally, I found it horrible to work with. Using SDA to edit a screen that is filled with screen constants is a nightmare because you have to be extra careful to keep track of which field is which. But, there I go, digressing into moaning moaney land.

But, it warrants a little explanation in case you are trying to figure it out.

MSGCON (Message Constant) keyword for display files


If the message description does not exist at DDS compilation time, the file will not be created. If you change the message description, you need to create the file again if you want the display file to contain the updated message.

The format of the keyword is:

MSGCON(length message-ID [library-name/]message-file-name)

The message-file-name parameter identifies the message file that contains the message description. The library-name parameter is optional.

The MSGCON keyword must be explicitly specified for the field and cannot be used to initialize a named field.

The DFT and MSGCON keywords are functionally equivalent. If you specify the DFT and MSGCON keywords for the same field, the MSGCON keyword is ignored and the file is not created.

The MSGCON keyword cannot be specified with any of the following keywords:


The following example shows how to specify the MSGCON keyword.

00010A          R RECORD1
00020A                                  2  1MSGCON(10 MSG0001 MESSAGE/MSGF)

MSG0001 in message file MSGF in library MESSAGES contains the message text.


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Start your
7-day free trial

Take This Course with ALL ACCESS

Unlock your Learning Potential with instant access to every course and all new courses as they are released.
 [ For Serious Software Developers only ]

IBM i Training For Technology Experts


Successfully Work Remote 

 $ 129.00  $59.00

By adding new skills in information technology, employers will be confident that you have the necessary skills and tools needed to successfully work remotely


Snug CBD

 20% Discount

I have partnered with SNUG CBD givING you Organic CBD
20% discount code "NL20"