I'm trying to set the data file path for an mf cobol project. I've tried setting COBDATA in App.config but that get a fil status 35 on the file. If I move the file to the object code directory the file reads no problem. Is there maybe another variable to set in MF cobol
COBDATA should work to cause the file handler to search the specified directory name for the file you are trying to open provided that the file name does not already have a path specified.
Is this a managed code or native code project and what does your select statement look like? What does your COBPATH look like?
This is a managed cobol application using rm files
COBDATA is set to the location of the data files
COBPATH is not set since I am not compiling into int, gnt or lbr files.
This works fine for me even with RM data files.
Is this program part of an .exe or is it in a .dll that is being called? If it is in a .dll and is being called then the app.config file containing COBDATA must be specified for the main executable of the application as app.config will be ignored if it is specified for the .dll project.
Can you show me what the content of COBDATA looks like?.
I have a main c# project that is the entry point for the application. my managed cobol programs are being compiled in to class libraries.
this if from the config file in the cobol project
<add key="COBDATA" value="Z:\*************\dataFiles" />
what format should I add COBDATA to the main config?
Like I said you cannot use an app.config in a Class Library project as it will not be loaded. You would have to add the COBDATA environment variable to the app.config of the C# main program, or set the environment variable prior to starting the application or within the C# program using something like environment.SetEnvironmentVariable, etc.
The quotes are fine. This does a static assignment to a file named Z-SOMPR-FL that resides on disk.
The problem is in how you are setting COBDATA.
Try setting this in the computers environment to see if your program then works as expected.
Which product version are you using? I am testing with 2.3 update 2. It could be that RM data files did not use COBDATA in earlier releases but I would have to do some checking. If I know the version you are using then I can test this.
If you hard code the name "Z:\FDAMainMenuSolution\dataFiles\Z-SOMPR-FL" into the select statement does it find it OK?
Micro Focus Visual COBOL 2.3 Version 2.3.02187.
I can hard code the file path into the program and it finds the file.