Highlighted
Knowledge Partner
Knowledge Partner
4137 views

Accessing RM Data files from Managed Visual COBOL

Hi,

I know it is possible to access RM/COBOL indexed files from a Visual COBOL Console app and that this app can be called by a Managed VC app.

But is it possible to use RM/COBOL indexed files directly from Managed code? If not, are you planning to add that support? It is crucial to move apps into Visual COBOL.

Regards

Juan Manuel Urraburu
Director of Technology @ ProRM & Axtrio
Micro Focus Knowledge Partner
LinkedIn

0 Likes
8 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Accessing RM Data files from Managed Visual COBOL

The capability of directly accessing both RM and ACU data files from within a managed code application is already in Visual COBOL.

Please see the product documentation here:

Thanks

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

RE: Accessing RM Data files from Managed Visual COBOL

Hi Chris,

Since what version is this supported? I am using 2.1 and no error happens but all data is empty.

Regards

Juan Manuel Urraburu
Director of Technology @ ProRM & Axtrio
Micro Focus Knowledge Partner
LinkedIn

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

RE: Accessing RM Data files from Managed Visual COBOL

Latest 2.2 version does not show RM data. Do you have a sample?

Juan Manuel Urraburu
Director of Technology @ ProRM & Axtrio
Micro Focus Knowledge Partner
LinkedIn

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Accessing RM Data files from Managed Visual COBOL

Access to ACU and RM data files has been supported since 2.1 through the IDXFORMAT directive or FILETYPE directive where 17 correcsponds to ACU and 21 corresponds to RM.

We have also added some features to the extfh.cfg file such as INTEROP and FOLDERS specification.
Please see the documentation here:

If you had an older release of Visual COBOL installed it may have installed a separate add on for Vision file support.
You may have to go to control panel and remove this add on.
Also the environment variables that were required previously on older versions are no longer required and should be removed from your computers environment if you are setting them.

This includes A_CONFIG and CONVERTSTATUS=RM.

A really simple example that will work in managed or native code is the following which uses IDXFORMAT"21" directive instead of using extfh.cfg file.

      program-id. Program1.
     $set idxformat"21"
          select rm-file assign to "testfile.dat"
                         organization is indexed
                         access is dynamic
                         record key is key1
                         file status is file-status.

      data division.
      fd rm-file.
      01 rm-record.
         05 key1  pic 9(3).
         05 rest  pic x(5).
      working-storage section.
      01 file-status pic x(2).
      procedure division.

          open output rm-file
          display "open = " file-status

          perform varying key1 from 1 by 1 until key1 > 10
             move all "X" to rest
             write rm-record
                invalid key
                 display "error = " file-status
             end-write
          end-perform

          close rm-file
          goback.

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

RE: Accessing RM Data files from Managed Visual COBOL

Hi Chris,

It works fine on a Console application (native), but on a Windows Form Managed Cobol no error is shown but data is empty.

Is anyone using RM/COBOL indexed files inside a Windows Form Cobol Managed app in Visual COBOL?

Regards,

Juan Manuel Urraburu
Director of Technology @ ProRM & Axtrio
Micro Focus Knowledge Partner
LinkedIn

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

RE: Accessing RM Data files from Managed Visual COBOL

I have the same problem using a Managed Console Application. Only works with native.

Juan Manuel Urraburu
Director of Technology @ ProRM & Axtrio
Micro Focus Knowledge Partner
LinkedIn

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

RE: Accessing RM Data files from Managed Visual COBOL

Well, I found the solution in ahother thread:

I have found that the 9/198 error when reading a vision file is a result of compiling the application for "Any CPU" on a 64 bit windows machine.  The fix that I have used is to change the "Platform target" on the COBOL configuration page for the project to "x86"

Juan Manuel Urraburu
Director of Technology @ ProRM & Axtrio
Micro Focus Knowledge Partner
LinkedIn

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Accessing RM Data files from Managed Visual COBOL

This is not a limitation in the latest product release.

I just tested this using a Winform application set to anyCPU using Visual COBOL 2.2 update 1 and it created and accessed both RM and ACU files correctly.

Thanks.

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.