Skip to main content

Error "173 Called program file not found in drive/directory" trying call C DLL from Cobol on Windows

  • September 13, 2021
  • 5 replies
  • 3 views

Hi,

I'm hoping there's someone who can assist. I am a consultant assisting a customer migrate their mainframe Cobol application to AWS/Windows/MF. I have responsibility for a certain C DLL that needs to be called from some of the Cobol programs. The test Cobol program is clean compiled; however, am having trouble getting passed the error:

Load error : file 'n3sgau'
error code: 173, pc=0, call=1, seg=0
173 Called program file not found in drive/directory

The file n3sgau.dll has been copied to every possible location that I have seen reference to on the web. It's in a folder in %PATH%; in a folder in %COBPATH%, in the folder that the Cobol program executable is being run from.

Have tried with and without using the following (and variations of it):

01  LOAD-DLL-PTR                USAGE PROCEDURE-POINTER.
SET LOAD-DLL-PTR TO ENTRY "n3sgau.dll"
SET LOAD-DLL-PTR TO ENTRY "n3sgau"

Have used DEBUG and breakpoints at the above SET statements (LOAD-DLL-PTR has H"00000000").

Does anyone have any suggestions of where to go next?


#c
#C
#call
#DLLError
#COBOLVISUALCOBOLMIGRATION

5 replies

Gael Wilson
Forum|alt.badge.img
  • Rocketeer
  • September 13, 2021

Hi,

I'm hoping there's someone who can assist. I am a consultant assisting a customer migrate their mainframe Cobol application to AWS/Windows/MF. I have responsibility for a certain C DLL that needs to be called from some of the Cobol programs. The test Cobol program is clean compiled; however, am having trouble getting passed the error:

Load error : file 'n3sgau'
error code: 173, pc=0, call=1, seg=0
173 Called program file not found in drive/directory

The file n3sgau.dll has been copied to every possible location that I have seen reference to on the web. It's in a folder in %PATH%; in a folder in %COBPATH%, in the folder that the Cobol program executable is being run from.

Have tried with and without using the following (and variations of it):

01  LOAD-DLL-PTR                USAGE PROCEDURE-POINTER.
SET LOAD-DLL-PTR TO ENTRY "n3sgau.dll"
SET LOAD-DLL-PTR TO ENTRY "n3sgau"

Have used DEBUG and breakpoints at the above SET statements (LOAD-DLL-PTR has H"00000000").

Does anyone have any suggestions of where to go next?


#c
#C
#call
#DLLError
#COBOLVISUALCOBOLMIGRATION

One thing to check is that all of that DLL's dependencies are present. If you run 

link -dump -imports n3sgau.dll

that shows any other DLLs that that DLL depends on. If any of those cannot be found then it will fail to load.


One thing to check is that all of that DLL's dependencies are present. If you run 

link -dump -imports n3sgau.dll

that shows any other DLLs that that DLL depends on. If any of those cannot be found then it will fail to load.

I'll check that Gael. Thanks.


I'll check that Gael. Thanks.

I've checked and all of the DLL's that the main DLL is dependent on are in %PATH%. Any other thoughts?


Gael Wilson
Forum|alt.badge.img
  • Rocketeer
  • September 13, 2021

I've checked and all of the DLL's that the main DLL is dependent on are in %PATH%. Any other thoughts?

Are the COBOL executable and C DLL the same bit-ism ?

link -dump -headers n3sgau.dll

will show whether the dll is an x86 or x64 dll. The COBOL code will have to be compiled for the same  bit-ism.


Are the COBOL executable and C DLL the same bit-ism ?

link -dump -headers n3sgau.dll

will show whether the dll is an x86 or x64 dll. The COBOL code will have to be compiled for the same  bit-ism.

Thank you Gael. That was it :-)