The Write Log command writes messages to the transaction log (Translog) files. (See the Trading Partner and Log Database Formats chapter of the ECMap Reference Guide for the format of the Translog table.) These messages are user-initiated log file entries, as opposed to the system-generated messages. User-initiated messages include the same information that would be written to a system-generated message written at the same point. There are three required fields for user-initiated messages and seven optional ones. Entries in the optional fields override system-generated information in these fields.
The Write Log rule is used in both error reporting and transaction reporting requirements. It may also be used during debugging to identify particular values, check progress, etc.
Select the up arrow next to the Write To Log text box, and the Write Log File window displays.
If the current map is an inbound or outbound transaction map, the window below appears.
On the Write Log File window, you must enter information in the first three required fields – Msg No, Sev Code, and Message.
Msg No – a five-character user-assigned message number, which can be used to locate specific messages that you have written to the log file. Choices are Memory Variable and Constant. ECMap has a pre-assigned set of error message numbers that are used for system-generated messages. (see the ECMap Reference Guide for a full listing of error messages and numbers.) Users often begin their message numbers at 10000 so that they do not duplicate the error message numbers used by the system. Msg No corresponds to the MSG_NO field in the Translog table.
Sev Code – a two-character user-assigned severity code, which can be used to classify errors that have occurred and quickly locate classes of errors in the log file. The choices are Memory Variable and Constant. ECMap uses the following set of severity codes to flag errors in system-generated messages:
Code Number |
Meaning |
Code |
---|---|---|
1 |
No errors |
|
2 |
Errors but no transaction skipped |
|
3 |
Transactions skipped with ## errors |
|
4 |
User Abort rule and ## errors |
|
5 |
User Stop rule |
|
6 |
Fatal error stop and ## errors |
|
Users have several choices. They can use only these same system severity codes, use the system codes and supplement them with additional codes, or create their own set of codes. Sev Code corresponds to the SEV_CODE field in the Translog table.
Message is a brief textual explanation of the message. The maximum length of a message is thirty (30) characters. The choices are Memory Variable, Record/Field, System Variable, and Constant. If you choose Constant, the information you enter in the Constant box is entered in the Message field in the log. Otherwise, depending on the choice you make, the contents of the Memory Variable, Record/Field, or System Variable is entered in the Message field in the log. Message corresponds to the MSG_TXT field in the Translog table.
The following seven fields are optional. For each of these seven fields:
If an entry is made on this window, it overrides any system-generated information and the field in the user-initiated log file contains the user-entered information.
If no entry is made on this window and there is no system-generated information, the field is blank in the user-initiated log file.
If no entry is made on this window and there is system-generated information, the field in the user-initiated log file contains the system-generated information.
In the top section of the Write Log File window, there is one optional field that you can use to override system-generated information.
The Record Seq No is a 6-character field that is generally used with outbound maps. For files containing multiple record types, the record sequence number indicates how many times you have read the record type that is currently being processed. For files with a single record type, the record sequence number indicates how many times you have read the file. Record Seq No corresponds to the RECORD_NO field in the Translog table.
In the middle section of the Write Log File window, there are four optional fields that you can use to override system-generated EDI Standards-related information. When you are writing entries to the log file while you are processing EDI Standards data, it is often helpful to know what segment, element, or sub-element was being processed when a particular action or error occurred.
Segment Name – the 3-character name of an EDI segment. It is generally the segment that was being processed when the log file entry was written or that is relevant to an action or error that occurred. You must enter the value. Segment Name corresponds to the SEGMENT field in the Translog table.
Element No – the 2-character code of an EDI element. It is generally the element that was being processed when the log file entry was written or that is relevant to an action or error that occurred. You can use an element number that was stored in a Memory Variable, or you can enter it as a Constant. To clear the entry in this text box, choose Clear. Element No corresponds to the ELEMENT field in the Translog table.
Subelement No – the 2-character code of an EDI sub-element. It is generally the sub-element that was being processed when the log file entry was written or that is relevant to an action or error that occurred. You can use a sub-element number that was stored in a Memory Variable, or you can enter it as a Constant. To clear the entry in this text box, choose Clear. Subelement No corresponds to the SUBELEM field in the Translog table.
Segment Count – the number (long integer) of segments that have been processed in the current transaction when the log file entry is written. You can accumulate this value in a Memory Variable from which it can be retrieved. To clear the entry in this text box, choose Clear. Segment Count corresponds to the SEG_COUNT field in the Translog table.
In the bottom section of the Write Log File window, there are two optional fields that you can use to override system-generated information.
You can identify a record name and a field name that you would like to have written to the log file.
You can enter the Record Name and Field Name or you can Browse for them on the Records/Tables window. If you Browse for the names, when you double-click the field name, both the record name and field name is entered in the text boxes. Record Name corresponds to the RECORD_NAM field in the Translog table, and Field Name corresponds to the FIELD_NAME field.
If the current map is an any-to-any map, the Write Log File window below displays.
The Write Log window for any-to-any maps has the same top and bottom sections as the Write Log window for inbound and outbound transaction maps. However, it does not have the middle section because this section contains only standards-related data.