Vision File Access in Visual Cobol

[Migrated content. Thread originally posted on 25 March 2011]

We are very new at the .net world but have purchased Visual Cobol because it can access our current vision file data without converting the data (so we understand).

Our first issue is that we can't seem to find a way to get a project to see our current vision data files. Can someone please send me some pointers/clues/hints on how you get a new project to see a vision data file.

Thanks for ANY help.
Parents
  • I'll assume by "seeing" these files, you mean you want your programs to use Vision files instead of MF ISAM files. To do this, you need to enable the Vision (Acu) file handler by adding a compiler directive.

    Before you do this, you should also know that you can only use ACUFH in a Native (not Managed) project. This selection is done when you create the project. I don't know if you can convert an existing Managed-code project to Native, or vice-versa (anyone else want to answer this?).

    The directive for using the ACUFH file handler is:

    CALLFH("ACUFH")
    This can be set in Visual Studio in your Project's Properties page (in the COBOL category, under "Additional Directives".

    You can also set it for individual programs, by adding it directly in your COBOL source program using a $SET statement. At the top of the program (ahead of the Identification Division) put:

          $SET CALLFH("ACUFH")
           Identification Division.
          *  comment

    (be sure the $SET starts in column 1 or 7, depending on the type of source format you use. In other words, the same column you put the asterisk for comments).

    Also, you may need to set config variables that affect the Vision file handling - what you would have done in ACUCOBOL using a runtime config file (cblconfig). Things like V_VERSION, V_BUFFERS, etc. (I'm not sure what the full list of supported variables is). The ACUFH file handler will look for /etc/cblconfig by default. You can specify your own config file by setting the A_CONFIG environment variable. To do this in your Visual COBOL project, follow these steps:

    1. In the Solution Explorer, under your project look for a file named Application.config. If it isn't there, add it: right-click the project, select Add -> New Item. In the window that pops up, select Application Configuration File, then click the Add button.
    2. Double-click the Application.config file. In the small window that pops up, click on the Environment tab. In the Name field, type A_CONFIG and in the Value field type the name of your config file (I called mine "acufh.cfg").

    If you don't include a full path to the config file, it will assume the current directory - by default the directory where the VC puts the compiled executable (e.g. workspace\project\bin\x86\debug). That's also where it will look for (and create) data files. If you want to keep them in a different directory, you can set your project's working directory explicitly. Open the Project's Properties, click on the Debug category, then under Start Options you can set your working directory. You can put a fully-qualified path, but this could prevent your project from being portable (if you want to move it, or share a copy with someone). The path, however, appears to be relative to the Project directory, so if you want the working directory to be the Workspace directory just put ".." in the Working Directory field (to indicate the parent directory of the project, which is the workspace). At least it seemed to work for me - Your Mileage May Vary!
Reply
  • I'll assume by "seeing" these files, you mean you want your programs to use Vision files instead of MF ISAM files. To do this, you need to enable the Vision (Acu) file handler by adding a compiler directive.

    Before you do this, you should also know that you can only use ACUFH in a Native (not Managed) project. This selection is done when you create the project. I don't know if you can convert an existing Managed-code project to Native, or vice-versa (anyone else want to answer this?).

    The directive for using the ACUFH file handler is:

    CALLFH("ACUFH")
    This can be set in Visual Studio in your Project's Properties page (in the COBOL category, under "Additional Directives".

    You can also set it for individual programs, by adding it directly in your COBOL source program using a $SET statement. At the top of the program (ahead of the Identification Division) put:

          $SET CALLFH("ACUFH")
           Identification Division.
          *  comment

    (be sure the $SET starts in column 1 or 7, depending on the type of source format you use. In other words, the same column you put the asterisk for comments).

    Also, you may need to set config variables that affect the Vision file handling - what you would have done in ACUCOBOL using a runtime config file (cblconfig). Things like V_VERSION, V_BUFFERS, etc. (I'm not sure what the full list of supported variables is). The ACUFH file handler will look for /etc/cblconfig by default. You can specify your own config file by setting the A_CONFIG environment variable. To do this in your Visual COBOL project, follow these steps:

    1. In the Solution Explorer, under your project look for a file named Application.config. If it isn't there, add it: right-click the project, select Add -> New Item. In the window that pops up, select Application Configuration File, then click the Add button.
    2. Double-click the Application.config file. In the small window that pops up, click on the Environment tab. In the Name field, type A_CONFIG and in the Value field type the name of your config file (I called mine "acufh.cfg").

    If you don't include a full path to the config file, it will assume the current directory - by default the directory where the VC puts the compiled executable (e.g. workspace\project\bin\x86\debug). That's also where it will look for (and create) data files. If you want to keep them in a different directory, you can set your project's working directory explicitly. Open the Project's Properties, click on the Debug category, then under Start Options you can set your working directory. You can put a fully-qualified path, but this could prevent your project from being portable (if you want to move it, or share a copy with someone). The path, however, appears to be relative to the Project directory, so if you want the working directory to be the Workspace directory just put ".." in the Working Directory field (to indicate the parent directory of the project, which is the workspace). At least it seemed to work for me - Your Mileage May Vary!
Children
No Data