Data processing information

Configure the data processing information settings.

In the DataMagic Management screen, click the Data processing to display the Data Processing Information List screen, and then click the New button to display the Data Processing Settings screen. Configure the settings as shown below and save them.

1. Enter cnv33 in the ID field.

2. Configure the settings for the input file (C:\Examples\33\input\sampleIN33.csv).

Select an input file format in the Object palette, and then drag and drop it on the input area. Double-click the icon to display the Input Settings screen.

Configure the settings as shown below.

Screen 8.298 Input Settings screen

3. Configure the settings for the output file (C:\Examples\33\output\sampleOUT33.dat).

Select an output file format in the Object palette, and then drag and drop it on the output area. Double-click the icon to display the Output Settings screen.

Configure the settings as shown below.

Screen 8.299 Output Settings screen

4. Setting variables

Prepare variables that store the order IDs of the respective records for comparison with the extraction condition.

Double-clicking the Variable button in the Data Processing Settings screen brings up the Variable Settings screen. Set the fields as in the table below and save the fields.

Table 8.9 Settings in the Variable Settings screen

Variable name

Variable type

Initial value

OrderID

Character string

NONE

5. Setting extraction conditions

You need to prepare extraction conditions that perform the following processing.

Extraction condition 1

Outputs the value of the ordering party group of the first record as a header.

Extraction condition 2

Compares the order ID that has been stored in the variable OrderID under the extraction condition 4 and the order ID in the record being processed. If the two values differ, a footer is output. If the record being processed is the 1st record, no footer is output.

Extraction condition 3

Compares the order ID that has been stored in the variable OrderID under the extraction condition 4 and the order ID in the record being processed. If the two values differ, this outputs the value of the order ID of the record being processed as a header. If the record being processed is the 1st record, nothing is output.

Extraction condition 4

Stores the order ID of the record being processed in the variable OrderID.

Outputs the product ID, product name, quantity, and unit price of the record being processed. Also, outputs the sales amounts of the respective ordering parties as Total.

Post-process 1

Outputs the footer of the last ordering party group.

The following are the settings necessary to prepare those extraction conditions.

1) Creating the conditions

Create the conditions. On the Extraction Condition Settings screen and the Post-processing Settings screen, set as indicated below.

Table 8.10 Settings in the Extraction Condition Settings screen

Extraction condition name

Comparison source

Comparison target

Operator

Extraction condition

Extraction condition 1

Record

Input record numbers

 

Fixed value (numeric value)

1

==

1

Extraction condition 2

Record

Input record numbers

 

Fixed value (numeric value)

1

!=

1 AND 2

Input field

Field No.

1

Variable

OrderID

!=

Extraction condition 3

Record

Input record numbers

 

Fixed value (numeric value)

1

!=

1 AND 2

Input field

Field No.

1

Variable

OrderID

!=

Extraction condition 4

Record

Input record numbers

 

Fixed value (numeric value)

1

>=

1

Table 8.11 Settings in the Post-processing screen (no detailed settings)

Post-processing name

Comparison source

Comparison target

Operator

Extraction condition

Post-processing 1

 

 

 

 

 

 

 

2) Setting mapping information

In the Data Processing Settings screen, use drag-and-drop operation to set mappings as in the following figure.

Screen 8.300 Setting mappings

Double-click the relation lines from 1) to 6) to bring up the Set Mapping Information screen. The following are the settings in the Set Mapping Information screen.

1) Relation line from the extraction condition 1 to the output file

Set the output format. Set the output information on the output side as follows:

Screen 8.301 Set Mapping Information screen (relation line 1)

Table 8.12 Settings in the Set Mapping Information screen (relation line 1)

Field on the output side

Output information

Field type

Value

HEAD

Fixed value (fixed character string)

HEAD

2) Relation line from the extraction condition 2 to the output file

Set the output format. Set the output information on the output side as follows:

Screen 8.302 Set Mapping Information screen (relation line 2)

Table 8.13 Settings in the Set Mapping Information screen (relation line 2)

Field on the output side

Output information

Field type

Value

TAIL

Fixed value (fixed character string)

TAIL

3) Relation line from the extraction condition 3 to the output file

Set the output format. Set the output information on the output side as follows:

Screen 8.303 Set Mapping Information screen (relation line 3)

Table 8.14 Settings in the Set Mapping Information screen (relation line 3)

Field on the output side

Output information

Field type

Value

HEAD

Fixed value (fixed character string)

HEAD

4) Relation line from the extraction condition 4 to variables

Set the value of the variable as follows:

Screen 8.304 Set Mapping Information screen (relation line 4)

5) Relation line from the extraction condition 4 to the output file

Set the output format. Set the output information on the output side as follows:

Screen 8.305 Set Mapping Information screen (relation line 5)

Table 8.15 Settings in the Set Mapping Information screen (relation line 5)

Field on the output side

Output information

Field type

Value

DATA

Fixed value (fixed character string)

DATA

Total

Numeric operation

$INAME(quantity)*$INAME(unit price)

= Remarks =

For details about the numeric operation formula, see DataMagic Reference Manual.

6) Relation line from the post-process 1 to the output file

Set the last processing to be performed in the conversion. Set the fields on the output side as follows:

Screen 8.306 Set Mapping Information screen (relation line 6)

Table 8.16 Settings in the Set Mapping Information screen (relation line 6)

Field on the output side

Output information

Field type

Value

TAIL

Fixed value (fixed character string)

TAIL