DataMagic Technical Column Vol.2

Character code conversion: external character code

Introduction

The JIS Level 1 and 2 character codes are the ones that are typically used on systems. However, there are still many place names and personal names that use character codes other than these Level 1 and 2. (In this TIPS, character codes other than JIS Level 1 and 2 will be referred to as "external characters.")

For example, the place names and personal names that are normally used in the system are JIS Level 1 and 2 characters, but when printing on mailed items, the official place names and personal names must be printed, and they must be converted accurately to external character data.

However, by utilizing DataMagic, it is possible to easily convert all the external character data in one go.

This TIPS will introduce an example of converting fixed-length data from an IBM mainframe, including external character data, into Shift_JIS CSV data. Note that in order to use this TIPS, DataMagic must be installed on your computer. For information on where to obtain DataMagic and how to install it, please refer to the separate article "Installing DataMagic."

How to operate

Step 1 - Prepare fixed-length data for external character conversion

As with Technical Column Vol. 1, we will use IBM mainframe data as sample data. The sample data is saved in the following folder on the PC where DataMagic is installed.
C:\work\SAMPLE2\ (saved with the file name "in")

Each item in the sample data below contains external characters.

Sample data: Contains characters other than those specified in JIS Level 1 and 2 (external characters), such as 株式会社 and 髙.

»Download the data for external character conversion (Note: The sample file is in zip format. Please unzip it before use.)

Step 2 - Set up the external character table

Register the external character table included in the sample data. This table will be referenced during DataMagic conversion and the input code will be replaced with the output code. Download the external character table with the characters included in the sample data registered and save it in the folder below.
C:\work\SAMPLE2\gtf\ (saved as "gtitos.xtd")

»Download the external character table (IBM Kanji to Shift_JIS) (Note: The sample file is in zip format. Please unzip it before use.)

Step 3 - Download and configure DataMagic script file

To convert IBM mainframe data containing external characters to Shift_JIS, download the script file below and save it in a folder.
C:\work\SAMPLE2\sample2.igen

Launch DataMagic management screen and import the downloaded script file into DataMagic. To import, click the [Import Management Information] icon under [Tools] on the start screen. On the Import Management Information screen, specify the downloaded file and click the Import button. If the import is successful, the ID SAMPLE2 will be registered on the Data Processing Information List screen.

»Download the script file (Note: The sample file is in zip format. Please unzip it before use.)

Step 4 - Run DataMagic and check the results

Double-click the data processing information ID SAMPLE2 registered in step 2 and confirm that the file names for the input and output settings are set correctly. Open the data processing information ID for SAMPLE2 from the screen and click the "Execute" button at the top of the screen. When execution is complete, a file called "out" will be created in C:\work\SAMPLE2\, which was specified in the output settings. Check this with an editor such as Notepad.

lastly

This time we converted external character data (characters other than JIS Level 1 and 2), but it is also possible to convert characters within JIS Level 1 and 2 into character codes defined by the user. Please download DataMagic trial version and try out the explanations in the technical column.

  • The trial version is free to use for 60 days.
  • After you sign up for the trial version, you will receive 90 days of free technical support.

DataMagic Column List

Related Content

Return to column list