Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messageOn 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
Post Follow-up to this messageOn 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
Post Follow-up to this messageOn 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 ?
Post Follow-up to this messagetomstacky@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)
Post Follow-up to this messageOn 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.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.