Topic
  • No replies
SystemAdmin
SystemAdmin
403 Posts

Pinned topic Windows Cobol ODBC with Oracle: IWZ096C Dynamic call of program failed

‏2012-12-20T17:26:31Z |
Dear All,

I am running a COBOL odbc program (odbc2eg.cbl) for Windows in RDZ V7.6 which is used to connect to Oracle database. All the calls in the program are rewritten using call identifier; one example is as shown below.

Code:
MOVE "SQLConnect" TO W-WK-PROGRAM-NAME
CALL W-WK-PROGRAM-NAME USING BY VALUE Hdbc
BY REFERENCE szDSN
BY VALUE SQL-NTS
BY REFERENCE szUID
BY VALUE SQL-NTS
BY REFERENCE szAuthStr
BY VALUE SQL-NTS
RETURNING SQL-RC

The oracle environment is setup properly as 'SQLPLUS' command gives oracle dialog asking for username and password. The program is compiled using the below command.

Code:
cob2 -v odbc2eg.cbl

It passes the compile and link-edit creates the odbc2eg.exe file. However I am getting run-time error at the call statement as shown below.

Sample ODBC 2 program starts
IWZ096C Dynamic call of program SQLAllocEnv failed. The load module
SQLAllocEnv.dll could not be found in the directories identified in
the COBPATH environment variable.
iwzrlib.dll : 0
iwzrlib.dll : 0
iwzrlib.dll : 0
odbc2eg.exe : 0
iwzrlib.dll : 0
odbc2eg.exe : 0
kernel32.dll : 0
IWZ901S Program exits due to severe or critical error.

The COBPATH environment variable points to library folder which contains the .lib files. There is no program named 'SQLAllocEnv.dll' and these are database related calls. Can anyone please help me out?

Regards,
Jay
Updated on 2013-01-23T20:52:51Z at 2013-01-23T20:52:51Z by outlaw
  • outlaw
    outlaw
    39 Posts

    Re: Windows Cobol ODBC with Oracle: IWZ096C Dynamic call of program failed

    ‏2013-01-23T20:52:51Z  
    Why did you convert all calls into dynamic ?

    You want the SQL calls to be static, so they can be bound at link time. They will not work as dynamic calls, as you found.

    Workstation COBOL currently limits dynamic calls such that the library (dll) name must match the entry point name - as the diagnostic message clearly shows.

    There are times when dynamic calls are called for, but static calls should be used wherever possible, due to better runtime performance.

    Not every object is a nail, therefore, one should not use a hammer on all objects ;)
    Richard A Nelson (Rick)
    COBOL Development IBM Silicon Valley Laboratory
    http://www.ibm.com/software/awdtools/cobol/