Skip to main content

[archive] a problem about acusql

  • June 10, 2008
  • 10 replies
  • 0 views

[Migrated content. Thread originally posted on 06 June 2008]

:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:

I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;

When I change database from DB2 to mysql, this problem still exist.

My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4

How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!


My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.

10 replies

[Migrated content. Thread originally posted on 06 June 2008]

:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:

I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;

When I change database from DB2 to mysql, this problem still exist.

My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4

How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!


My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.
help me ,please!

[Migrated content. Thread originally posted on 06 June 2008]

:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:

I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;

When I change database from DB2 to mysql, this problem still exist.

My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4

How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!


My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.
Are you sure comp-3 is supported in the database. All the examples I have seen use COMP-5

[Migrated content. Thread originally posted on 06 June 2008]

:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:

I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;

When I change database from DB2 to mysql, this problem still exist.

My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4

How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!


My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.
You may need to get 8.0 which has SQL099 which may solve this issue.

[Migrated content. Thread originally posted on 06 June 2008]

:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:

I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;

When I change database from DB2 to mysql, this problem still exist.

My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4

How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!


My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.
Dear dilbert,thank you for your reply!

I learned this from "AcuSQL User's Guide Version 7.2" :
2.4.1 DB2 Data Type Compatibility
The following table describes data type compatibility for DB2.

SQL Type COBOL Type Description
--------- --------------------------------- -------------------
DECIMAL 01 name PIC S9(M) V9(N) COMP-3. Packed decimal
INTEGER 01 name PIC S9(9) COMP-5. 32-bit signed integer

[Migrated content. Thread originally posted on 06 June 2008]

:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:

I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;

When I change database from DB2 to mysql, this problem still exist.

My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4

How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!


My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.
anyone help me!

[Migrated content. Thread originally posted on 06 June 2008]

:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:

I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;

When I change database from DB2 to mysql, this problem still exist.

My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4

How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!


My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.
This is a known problem already fixed in Version 8.0.0.

A modification to AcuSQL in version 7.0 broke a small set of data type conversion functionality between AcuSQL and DB2, specifically reading COMP-3 data.

Until you can upgrade to the Version 8.0.0 Runtime, the workaround is to avoid COMP-3.

[Migrated content. Thread originally posted on 06 June 2008]

:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:

I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;

When I change database from DB2 to mysql, this problem still exist.

My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4

How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!


My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.
Dear DougP, thank you very much for your reply!

Since it is a bug of product , could you provide a solution instead of updating version?

My company may have not the budget to buy a new version

[Migrated content. Thread originally posted on 06 June 2008]

:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:

I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;

When I change database from DB2 to mysql, this problem still exist.

My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4

How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!


My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.
The fix for the comp data issue (which is ECN-SQL098) has not been patched into Version 7.2.1. If upgrading is not an option then the best course is to implement the workaround.

If you have a current support contract you may contact Customer Care and request a patch be created. Customer Care will require you to submit a business case (complete description of impact on your business and reasons why you cannot implement the workaround).

Regards,

[Migrated content. Thread originally posted on 06 June 2008]

:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:

I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;

When I change database from DB2 to mysql, this problem still exist.

My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4

How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!


My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.
I have not a current support contract,
Are there any other way?

[Migrated content. Thread originally posted on 06 June 2008]

:confused:There has a problem when I tested ACUCOBOL-GT ACUSQL DB2:

I declared a "S9(6)V9(2) USAGE IN COMP-3" type host variable, it was corresponding to the database field of "decimal (8,2)" type,
If the variable accept data from the database field, "Memory access violation" error occurred when I executed runcbl to run this program;
If the variable assignment data to the database field ,there had no error when I executed runcbl to run this program;

When I change database from DB2 to mysql, this problem still exist.

My company have bought ACUCOBOL-GT V7.2.1 ACUSQL V7.2.1,
DB2 version express 9.5. OS version REDHAT AS4

How to solve this "Memory access violation" problem ? thank you a lot!
Sorry for my poor english.
Best Regards!


My program section:
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 C-RECORD.
05 C-MYVAR PIC S9(12)V9(02) COMP-3.
01 I-DATA.
05 I-MYVAR PIC S9(12)V9(02) COMP-3.
EXEC SQL END DECLARE SECTION END-EXEC.

EXEC SQL
DECLARE COBCUR1 CURSOR FOR
SELECT AMT_SALE FROM SALE1
END-EXEC.

EXEC SQL
OPEN COBCUR1
END-EXEC.
**** error occur when program executed this section
PERFORM UNTIL SQLCODE NOT EQUAL 0
EXEC SQL
FETCH COBCUR1 INTO :C-RECORD
END-EXEC
END-PERFORM.
****no error when program executed this section
EXEC SQL
INSERT INTO SALE1 (AMT_SALE) VALUES (
:I-MYVAR
)
END-EXEC.
Sorry, but the only option left is to modify your program to not use COMP-3.