DB2 code tables

IxiRancid

Well-known member
Joined
Jun 16, 2004
Messages
104
Location
Europe
Hi,
Im from a CE country that has some special characters in the alphabet. DB2 stores values in its own code table, then when "pumped out" they have to be changed to "870" code table (in AS400 prompt window).

I did a casual pull and filled a dataset in VB.NET but the characters (our native: Slovenia, Croatia, Serbia...) are looking really funny and strange.

Anyone (possibly from CE europe) has similar problems or solutions?
I tried changing DataSet locales, but now the thing just doesnt work at all :rolleyes:
 
I like to clean up my posts if I find a solution. Well, here I did a workaround. Perhaps someone from Slovenia or other CE countries might find this useful
Here it goes:

pre: reference IBM Client Access Express (cwbx.dll)
1. use INSERT SELECT to get the rows you want and put them into an AS400 File
2. use VB.NET to run CHGPF (change physical file CCSID to 870) - see code below
3. pump the data out again

Code:
        Dim systemNames As New cwbx.SystemNames
        Dim as400 As New cwbx.AS400System
        Dim cmdAS400 As New cwbx.Command
        Dim pgm As New cwbx.Program
        Dim dQueue As New cwbx.DataQueue
        Dim strCvtr As New cwbx.StringConverter
        Dim lngCvtr As New cwbx.PackedConverter

        With as400
            .Define(systemNames.DefaultSystem)
            .UserID = "UserName"
            .Password = "Password"
        End With

        With cmdAS400
            .system = as400
            .Run("CHGPF FILE(NMYLIB/BMNS_01) CCSID(870)")
        End With

This is the main part you need to use. The rest is just DataReader & OleDbCommand sutff. :rolleyes:
 
Back
Top