Program message design

A message can be predefined or immediate.

Consider the following information when you design and code:

  • Do not use immediate messages. They are created by the sender or program at the time they are sent and are not stored in a message file. Therefore, they cannot be translated by the translator.
  • Use predefined message descriptions that can both:
    • Exist outside of the program that uses them.
    • Be stored in a message file.
  • Do not specify the maximum size for a message file. When the message file becomes full, you cannot change the size of the message file. You need to create another message file and add the message description again.

    Use the Create Message File (CRTMSGF) command to create a message file to hold the predefined message description. The contents of the predefined message description can be put into a message file by the Add Message Description (ADDMSGD) command.

  • Use substitution variables with care. Different languages have different orders for substitution variables. For example, in the English message:
    File &1 in Library &2 not found.

    &1; and &2; are the substitution variables. Those substitution variables can appear in different positions for different languages.

  • Make your design and coding able to understand a reply code for different languages. For example,
    English     Y = Yes
    Danish      J = Ja (means Yes)

The following figure shows the creation of different NLV messages from message files.

Creating different NLV messages from message files

A program can directly access the message file for program messages, or it can indirectly access the message file through display files for program messages.