tags:

views:

110

answers:

1

Hello everyone,

I'm still learning how to program but I have a simple question. I have the following code for running an executable COBOL program through C++, but I am getting COBOL errors: 251 and 410

#include <iostream>
#include <windows.h>

using namespace std;

int main(){
    system("C:\\rmcobol\\runcobol.exe SOLOCAJA.COB c=windows.cfg L=WOWRT.DLL"); 
    cout << "\n";
    system("pause");  
    return 0;
}

I assume there must be a very simple reason for this, but I am clueless so far. Any help would be highly appreciated.

+2  A: 

Error 410 is a "configuration file not found" error based on Apendix A of the user guide. Are you sure your windows.cfg file is in the directory you're running your code in?

Failing that, error 251 states "Incorrect runtime command" and all the samples I can find have an uppercase C. So maybe change your C program to use to:

system("C:\\rmcobol\\runcobol.exe SOLOCAJA.COB C=WINDOWS.CFG L=WOWRT.DLL");

and see if that fixes it (a long shot, I know, but I've seen stranger things than that).


Based on update:

I tried changing the c to a C on the C=WINDOWS.CFG, ran it in C++ and directly on the Command Line, no change. I am still looking into the reasons behind this, and I read through tek-tips.com/viewthread.cfm?qid=1119251&page=5 but I couldn't use any of that info. Any extra tips would be gold at this point. THANKS!

A couple of questions:

  • Has it ever worked in this environment?
  • Is it failing on both cmdline and within C (just want to clarify)?
  • Does windows.cfg actually exist in the current directory when you run it?
  • Are you running it in a directory with spaces (like My Documents)?

Other than that, maybe post the windows.cfg file, though the error seems pretty explicit that it's config file not found rather than error in config file.

paxdiablo
awg3
1. This is the first time I test it on this environment.2. It is failing on both cmdline and within C.3. Yes it does exist.4. The directory has no spaces.I don't understand why this doesn't work. Perhaps it is conflict with the RM/COBOL or the compiler? I am trying to keep it real simple using DevC++ and C++ code to run the program before I decide to implement it.
awg3
All I can suggest at this point is to (if it's been running elsewhere) try and figure out the difference between the running and non-running environment. Beyond that, all I can do is suggest you contact the vendor: http://supportline.microfocus.com/xmlloader.asp?type=home# ... sorry I couldn't be more helpful.
paxdiablo
thanks a lot for the help though! I will contact the vendor, if I find a solution I will post it
awg3