How to programming with national language in RPG?

35 pts.
AS/400 Languages
RPG Language Support
Hello experts, I would like to write a program in RPG to print out Vietnamese characters with accents, for example ắ, ấ, ỏ, ọ, ... But I don't know the way AS/400 can support. In SBCS, just some of characters are support. I really appreciate if you guys advice me a solution. Thanks. Tuan Anh

Answer Wiki

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

I don’t think it does support this in SBCS. You May need to look at changing your CCSID to one that supports DBCS. You will also need a printer that supports DBCS.

Here are the CCSID’s that IBM shows for Vietnamese:


CCSID (decimal) CCSID (hex) Name



See for more information.


Vietnamese is not DBCS. It’s SBCS just like 37, 500, etc. It does though have a different character set and code page.

Before continuing, do you have a workstation configured for Vietnamese? That will simplify things. If you only have say English workstations then you can still print out Vietnamese, it will just be a bit more work (confusing).

Bruce Vining

Discuss This Question: 5  Replies

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.
  • nta2804
    Hello Teandy Thanks for your response. I did as you advice, and I have a snippet code following:
    d sOut            c                   x'0E'                           
    d sIn             c                   x'0F'                           
    d TEXT            s              4C                                   
    c                   eval      text = %ucs2(sOut + x'52' + x'8D' + sIn)
    and the program was compiled successfully. I looked into the spooled file generated by compilation, I noticed that the CCSID of variable Text is 13488. And while debugging, I evaluate the value of Text, and its value is êÒ, but the correct value should be in CCSID 1130. Then i try to add the keyword ccsid(1130) in the declaration of TEXT variable,
    d text            s              4C   ccsid(1130)
    and re-compile the program. But the compilation occurs error with the severity code 20: CCSID(1130) is not allowed in TEXT Could you please help me correct it? Thank you.
    35 pointsBadges:
  • Teandy
    Tuan, CCSID is a system value, not an attribute. CCSID 13488 is Unicode 2.0, UTF-16 BE with IBM PUA. To change this system value, use the WRKSYSVAL command. Example: WRKSYSVAL QCCSID. As I said, this will affect all users and objects on the box, so make sure that this is what you want to do. You can get a list of CCSID's here: I also noticed in the V5R4 RPGLE manual that the BIF %UCS2 has an optional second parameter for the CCSID. You might want to look into using that before you start thinking about changing the CCSID for the entire box. Using your code, change
    c                   eval      text = %ucs2(sOut + x’52′ + x’8D’ + sIn)      to
    c                   eval      text = %ucs2(sOut + x’52′ + x’8D’ + sIn :1130)
    Also from the manual: <quote> If the parameter is a constant, the conversion will be done at compile time. If the conversion results in substitution characters, a warning message is issued at compile time. At run time, status 00050 is set and no error message is issued. </quote>
    5,860 pointsBadges:
  • nta2804
    Hello Teandy, Thanks again for your support. Now I success to write Vietnamese characters for my RPGLE program. But I just see them correctly when I debug using Websphere Development Client Studio (WDSC), but if I do with the build-in debugger of AS/400 (using Personal Communication in 'green screen'), they are incorrect. I think I should create my own *WSCST object to support displaying Vietnamese characters in Personal Communications and for printing out, do you think that is a solution? Thanks expert, Tuan Anh
    35 pointsBadges:
  • nta2804
    Hello Vining, Could you give me some clues for how to configure Vietnamese for workstation and for printing? I have taked some following steps: - Create a Workstation Customization named WINFO1552 to build a translation for EBCDIC 1130 to ASCII 1258 for Vietnamese in Windows XP. - Set up the Host Print Transform for printer named QPADEV0001 using the customized-WSCST object. I used the following command to change configuration of printer: CHGDEVPRT DEVD(QPADEV0001) LNGTYPE(USI) TRANSFORM(*YES) MFRTYPMDL(*INFOPRINT1500) CHRID(1136 1130) WSCST(*LIBL/WINFO1552) Then I try printing the spooled file with Vietnamese characters using this printer. But the output data is incorrect. I tested customization object WINFO1552 by writing a small program in Java to read this spooled file and output data to text file. I also changed in Control Panel/Regional and Language Options for Windows XP to ASCII code 1258. Then I use Notepad.exe to view data, the data is correct. I'm really in impasse. I appreciate for any help from you.
    35 pointsBadges:
  • cmmuniente
    Hi, nta2804. 
    Did you solve your printing problem ?
    If so, please, could you tell us how you did it ?

    Thanks in advance.
    10 pointsBadges:

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.

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


Share this item with your network: