Match codes
In each node of the source structure, one or more match codes can be defined via the context menu. This describes to the parser the rules which record types belong in which nodes. Each match code consists of a condition and a value. The following conditions are available.
"Equals"
"Starts with"
"Ends with"
"Contains"
"Regular expression"
"Is not"
"Does not start with"
If multiple match codes are defined for the same node, they are ORed (linked with logical OR).
For XML input data, it is necessary to also assign match codes to the fields. The condition that has to be used is Equals.
In the special case that a logical record goes over several lines of text, a regular expression can be used with a leading operator (?s)
Please also see section "Checking and Creating Match Codes".
Checking and creating match codes
Certain errors in the source structure prevent or interfere with the successful parsing of the input data.
Missing match codes for nodes (or for fields with XML).
Missing inheritance of match codes to parent nodes.
Node attribute "Delimiter row/column" is missing or set incorrectly.
You can test for these errors and sometimes correct them automatically. See option "Recreate match codes" in the source structure menu. The behaviour of this option depends on the document type of the profile.
XML |
Missing match codes area automatically set with Equals <field name>/<node name>. Inheritance to parent nodes and field delimiters are not checked because they are not relevant to document type XML. |
IDoc |
The root node has to begin with "EDI_". Missing match codes for nodes are automatically set. Inheritance to the parent node is checked and set if necessary. Field delimiters are not relevant for IDoc because it is a fixed-length format. |
CSV, Database, Excel |
Match codes are checked in all nodes but not automatically set. Inheritance to the parent node is checked and set if necessary. Field delimiters are checked but not changed. |
Fixed-length |
Match codes are checked in all nodes but not automatically set. Inheritance to the parent node is checked and set if necessary. Field delimiters are not checked. |
EDIFACT |
Match codes are checked in all EDIFACT segments but not automatically set. Composite nodes (contains fields but no subnodes and its name begins with C or S, followed by three digits) are ignored. Inheritance to parent nodes (segment groups) is checked but not set automatically. Field delimiters are not relevant. |
EDIFACT with option TradaComs |
The check is not (yet) implemented. An error message appears. |
X12, BWA |
Match codes are checked but not set. Inheritance to parent nodes is checked but not set. |
Custom class |
There is no check or correction. The source tree is assumed to be error-free without checking. |
Automatic completion of match codes
The match codes can only be set automatically for "IDoc" and "XML" because only here there is a plausible rule of how they should look like. However, only those segments in IDoc and those elements in XML are changed that have no match code at all. Existing match codes are not changed. It is also not checked whether existing match codes are factually correct, i.e. whether they match the input data. Note: To remove all match codes, you can use the functionality "Batch processing/Miscellaneous/Delete matchcode" in the source structure menu.
Automatic inheritance of match codes
For the document types "IDoc", "CSV", "Database", "Excel" and "Fixed-length", missing record identifier values are automatically transferred from the subnodes to the parent nodes. There is a check for document types "EDIFACT", "X12" and "BWA", but nothing will be changed. There is no check for document types "XML" and "Custom class".
Check field delimiter
Field delimiters are defined as attributes of the source structure nodes. For document type "Excel" the field delimiter character for nodes that contain fields has to be a semicolon (;). For document type "Database" it has to be a comma (,). For document type "CSV" it must be set but it does not have to be a semicolon. If document type CSV and the time-driven Input Agent "Custom class" with classes "DefaultSQLCron" or "DefaultFileSQLCron" are used, a semicolon is expected. Nodes that do not contain any fields themselves but only subnodes (top-level nodes) should not have a field delimiter.
Result of the check/automatic correction
If one of the checks encounters an error that can not be corrected, the profile is not changed. An automatic correction therefore only takes place if all detected errors could be corrected automatically. Changelog messages can be found on page "General messages" in the logs of the Control Center. Each log entry contains the name of the profile. Changing the profile will not become permanent until the profile is saved.
Found errors are displayed in an error dialogue. There is no guarantee that all errors will be shown. Therefore, after the manual correction of an error, the test should be repeated.
Cases in which the tool should not be used
In rare exceptional cases, it is possible that the profile developer intentionally deviates from the rules for the source structure. In these cases, the test obviously should not be performed.