Highlighted
Lieutenant Commander
Lieutenant Commander
406 views

Executable runs in IDE but errors outside IDE

I'm tasked with migrating some custom NetX 5.1 native Cobol applications to Visual Cobol 3.0 using Eclipse IDE.

When running an executable outside the IDE, I receive the following error:

Load error: file <executable-path>\cblviom.dll

error code: 164, pc=0, call=1, seg=0

164 RRun-Time subprogram not found.

I do have the system and account Path Environmental pointing to the both the \bin and \binn directories.

I moved the cblviom.dll to the application directory to no avail.

This is a 32-bit program with the project settings directives as: IDXFORMAT"3" ODOSLIDE

0 Likes
18 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

We have just released Visual COBOL 6.0 so 3.0 is a few product versions back at this point.

Is this a standalone executable or is it calling other programs? If there are other programs, are they all recompiled with  Visual COBOL?

For a test, open up a Visual COBOL 32-bit command prompt from the Micro Focus Visual COBOL group on the Windows Start menu and try running the application from there.

Does this work or do you get the same error?

0 Likes
Highlighted
Lieutenant Commander
Lieutenant Commander

Chris,

Thank you for the quick response.

I know we're behind in versions but I'm just dealing with what we have.

Anyway, this is a stand alone program running in a Win10 environment.  It simply reads an ISAM file and sorts the records for ease of further processing.  It is a customized version of a CGI program as part of their Strata simulation solution.

I did run the app through the Visual Cobol 32-bit command prompt and received the same error.  

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

This error can occur if the run-time system is picking up an improper version of a dependency file such as the COBOL run-time or other .dll which is required by the run-time file.

We can normally track this down by performing a CTF trace on the application and reviewing the log file that is created.

Instructions for running CTF:

Create a CTF config file called ctf.cfg and place it in your application folder.

Set the following environment variable like:

set MFTRACE_CONFIG=c:\appdir\ctf.cfg
replace c:\appdir with the name of your application folder containing ctf.cfg.

Run your program.

This should generate a trace file with the extension .log.
Please attach this to the post so I may review it.

ctf.cfg should contain the following:

mftrace.level=debug
mftrace.dest=TEXTFILE

## Emitter TEXTFILE
mftrace.emitter.textfile#location=.\

## Component Run-time System
mftrace.comp.mf.mffh.xfh#all=true
mftrace.comp.mf.mffh.fs#all=true
mftrace.comp.mf.rts#pgm=true
mftrace.comp.mf.rts#api=true
mftrace.comp.mf.rts#signal=true
mftrace.comp.mf.rts#syspgm=true
mftrace.comp.mf.rts#memory=true
mftrace.comp.mf.rts#external=true
mftrace.comp.mf.rts#mfentmap=true
mftrace.comp.mf.rts#mfpm=true
mftrace.comp.mf.rts#pgmload=true

0 Likes
Highlighted
Lieutenant Commander
Lieutenant Commander

It seems I cannot produce the log file.  Sorry, I'm getting my feet wet in this environment.

In the ctf.cfg file I replaced 

mftrace.emitter.textfile#location=.\ with the directory of the application, i.e.,

mftrace.emitter.textfile#location=C:\Strata51\Conversion\Runtime

after no log file was produced.

I set the MFTRACE_CONFIG to C:\Strata51\Conversion\Runtime\ctf.cfg in the General Release Build\Build Configuration\Build Environment.  Then "built all" to recreate the executable.

When that didn't work, I created an Windows User Account environmental variable and still no log file produced.

I ran the application using a bat file that sets the input data set to be selected in the program.  I don't know if that has anything to do with it.

 

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

MFTRACE_CONFIG is an environment variable that needs to be turned on at run-time before running your application. You do not need to recompile anything.

Open up a Visual COBOL command prompt and enter:

SET MFTRACE_CONFIG=C:\Strata51\Conversion\Runtime\ctf.cfg

Then in the same command prompt run your bat file to start your application.

The trace file should then be produced.

0 Likes
Highlighted
Lieutenant Commander
Lieutenant Commander

Logs attached.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

The CTF log files that you attached appear to be tracing the COBOL compilation process and not the run of your application. Are you starting the correct .bat file at run-time?

What is the name of your application? This name should appear in the name of the trace file such as:

<myapp>.<processid>.textfile.log

where myapp would be the name of your executable and process-id would be the numeric process-id used when the process was run.

0 Likes
Highlighted
Lieutenant Commander
Lieutenant Commander

Chris,

I was able to generate a trace log for the program that produces the input for the program at issue.  So, I feel comfortable that the procedure used to produce the logs is fine. 

At this time, I am not able to produce the logs for the program at issue.  I suspect with all the tweaks that the program it is no longer executing properly.  I plan on re-visiting to debug and run within the IDE to ensure I have a good executable.  Then I will proceed from there.

Thank you for your assistance to this point.

0 Likes
Highlighted
Lieutenant Commander
Lieutenant Commander

Chris,

I did re-visit the IDE environment. 

Running in debug mode on the Generic Debug Build was successful.

Running the executable in the Generic Release Build was successful.

The good news is I no longer receive the original run-time error message.  However, now the application does not execute at all.  No matter how I try to execute it, running a bat file from VC command prompt to assign input or hard coding the input and either running the exe from command prompt or double clicking the exe, nothing happens.

I put some displays at the beginning of the program and they don't appear when trying to run the exe.

Could it be compiler directives?  I'm not that versed in what directives are required when.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Do any errors appear after trying to start the program from the command line?

After starting the program, does it appear in Task Manager as a running process or is it being ended right away?

Can you still get a CTF trace file for the application? This might tell us what is going on...

0 Likes
Highlighted
Lieutenant Commander
Lieutenant Commander

Chris,

No errors appear starting the program from the command line.  On <enter> the next prompt is returned immediately.

I couldn't determine it the process went into task manager.

CTF logs are not produced.  I would imagine that it is because the app did not execute.

I did look at the Event Viewer both system and application logs.  There were no errors there.

I don't know if this matters but I'm working from home connected through the company vpn and the VC development environment is on a virtual PC with Win 10.

Lou

 

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.