Highlighted
Absent Member.
Absent Member.
2754 views

[archive] a problem about acusql

[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.
0 Likes
10 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] a problem about acusql

help me ,please!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] a problem about acusql

Are you sure comp-3 is supported in the database. All the examples I have seen use COMP-5
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] a problem about acusql

You may need to get 8.0 which has SQL099 which may solve this issue.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] a problem about acusql

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
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] a problem about acusql

anyone help me!
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] a problem about acusql

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.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] a problem about acusql

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
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] a problem about acusql

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,
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] a problem about acusql

I have not a current support contract,
Are there any other way?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] a problem about acusql

Sorry, but the only option left is to modify your program to not use COMP-3.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.