ASNA WingsRPG™ Reference Manual

Imported Message File Format

Messages File are converted to standard XML files with the same name as the IBM i message file object and the extension .amfx (Asna Message File Xml). The root element name is LegacyMsgFileContents that encapsulates a single element called messages, which contains a variable number of MSG elements, with the following attributes:

Attribute name Description
MSGID The unique message identifier as a string.
SEVERITY The message severity as a string.
DATACOUNT The count of data placeholders in the message. Also defines attribute data-collection count expected for this message.
TEXT The message string. It may contain data-placeholders of the form &1, &2 ... &n, where the number specifies the element in the data-collection that defines its format. Note that according to the standard XML rules, the "&" (ampersand symbol), requires escaping. Each & becomes an "&" entity.
SECLVL Second Level message string. May also contain placeholders.
FOR EACH PLACEHOLDER(n):
TYPE(n) The data format corresponding to each placeholder. For example *CHAR represents a fixed-length RPG string, *STRING for a variable-length string, or *DEC for a packed decimal number.
LEN(n) The data length of the corresponding placeholder value.
DEC(n) If the type is decimal, the precision of the data for the corresponding placeholder. If the data is not decimal, the value is "0".

The maximum number of data placeholders is 15. For example, the following XML contents corresponds to a Message File that defines messages for the identifiers CST0001, CST0002, CST0003, CST0004, CST0005, CST0006, CST1000, CST1001, CST1002, and CST1015:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- File NUTSNBOLTS/CUSTMSGF 
     Migrated on 11/30/2010 at 
     10:09 AM by 
     ASNA Monarch(R) Wings version 5.0.3.0  -->


<LegacyMsgFileContents version="1.0">
   <messages>
      <MSG 
         MSGID    ="CST0001" 
         SEVERITY ="0" 
         DATACOUNT="1" 
         TEXT     ="Customer &amp;1 has been added" 
         SECLVL   ="" 
         TYPE1    ="*CHAR" 
         LEN1     ="9" 
         DEC1     ="0"
      />
      <MSG 
         MSGID    ="CST0002" 
         SEVERITY ="0" 
         DATACOUNT="1" 
         TEXT     ="Customer &amp;1 has been updated" 
         SECLVL   ="" 
         TYPE1    ="*CHAR" 
         LEN1     ="9" 
         DEC1     ="0"
       />
      <MSG 
         MSGID    ="CST0003" 
         SEVERITY ="0" 
         DATACOUNT="1" 
         TEXT     ="Customer &amp;1 has been deleted" 
         SECLVL   ="" 
         TYPE1    ="*CHAR" 
         LEN1     ="9" 
         DEC1     ="0"
       />
       <MSG 
         MSGID    ="CST0004" 
         SEVERITY ="20" 
         DATACOUNT="0" 
         TEXT     ="Prompting is available for State and Status only." 
         SECLVL   =""
       />
       <MSG 
         MSGID    ="CST0005" 
         SEVERITY ="0" 
         DATACOUNT="1" 
         TEXT     ="&amp;1 customer(s) were submitted to batch for processing." 
         SECLVL   ="" 
         TYPE1    ="*CHAR" 
         LEN1     ="3" 
         DEC1     ="0"                                             
       />
       <MSG 
         MSGID    ="CST0006" 
         SEVERITY ="0" 
         DATACOUNT="1" 
         TEXT     ="The sales report for &amp;1 has been printed." 
         SECLVL   ="" 
         TYPE1    ="*DEC" 
         LEN1     ="7" 
         DEC1     ="0"
       />
       <MSG 
         MSGID    ="CST1000" 
         SEVERITY ="20" 
         DATACOUNT="3" 
         TEXT     ="One Thousand is &amp;1 and One Hundred is &amp;2 which is spelled &amp;3" 
         SECLVL   ="And here &amp;1 is the same &amp;3" 
         TYPE1    ="*CHAR" 
         LEN1     ="10" 
         DEC1     ="0" 
         TYPE2    ="*DEC" 
         LEN2     ="9" 
         DEC2     ="2" 
         TYPE3    ="*CHAR" 
         LEN3     ="50" 
         DEC3     ="0"                    
       />
       <MSG 
         MSGID    ="CST1001" 
         SEVERITY ="20" 
         DATACOUNT="1" 
         TEXT     ="The &amp;1 cannot be blank." 
         SECLVL   ="" 
         TYPE1    ="*CHAR" 
         LEN1     ="25" 
         DEC1     ="0"                                                                          
       />
       <MSG 
         MSGID    ="CST1002" 
         SEVERITY ="20" 
         DATACOUNT="1" 
         TEXT     ="The &amp;1 cannot be blank.  Press F4 to prompt." 
         SECLVL   ="" 
         TYPE1    ="*CHAR" 
         LEN1     ="20" 
         DEC1     ="0"                                                     
       />
       <MSG 
         MSGID    ="CST1015" 
         SEVERITY ="20" 
         DATACOUNT="3" 
         TEXT     ="Library &amp;1 is not accessible." 
         SECLVL   ="The system returned an error &amp;2 when trying to execute &amp;3 on library &amp;1." 
         TYPE1    ="*CHAR" 
         LEN1     ="10" 
         DEC1     ="0" 
         TYPE2    ="*CHAR" 
         LEN2     ="7" 
         DEC2     ="0" 
         TYPE3    ="*CHAR" 
         LEN3     ="20" 
         DEC3     ="0"        
       />
   </messages>
</LegacyMsgFileContents>