Generating Message and Text Files

You can create messages as text files in any environment outside Natural and convert them into message files to be maintained with the SYSERR utility. Message files are created and maintained with the import and export functions of the SYSERR utility.

Message files are created in a platform-independent format, which is portable across any Natural-supported Linux and Windows platforms. For example, a message file created in a Natural for Windows environment, can be copied onto a Linux platform without manual conversion; the necessary endian conversion is performed by Natural. For further information, see Portable Natural System Files in the Operations documentation and Transferring Natural Generated Programs in the Programming Guide.

This section covers the following topics:


Storing a Message File

The message files must be stored with the file extension .MSG in the Natural Err directories.

User-defined message files are stored in the Err subdirectory of the library in the FNAT or FUSER system file from which the application is executed, the steplib, or the SYSTEM library.

For Natural system messages, the message files must be stored in the Err subdirectory in the Natural root directory. Natural system messages are stored in eight message files.

Creating a Text File

For Natural system or user-defined messages, the import function of the SYSERR utility generates a message file from one text file.

To create such a text file, you must use a specific layout, as shown in the following example:

Example:

NAT
0010 
0100 
0010E NO MESSAGE TEXT DEFINED! 
0020E MISSING/INVALID SYNTAX; UNDEFINED VARIABLE-NAME. 
0025E ERROR IN ENTRY FOR NUMBER OF RECORDS TO BE PROCESSED. 
0050E INCORRECT FIELD SPECIFICATION IN 'WHERE' CLAUSE. 
#PLEASE CHECK PROGRAM 
#FOR ERRORS 
0100E FUNCTION NOT AVAILABLE.

Explanation:

NAT

or

library-ID

The prefix of the message number to be displayed with the message. The default prefix is NAT for Natural system messages and the library ID for user-defined messages.
0010 The four-digit starting number of a range of messages.
0100 The four-digit ending number of a range of messages. All message numbers that are defined in this text file must be within this range.
0010E NO MESSAGE TEXT DEFINED!

This is the short message for message number 0010. The E is mandatory and means error. This message will be issued with the following Natural statement:

REINPUT *0010

Explanatory long messages must be placed immediately below this short message; each of these additional lines must start with a hash/number (#) sign. Up to 20 additional lines of long message text are allowed for each short message.

Generating a Message File

The SYSERR utility provides the option to generate a message file from a text file.

For user-defined messages, one output message file can be created in one language for each library. Each message file must be stored in the Err subdirectory of that library.

Naming Conventions

For user-defined messages, the name of the message file must be:

NnnAPMSL.MSG

where nn is the language code (01 - 60), for example 01 for English.

For Natural system messages, the name of the message file must be:

NnnLmmmm.MSG

where nn is the language code to be used and mmmm the starting number of the message range. The ranges of message numbers are fixed, as defined during Natural system installation, for example:

N01L0000    Messages 1 - 1999
N01L2000 Messages 2000 - 2999

Start of instruction set To generate a message file

  1. Enter the IMPORT command of the SYSERR utility.

    The Import Text File to Message File window is displayed.

  2. In the From input field, specify the name of the input text file from which all information is to be read.  The full path name of the file must be specified. In the To input fields, specify the language and the library of the message file to be generated. 

Recreating a Text File

The SYSERR utility provides the option to recreate a text file for message text maintenance. This is done by reconverting a messages file into a text file.

Start of instruction set To recreate a message text file

  1. Enter the EXPORT command of the SYSERR utility.

    The Export Text File from Message File window is displayed.

  2. In the From input fields, specify the language and the library of the message(s) to be used as input. In the To input field, specify the name of the text file to be created. The text file created will have the same format as an input text file.