Highlighted
Absent Member.
Absent Member.
2209 views

file not found when running cobol application from file explorer

Jump to solution

i am running cobol server. I have COBDATA set as an environment variable system wide (this is a development box). my project is managed code multiple output. If I open a Visual Cobol command prompt and execute the program, the files that the programs references are found. If I double click the program to run it cannot find the files even though it can see COBDATA. 

Is this normal behavior?

0 Likes
3 Solutions

Accepted Solutions
Highlighted
Absent Member.
Absent Member.
so, I copied a few of the environment variables that were present when a visual cobol command prompt is opened.
the Path variable had three lines pointing to bin, binn64 and bin64. Now the cobol program will run from the file explorer

View solution in original post

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert
After reviewing the incident I can see that you were actually trying to open up files in RM format and not MF format which is what I tested with. Since the operation to open RM files is actually passed onto a different file handler, it is most likely that this file handler itself and not the actual data files is what could not be found. Including the bin folders in the PATH would allow this file handler to be called successfully.

Thanks,

View solution in original post

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert
Since this is a managed code application file I-O for MF files will be directed to the managed MF file handler which is MicroFocus.COBOL.FileHandler which is a .NET assembly which is installed into the Global Assembly Cache under the C:\Windows\Microsoft.Net folder. This is located without the use of a PATH setting.

There is no managed version of the RM file handler so file I-O for RM files will be directed to the native RM file handler acufh.dll which is in the bin folder and does require a PATH setting in order for it to be located.

View solution in original post

15 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert
COBDATA should be handled the same way regardless of how the application is started. What are you setting COBDATA to? Is it a full path name to a folder on the local drive or a network drive or are you using a relative path name? When you double-click on the executable are you running it from the same startup folder as when you open up a Visual COBOL command prompt?

Are you running on the same machine on which COBOL Server is installed or are you running from a different machine which is mapped to the COBOL Server machine?
0 Likes
Highlighted
Absent Member.
Absent Member.
cobdata is set to a local drive on the server. D:\data
I have all my application binaries in D:\binaries and am running them from there.
Cobol Server is installed on C:\Program File(x86)\Micro Focus\COBOL Server

All of this is running on a windows server VM.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert
and COBDATA is being set as a system environment variable under Control Panel, is that correct?
0 Likes
Highlighted
Absent Member.
Absent Member.
correct
0 Likes
Highlighted
Absent Member.
Absent Member.

0 Likes
Highlighted
Absent Member.
Absent Member.
this same behavior occurs on my win 10 machine. When I run a cobol program from Visual studio cobdata is located just fine. When I run it by double clicking the program the program sees the environment variable but throws errors when it tries to access files.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert
This works fine here on my system.
What is the file status being returned on the open? Is it a 35?
What type of file is it?
What product version are you using?
0 Likes
Highlighted
Absent Member.
Absent Member.
error 30

On the server I am running 2.3
On my dev machine I am running 2.3

I've created a program that demonstrates the issue. Shall I open a support ticket for this?
0 Likes
Highlighted
Absent Member.
Absent Member.
so you are saying that the behavior is the same when a program is run from within visual studio and when executed from the file manager?
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert
Yes, it works from within VS and File Manager for me. Yes please open up a support incident and we can do a screen share to see what is happening on your end.
0 Likes
Highlighted
Absent Member.
Absent Member.
ok, I will open an incident
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.