DBCS File Support – Data type

80 pts.
Tags:
DBCS
iSeries RPG programming
RPG ILE
I am changing our current application software to support DBCS. As this software needs the ability to run in both an SBCS environment and a DBCS environment, I need to re-define fields at the file level to allow DBCS data. Specifically, is it better to use data type "E" or data type "O" to define these fields? The fields, depending on the customer environment, will need to hold either type of data and need to be displayed and printed.

Answer Wiki

Thanks. We'll let you know when a new response is added.

If you’re going to go the DBCS route then ‘O’ is what you will want 99.99% of the time. O allows both DBCS and SBCS to exist in the same field concurrently. E allows both DBCS and SBCS to exist in the same field, but NOT concurrently. That is E means field A of record 1 can be DBCS while field A of record 2 can be SBCS, but you cannot have both (DBCS and SBCS) in the same field, at the same time, for either record. O is just a whole lot more flexible.

You may also consider using G and a Unicode CCSID. DBCS is nice, but you cannot combine different DBCS encodings in the same file. So if you go DBCS (O or E) you can support Japanese in a file, or Korean in a file, or Simplified Chinese in a file, or Traditional Chinese in a file, but you cannot have ONE file with both Japanese and Simplified Chinese. You have to have multiple files in this situation. If you go the Unicode route you can have one file that contains the characters of all the DBCS languages, not to mention the SBCS languages, concurrently. Going Unicode is more work, but you also get a whole lot more flexibility!

Bruce Vining
<a href=”http://www.brucevining.com/”>Bruce Vining Services</a>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following