Previous Topic: Right to Left Panel Layout

Next Topic: General Coding Standards

Collating Right to Left (RTL) Fields

Bi-directional languages also raise some special considerations for ordering data. Consider what happens when you create a logical view, using an alphanumeric field as one of the key fields—records are collated using the characters in the field in a left to right order. For bi-directional language words, this is back to front. It would be as if we ordered the English list shown on the left below in the order shown on the right:

There are three different techniques you can use to overcome this:

  1. Hold a second copy of the field on the record with the characters reversed (requiring a modification to the database and all programs that change the field’s values).
  2. Always reverse the field on input or output. It is then stored in reverse, but displayed or printed in proper RTL order. This requires modification to all programs that use fields. If you use this method, you should introduce a RTL ‘data type’ and a standard routine to carry out the reversal.

Store the field in proper RTL order, and use the DDS substring (SST) keyword to reverse the order in the logical file.