1. Introduction


The Zengin Data Telecommunication System is a inter-bank payment system introduced in April 1973 for Japans domestic fund transfers. The Tokyo clearing house is operated by the Tokyo Banker's Association (TBA) with over 2000 participating institutes. Participation requires membership in the TBA or the payment of a "admission" fee. The Zengin system, although mainly used for "small" value transactions, has the highest transaction volume in Japan.

Since its introduction, the Zengin system has been subsequently "enhanced" to be able to handle foreign currency payments and "extended" to handle customer-bank transactions in addition to the inter-bank transfers. This "customer-bank" transaction functionality has been implemented in major ERP systems such as SAP and Oracle.

At the technical core of Zengin is the Zengin file specification, describing the format for payment transactions. Due to age (dating back to 1970ties), there are some "quirks" that cause difficulties today. Examples are the limitation of a single value date per file, which is being presented only by a 4-digit string for day and month, omitting the year. Or, the "trailer" record provides a transaction summary and value total, but is not as helpful as a checksum since it cannot distinguish if an error happened during data entry or transmission and processing.

2. Zengin File Format


I could not find a "official" standard describing the Zengin format, so all information comes from publicly available descriptions issued by the bank that is using Zengin for "customer-bank" transactions, plus publicly accessible ERP system documentation (Oracle). The Zengin format descriptions vary slightly, depending on the bank and their implemented "features" that re-use Zengin fields or add "custom" fields in the trailing space section of the fixed-length records.

A Zengin file consists of "records" (lines) with a fixed length of 120 bytes. There are 4 known record types: Header (1), Data (2), Trailer (8) and End (9). Each record type has a different set of specified fields. All fields either represent a number (right aligned with leading zeroes) or a string (left aligned with trailing spaces) and all have a fixed byte-length. The encoding for strings is either EBCDIC or JIS (Katakana singlebyte halfwidth characters) to represent Japanese bank and customer names. record fields do not extent to the end of the record, trailing "fill" spaces are added to pad the record up to 120 bytes.

3. Zengin File Format Citi


3.1 Mandatory Line separator

The original specification has no line separator (LF or CRLF), therefore the records can be only separated by their fixed length. Citi "customer-bank" Zengin specification requires the addition of a line separator CR/LF after each record.

3.2 Limit for Header field 3 - Encoding JIS

Citi can only decode JIS formatted files, so the only valid header record value for field 3 is zero, JIS encoding is mandatory.

3.3 Re-use of Header field 4

The Header field 4 has been originally carrying the ordering party code of the participating bank in "inter-bank" transactions. This field is re-used by Citi to carry the customers Citi debit account number for the "customer-bank" transaction.

3.4 Addition of a new Header field 13

A new Header field 13 has been defined in the trailing space section of the header record. This 3-byte field carries the ISO currency code for transactions from and to accounts in foreign currencies. Standard domestic yen payments and FC payments must be kept in separate files, not mixed.

4. Zengin File Creation


buildzengin.cgi creates a basic Zengin file consisting of a header and one data record. I can only handle JIS encoding, but the CR/LF can be set/unset explicitly to create Zengin Kyo or Citi compatible files.

5. Zengin File Upload and Editing


decodezengin.cgi Takes a existing local Zengin file, uploads it and tries to decode its content. If successful, each byte of the file can be edited and the result can be saved to the server for future reference.

6. Common Errors


ZenginGen has a hardcoded limit for 20 data records per Zengin file. The theoretical limit for data records is 999999 transactions per file, set by the 6-bytes field 2 of the "trailer" record (if utilized, would result in a 122 MB Zengin file).

7. Zengin Links


A Zengin description is published in the Oracle Payables Bank Transfer feature.

8. About


@2009 by Frank4DD, created out of pure necessity to create Zengin various test files for a payment transaction and processing development.