No-hit behavior
When the input is in Hierarchy format, the phenomenon whereby the key value specified in the occurrence condition for the record does not match the input record is called "no-hit".

Figure 4.1 No-hit
What DataMagic does when the key does not match can be set in No-hit behavior of the Hierarchy Format Information.
Use the default value and Treat as normal and use previous data in No-hit behavior are valid if a group is specified as a condition.
(1) If the extraction condition is "Group"
This section uses an example to describe the behavior when the extraction condition is Group.
The following layout information and mapping information are used here.

Figure 4.2 Layout information and mapping information (extraction condition: Group)
The input file is as follows:

Figure 4.3 Input file
a) No-hit behavior = "Error" (cannot be omitted)
If no record corresponds to the input, an error occurs.
b) No-hit behavior = "Use the default value"
If no record corresponds to the input, the input file is processed using the data with the default setting for each item.
In this example, None is applied for type M data, and the default value of 0 for type 9 data. However, because of the digit matching process, type M data with None is processed as 10 bytes of halfwidth spaces, and type 9 data with 0 is processed as 3 bytes of 0. The output file then becomes as shown below.
For details about the default value of each data type, see List of field types, and for the details about the digit matching process, see Data processing when digit matching occurs.

Figure 4.4 Output file (use the default value)
c) No-hit behavior = "Treat as normal and use previous data"
If no record corresponds to the input, the input file is processed by reusing the value of the previous record. The output file is as follows:

Figure 4.5 Output file (treat as normal and use previous data)
(2) If the extraction condition is "Record"
When No-hit behavior is set to Use the default value or Treat as normal and use previous data, if no record corresponds to the input, the process is skipped, and as a result the default or previous values are not output.
Specify Record as the extraction condition and output the data in Multi format.

Figure 4.6 Layout information and mapping information (extraction condition: Record)
The output file is as follows:

Figure 4.7 Output file