Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Acucobol and DB2
Hi,
Having a problem with DB2 and Acucobol,  Selecting numeric values.

The same select works fine with VisualAge cobol and DB2 and Acucobol
and Oracle.

I can fix the problem by changing the COMP values to COMP-3, but I
cant change the entire application.

Here is an example:

The account number in the database is 20012
The acucobol/db2(udb) select returns:  961413120

the sqlcode is zero and the text fields are returned fine.

-thanks


Report this thread to moderator Post Follow-up to this message
Old Post
tomstacky@yahoo.com
02-26-07 11:55 PM


Re: Acucobol and DB2
On Feb 26, 4:45 pm, tomsta...@yahoo.com wrote:
> Hi,
> Having a problem with DB2 and Acucobol,  Selecting numeric values.
>
> The same select works fine with VisualAge cobol and DB2 and Acucobol
> and Oracle.
>
> I can fix the problem by changing the COMP values to COMP-3, but I
> cant change the entire application.
>
> Here is an example:
>
> The account number in the database is 20012
> The acucobol/db2(udb) select returns:  961413120
>
> the sqlcode is zero and the text fields are returned fine.
>
> -thanks


You might be able to use the CASE function as described in the DB2
language reference manual


Report this thread to moderator Post Follow-up to this message
Old Post
Robert Jones
02-26-07 11:55 PM


Re: Acucobol and DB2
On Feb 26, 7:39 pm, "Robert Jones" <rjon...@hotmail.com> wrote:
> On Feb 26, 4:45 pm, tomsta...@yahoo.com wrote:
>
>
> 
> 
> 
> 
> 
> 
> 
>
> You might be able to use the CASE function as described in the DB2
> language reference manual

Sorry that should be CAST not CASE


Report this thread to moderator Post Follow-up to this message
Old Post
Robert Jones
02-26-07 11:55 PM


Re: Acucobol and DB2
On Feb 27, 5:45 am, tomsta...@yahoo.com wrote:
> Hi,
> Having a problem with DB2 and Acucobol,  Selecting numeric values.
>
> The same select works fine with VisualAge cobol and DB2 and Acucobol
> and Oracle.
>
> I can fix the problem by changing the COMP values to COMP-3, but I
> cant change the entire application.
>
> Here is an example:
>
> The account number in the database is 20012
> The acucobol/db2(udb) select returns:  961413120
>
> the sqlcode is zero and the text fields are returned fine.
>
> -thanks

Do you have EXEC SQL BEGIN DECLARE SECTION ... END DECLARE around the
host variables ?



Report this thread to moderator Post Follow-up to this message
Old Post
Richard
02-27-07 02:55 AM


Re: Acucobol and DB2
tomstacky@yahoo.com wrote:
> Hi,
> Having a problem with DB2 and Acucobol,  Selecting numeric values.
>
> The same select works fine with VisualAge cobol and DB2 and Acucobol
> and Oracle.
>
> I can fix the problem by changing the COMP values to COMP-3, but I
> cant change the entire application.
>
> Here is an example:
>
> The account number in the database is 20012
> The acucobol/db2(udb) select returns:  961413120
>
> the sqlcode is zero and the text fields are returned fine.

I can get 961413120 to map to 20025. Are you sure about the account number?

961413120(10) => 394E0000(16),   4E39(16) => 20025(10)



Report this thread to moderator Post Follow-up to this message
Old Post
HeyBub
02-27-07 02:55 AM


Re: Acucobol and DB2
On Feb 27, 3:33 pm, "HeyBub" <heybubNOS...@gmail.com> wrote:
> tomsta...@yahoo.com wrote: 
> 
> 
> 
> 
> 
>
> I can get 961413120 to map to 20025. Are you sure about the account number
?
>
> 961413120(10) => 394E0000(16),   4E39(16) => 20025(10)


He probably should be using PIC S9(9) COMP-5 or whatever is accucobol
for native long integer.  Your calcs show it is probably a byte
ordering issue.



Report this thread to moderator Post Follow-up to this message
Old Post
Richard
02-27-07 02:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:09 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.