Page 1 of 1

Data not in EBCIDIC format

Posted: Wed Jun 13, 2018 7:36 pm
by kingo
Hi when I try to display values of a character field from a table I get wierd values column 2 - 10. I don't understand why? Could someone explain how to fix this ? I am unable to see the table definition.

Code: Select all

000001   SQLCODE 000000000
       44EDDCDCC4FFFFFFFFF
       0028336450000000000
--------------------------
000002           005275000
       4333333433FFFFFFFFF
       0000010100005275000
--------------------------
000003   SQLCODE 000000000
       44EDDCDCC4FFFFFFFFF
       0028336450000000000
--------------------------
000004        â  004125000
       4333333433FFFFFFFFF
       0000020201004125000

in line 2&4 I expect value as below between 2-10 column

000010A00
000020B01

Re: Data not in EBCIDIC format

Posted: Wed Jun 13, 2018 8:28 pm
by Robert Sample
I don't know exactly what you did, but you got values of 000010A00 and 000020B01 just as you wanted. However, those values are in ASCII, not EBCDIC.

Re: Data not in EBCIDIC format

Posted: Wed Jun 13, 2018 8:36 pm
by kingo
The problem is when I querying through spufi I get

Code: Select all

000010A00
000020B01
When I write application program I get

Code: Select all

000002           005275000
       4333333433FFFFFFFFF
       0000010100005275000
000004        â  004125000
       4333333433FFFFFFFFF
       0000020201004125000
But I wanted to display as I am able to see in SPUFI output

Re: Data not in EBCIDIC format

Posted: Wed Jun 13, 2018 9:05 pm
by Robert Sample
SPUFI implies DB2, so you need to review the DB2 table to see what its code page is. You may also want to look into how to convert code pages when retrieving DB2 data.

Re: Data not in EBCIDIC format

Posted: Wed Jun 13, 2018 9:50 pm
by kingo
Thank you Robert I will check on that.

Re: Data not in EBCIDIC format

Posted: Thu Jun 14, 2018 12:13 am
by kingo
Hi Robert,

I fixed the issue by adding keyword ENCODING(EBCDIC) in my bindjob and It fixed the problem and I am able to see the data as expected :)

Thanks a bunch :)

Re: Data not in EBCIDIC format

Posted: Thu Jun 14, 2018 12:23 am
by Robert Sample
Good to hear you got it working.