Home > Archive > Cobol > February 2007 > Acucobol and DB2
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| tomstacky@yahoo.com 2007-02-26, 6:55 pm |
| 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
| |
| Robert Jones 2007-02-26, 6:55 pm |
| 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
| |
| Robert Jones 2007-02-26, 6:55 pm |
| 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
| |
| Richard 2007-02-26, 9:55 pm |
| 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 ?
| |
| HeyBub 2007-02-26, 9:55 pm |
| 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)
| |
| Richard 2007-02-26, 9:55 pm |
| 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.
|
|
|
|
|