While a system program is running and emitting information, the token-data pairs are written to the message file (MSGFILE.DAT). Typically, you do not have to examine the message file. The translation process that produces the error file and log file will do that for you and will make the final text more readable.
On occasion, however, examining the file reveals more information than is provided by the translation process. For instance, if you see a particular message in the error file and want to know where in the code this message originated, you can do one of two things.
You could edit the XLTUS.MSG or TRANSLAT.INI file to add the FSILineNumber and FSIFileName tokens to the message. Then, by rerunning the translation process, you would get the additional message information. (See Determining where the message originated for more information)
Or, if you know what you are looking for, you could peek into the message file and locate the information more readily. Here is an excerpt from a message token file.
T DestField/PREM PAY INCEPTION
T Image/qmdc2
T FSIFileName/..\C\rulbsfl.c
T FSILineNumber/364
E 10010
T FSIFileName/..\C\rcbbatpr.c
T FSILineNumber/418
E 13027
T FSIFileName/..\C\rulbsfs.c
T FSILineNumber/185
L 10775
T ID/3234567
T GrpName1/SAMPCO
T GrpName2/LB1
T GrpName3/
T Buff/T1
T FSIFileName/..\C\gentrans.c
T FSILineNumber/1187
L 11190
The first character on the line is a letter code which designates the meaning of the line. Valid codes are shown here:
Code |
Description |
E |
Followed by a message number bound for the error file. (error or warning) |
L |
Followed by a message number bound for the log file. (informational) |
T |
Followed by a token-data pair, separated by a forward slash (/). |
The token-data pairs for a given message will occur in the file on lines before the E or L lines. Knowing this, you can see that the excerpt from the message file shown above contains the information for four different messages.
The first message number occurs at the line that contains E 10010. This is a message bound for the error file. Four tokens are defined before translation:
This means that if the message text for 10010 contains any of these tokens the appropriate data will be substituted. Remember, however, if the message refers to a token that has not been defined prior to this point, the token will be left in the output text to indicate a problem might have occurred.
The next message number occurs at the line that contains E 13027. This too is a message bound for the error file. Notice that two tokens occur between the location of the first and second message—FSIFileName and FSILineNumber. These use the same token names used before, however, now their data values are different.
Also note that although only two additional token (changes) occurred before message 13027, four tokens are defined. If you could look into the program memory at this moment, you would see that the token list has these values:
Token |
Value |
DestField |
PREM PAY INCEPTION |
Image |
qmdc2 |
FSIFileName |
..\C\rcbbatpr.c |
FSILineNumber |
418 |
All tokens remain active after they have been translated. Tokens that are reused are updated with new values, but no tokens are removed until the translation process is complete.
Therefore, it is permissible (but at this point not likely) that a message can use tokens output by a prior message. This is why it is important to reuse token names when it makes sense, such as when all references to a section’s name should use the same token.
Continuing with the examination of the message file excerpt, the next message is identified via the line that reads, L 10775. This is a message bound for the log file, not the error file. It too redefines the FSIFileName and FSILineNumber tokens, as do all messages that use LASTERRORTOKEN.
The last message in this example is defined by the line, L 11190. Five new tokens were introduced before this message. Peeking into program memory again, the token list now looks something like this:
Token |
Value |
Buff |
T1 |
DestField |
PREM PAY INCEPTION |
GrpName1 |
SAMPCO |
GrpName2 |
LB1 |
GrpName3 |
|
ID |
3234567 |
Image |
qmdc2 |
FSIFileName |
..\C\gentrans.c |
FSILineNumber |
1187 |
Note that the most recent values for FSIFileName and FSILineNumber are reflected. Also note that the tokens previously defined still exist. Finally, note that one of the tokens appears to have no data (GrpName3) and is therefore blank. This is permissible.
© Copyright 2015, Oracle and/or its affiliates. All rights reserved. Legal notices.