I am trying to create a program that links ACUCOBOL Runtime 10.3.0 with Microsoft SQL Server 2019 that allows user to:
1. Create a SQL table from COBOL
2. Add records to the table from COBOL
3. Update records in table from COBOL
4. Delete records in table from COBOL
Currently I am having troubles with the SQL part. I have tried the sample code here:
https://supportline.microfocus.com/documentation/books/sx40/spcesc.htm
Compiler shows that I am missing the EMPREC file. Where do I find this file?
If I manage to create a table, where is this table stored?
I am trying to create a program that links ACUCOBOL Runtime 10.3.0 with Microsoft SQL Server 2019 that allows user to:
1. Create a SQL table from COBOL
2. Add records to the table from COBOL
3. Update records in table from COBOL
4. Delete records in table from COBOL
Currently I am having troubles with the SQL part. I have tried the sample code here:
https://supportline.microfocus.com/documentation/books/sx40/spcesc.htm
Compiler shows that I am missing the EMPREC file. Where do I find this file?
If I manage to create a table, where is this table stored?
When you install Acu, did you select to have the AcuSQL precompiler and AcuSQL runtime installed? If you did, there are sample programs. Recent installs use C:\\Users\\Public\\Documents\\Micro Focus\\extend 10.x.x\\sample\\acusql\\mssql Older installs would have the samples in C:\\Program Files (x86)\\Micro Focus\\extend 9.x.x\\AcuGT\\sample\\acusql. There is a create.sqb program and others sample program as well.
There is no EMPREC file. The documentation was stating that you can place your SQL statements in a copybook, like xxx (or any file name) and then include it in your COBOL code.
EXEC-SQL
INCLUDE xxx
END-EXEC
As far as where the table is stored, it will be in SQL Server defined by how you connect to the database ...
EXEC SQL CONNECT TO :dsn-name as C1
USER :userid USING :passwd
END-EXEC
When you install Acu, did you select to have the AcuSQL precompiler and AcuSQL runtime installed? If you did, there are sample programs. Recent installs use C:\\Users\\Public\\Documents\\Micro Focus\\extend 10.x.x\\sample\\acusql\\mssql Older installs would have the samples in C:\\Program Files (x86)\\Micro Focus\\extend 9.x.x\\AcuGT\\sample\\acusql. There is a create.sqb program and others sample program as well.
There is no EMPREC file. The documentation was stating that you can place your SQL statements in a copybook, like xxx (or any file name) and then include it in your COBOL code.
EXEC-SQL
INCLUDE xxx
END-EXEC
As far as where the table is stored, it will be in SQL Server defined by how you connect to the database ...
EXEC SQL CONNECT TO :dsn-name as C1
USER :userid USING :passwd
END-EXEC
Thanks, I found the sample programs but I still could not connect to server.
In SQL Management Studio, I created a local server TEST under RND\\SQLEXPRESS (pic1) and tested connection successfully. When I tried to connect in create.sqb, it returned "data source name not found".
So, I followed the method here:
community.microfocus.com/.../1736235
and created a DSN (pic2). Connection test successful but the program still returned the same error.
What did I do wrong?
Thanks, I found the sample programs but I still could not connect to server.
In SQL Management Studio, I created a local server TEST under RND\\SQLEXPRESS (pic1) and tested connection successfully. When I tried to connect in create.sqb, it returned "data source name not found".
So, I followed the method here:
community.microfocus.com/.../1736235
and created a DSN (pic2). Connection test successful but the program still returned the same error.
What did I do wrong?
Good morning.
Have you set this variable in your cblconfi?
ACUSQL_RUNTIME_DLL asqlsrvr.dll
Can you try and use just the server name "RND" for the connection?
You should not need to set any DSN in Windows.
Let us know.
I am trying to create a program that links ACUCOBOL Runtime 10.3.0 with Microsoft SQL Server 2019 that allows user to:
1. Create a SQL table from COBOL
2. Add records to the table from COBOL
3. Update records in table from COBOL
4. Delete records in table from COBOL
Currently I am having troubles with the SQL part. I have tried the sample code here:
https://supportline.microfocus.com/documentation/books/sx40/spcesc.htm
Compiler shows that I am missing the EMPREC file. Where do I find this file?
If I manage to create a table, where is this table stored?
here for example a complete application that read the german bank Information from ASCII and bring it in a SQL database, here with sqlite. This is a small and slow database, but the code will works on mssql an other databases.
connect, truncate, drop, insert, update, delete, create is demonstrated.
I hope that will help you!
Good morning.
Have you set this variable in your cblconfi?
ACUSQL_RUNTIME_DLL asqlsrvr.dll
Can you try and use just the server name "RND" for the connection?
You should not need to set any DSN in Windows.
Let us know.
Hi.
I added the variable in the cblconfi file as you suggested, but still not working.
I tried TEST, RND and RND\\SQLEXPRESS, none of them could connect.
Side note:
How do I delete my messages in this forum? I only see the option to edit.
Also, why does it look like I replied to the wrong person?
Hi.
I added the variable in the cblconfi file as you suggested, but still not working.
I tried TEST, RND and RND\\SQLEXPRESS, none of them could connect.
Side note:
How do I delete my messages in this forum? I only see the option to edit.
Also, why does it look like I replied to the wrong person?
Good morning,
Can you please return the value for wrun32.exe -v ?
Then, try to record a runtime trace file, so more information are available about what's possibly failing.
Add the following variables to your cblconfi:
FILE_TRACE 9
FILE_TRACE_FLUSH 1
FILE_TRACE_TIMESTAMP 1
Then run again adding the following option:
wrun32.exe -le runtime.log -c .....
Regards.