Data not in EBCIDIC format

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
User avatar
kingo
Registered Member
Posts: 27
Joined: Mon Jun 04, 2018 10:55 pm

Data not in EBCIDIC format

Post 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
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Data not in EBCIDIC format

Post 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.
User avatar
kingo
Registered Member
Posts: 27
Joined: Mon Jun 04, 2018 10:55 pm

Re: Data not in EBCIDIC format

Post 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
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Data not in EBCIDIC format

Post 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.
User avatar
kingo
Registered Member
Posts: 27
Joined: Mon Jun 04, 2018 10:55 pm

Re: Data not in EBCIDIC format

Post by kingo »

Thank you Robert I will check on that.
User avatar
kingo
Registered Member
Posts: 27
Joined: Mon Jun 04, 2018 10:55 pm

Re: Data not in EBCIDIC format

Post 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 :)
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Data not in EBCIDIC format

Post by Robert Sample »

Good to hear you got it working.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”