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
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?
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?
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.
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.
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
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
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.
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.
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.
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.
Logs attached.
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.
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.
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.
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.
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.
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.
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...
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...
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
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
Good morning Chris.
Finally, was able to produce the log file for the application at issue, attached.
I'm still getting the error when running outside the IDE.
Thanks.
Good morning Chris.
Finally, was able to produce the log file for the application at issue, attached.
I'm still getting the error when running outside the IDE.
Thanks.
I am confused.
The log file you sent does not show any type of error that I can see.
It shows that program G:\\BUF075\\data\\close\\STRATA\\MF_Projects\\eclipse\\JTXCTM10\\RELEASE\\JTXCTM10.exe
executed and ran for 36 minutes doing various file reads, writes and sorts using the indexed file C:\\Strata51\\Conversion\\Simulation\\jtftmv10 and then shutdown correctly.
Is this trace file from a program run that actually failed?
I am confused.
The log file you sent does not show any type of error that I can see.
It shows that program G:\\BUF075\\data\\close\\STRATA\\MF_Projects\\eclipse\\JTXCTM10\\RELEASE\\JTXCTM10.exe
executed and ran for 36 minutes doing various file reads, writes and sorts using the indexed file C:\\Strata51\\Conversion\\Simulation\\jtftmv10 and then shutdown correctly.
Is this trace file from a program run that actually failed?
Sorry Chris. It appears that the log was created within the IDE. I was just excited to see a log file produced.
When I run outside the IDE a log file is not produced. It kicks out of execution almost instantly with the following:
rts32 : Error 164 encountered during initialization
I'm at a loss as to why it is not producing a log file. Is it safe to assume that the Cobol Server is installed when Visual Cobol is installed?
Lou
Sorry Chris. It appears that the log was created within the IDE. I was just excited to see a log file produced.
When I run outside the IDE a log file is not produced. It kicks out of execution almost instantly with the following:
rts32 : Error 164 encountered during initialization
I'm at a loss as to why it is not producing a log file. Is it safe to assume that the Cobol Server is installed when Visual Cobol is installed?
Lou
The run-time environment is installed as a standard part of the development product.
It sounds to me like perhaps you have some old Net Express run-time files within your system32, PATH or application folders? Can you check to ensure that the only copy of cblrtsm.dll on your system is the one in the Visual COBOL\\bin and bin64 folders?
You can use the following command to check all of your C drive:
where /R C:\\ cblrtsm.dll
You could also try to compile and run a simple helloworld program from a Visual COBOL command prompt just to ensure that the compiler and run-time are working correctly.
Save the following as helloworld.cbl:
id division.
program-id. helloworld.
working-storage section.
01 any-key pic x.
procedure division.
display "hello world!"
accept any-key
stop run.
run the following commands:
cbllink helloworld.cbl
helloworld
Does this work successfully?
The run-time environment is installed as a standard part of the development product.
It sounds to me like perhaps you have some old Net Express run-time files within your system32, PATH or application folders? Can you check to ensure that the only copy of cblrtsm.dll on your system is the one in the Visual COBOL\\bin and bin64 folders?
You can use the following command to check all of your C drive:
where /R C:\\ cblrtsm.dll
You could also try to compile and run a simple helloworld program from a Visual COBOL command prompt just to ensure that the compiler and run-time are working correctly.
Save the following as helloworld.cbl:
id division.
program-id. helloworld.
working-storage section.
01 any-key pic x.
procedure division.
display "hello world!"
accept any-key
stop run.
run the following commands:
cbllink helloworld.cbl
helloworld
Does this work successfully?
Thanks Chris,
I sort of thought that the runtime environment was part of the development install.
I have run other NetX 5.1 migrated applications with no issue. In fact the program that produces the input (ISAM) for the program at issue works fine.
Micro Focus Server 5.1 is installed on the same machine. I did find cblrstm.dll in one of its folders. I renamed it to cblrstm.dll.NE51 to no avail. I also have put the Visual Cobol version of that dll in the application folder.
I'm perplexed as to why it appears to not even enter the application at issue. I do have some compiler directives set at the project level: IDXFORMAT"3" ODOSLIDE ASSIGN"EXTERNAL" ARITHMETIC"ENTCOBOL". When I first encountered the runtime error I had none. Then added the IDXFORMAT only. With no luck.
Thanks Chris,
I sort of thought that the runtime environment was part of the development install.
I have run other NetX 5.1 migrated applications with no issue. In fact the program that produces the input (ISAM) for the program at issue works fine.
Micro Focus Server 5.1 is installed on the same machine. I did find cblrstm.dll in one of its folders. I renamed it to cblrstm.dll.NE51 to no avail. I also have put the Visual Cobol version of that dll in the application folder.
I'm perplexed as to why it appears to not even enter the application at issue. I do have some compiler directives set at the project level: IDXFORMAT"3" ODOSLIDE ASSIGN"EXTERNAL" ARITHMETIC"ENTCOBOL". When I first encountered the runtime error I had none. Then added the IDXFORMAT only. With no luck.
Try the where command on the cblviom.dll as well.
where /R C:\\ cblviom.dll
You shouldn't copy run-time .dlls between folders as they sometimes get left behind and end up causing mismatch problems like the one I believe you are having now.
Is the application being linked as dynamic? Check the project properties-->Micro Focus-->Build Configurations-->Link-->Run-time model option and set this to dynamic and rebuild it.
If you .zip up the executable and send it to me at chris.glazier@microfocus.com I will take a look at it in my environment.
Thanks Chris,
I sort of thought that the runtime environment was part of the development install.
I have run other NetX 5.1 migrated applications with no issue. In fact the program that produces the input (ISAM) for the program at issue works fine.
Micro Focus Server 5.1 is installed on the same machine. I did find cblrstm.dll in one of its folders. I renamed it to cblrstm.dll.NE51 to no avail. I also have put the Visual Cobol version of that dll in the application folder.
I'm perplexed as to why it appears to not even enter the application at issue. I do have some compiler directives set at the project level: IDXFORMAT"3" ODOSLIDE ASSIGN"EXTERNAL" ARITHMETIC"ENTCOBOL". When I first encountered the runtime error I had none. Then added the IDXFORMAT only. With no luck.
Chris,
I believe the issue has been resolved.
I used Dependency Walker on the executable in issue. It appears that cblrtsm.dll was never loaded due to missing imports (see attached).
I checked other executables that were working and Dependency Walker did not include cblrtsm.dll.
I then compared the build configuration of the good applications vs. the one at issue and discovered that under the link the runtime model used was dynamic vs. shared (shared was set when I imported the NEX 51 application).
So far everything seems to be working.
Thank you for your time and effort.