Highlighted
Absent Member.
Absent Member.
8624 views

173 error can't find called program

Jump to solution

[Migrated content. Thread originally posted on 27 July 2011]

In Visual COBOL, I'm new to this environment, I'm getting an 173 Called program file not found in drive/directory: DATE from my program doing a call to a common date routing. I have a folder with all my common routines. How/where do I point to this folder? Can I do this on a global basis so I don't have to do it for all my programs individually?
0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: 173 error can't find called program

Jump to solution
Is this managed code or native code that you are using?
How are these COBOL routines being packaged, as separate .dlls or compiled together as one .dll.

Is the name of the program that you are calling the same name as the .dll or is it an entry point within the .dll?

If this is a managed code project then it can be as simple as adding a reference in the calling programs project to the project of the called program.

To add a reference, right click on References for the calling programs project and select Add Reference. Then click the projects tab and select the name of the project where the called program resides.

If this is a native project then the .dll to be called needs to reside in the same folder as the calling program if the .dll has the same name as the program to be called. If it is not the same name then you need to preload the .dll to make the entry points known to the run-time using:

01 proc-pointer procedure-pointer.

set proc-pointer to entry "mydll.dll"
call "entryname"...

If you can provide more details as to how your solution is setup then I can be more precise in my response.

Thanks.

View solution in original post

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: 173 error can't find called program

Jump to solution
Is this managed code or native code that you are using?
How are these COBOL routines being packaged, as separate .dlls or compiled together as one .dll.

Is the name of the program that you are calling the same name as the .dll or is it an entry point within the .dll?

If this is a managed code project then it can be as simple as adding a reference in the calling programs project to the project of the called program.

To add a reference, right click on References for the calling programs project and select Add Reference. Then click the projects tab and select the name of the project where the called program resides.

If this is a native project then the .dll to be called needs to reside in the same folder as the calling program if the .dll has the same name as the program to be called. If it is not the same name then you need to preload the .dll to make the entry points known to the run-time using:

01 proc-pointer procedure-pointer.

set proc-pointer to entry "mydll.dll"
call "entryname"...

If you can provide more details as to how your solution is setup then I can be more precise in my response.

Thanks.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: 173 error can't find called program

Jump to solution
Our existing environment is Net Express so I created a new project in visual studio and did an add item, I added an existing program from Net Express (xyz.cbl). I am trying to get this to work with a minimum amount of changes so I don't have to change every program. Ideally I can setup global values so I don't have to change the program. I am going with the NATIVE code again so I can create .INT files and not have to change our execution scripts. Its defined as a console application. The DATE routine is a common routine we call in a lot of our programs, it is DATE.INT.

We want to move our NET EXPRESS environment to Visual Studio/Visual COBOL. We have a couple hundred COBOL programs to move over.

This is an sample of our existing code.

LINKAGE SECTION.
01 PARM-AREA. 05019K
05 AGENCY-PARM. 05019K
10 AGEN-PARM PIC X. 05019K
10 DIS-IND PIC X(3). 05019K
PROCEDURE DIVISION. 05019K
COPY PR-PARMS. 05019K
CALL 'DATE' USING DATE-HOLD.
MOVE CURRENT-YR TO HOLD-YR HOLD-STYR.
MOVE HOLD-YEAR TO YR.
DISPLAY 'ERBSN01P BEGINNING EXECUTION ON ' 10029F
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: 173 error can't find called program

Jump to solution
From my reading is sounds like I have to set a path in COBDIR but I haven't figured out what file this goes in or how to set it yet.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: 173 error can't find called program

Jump to solution
The output of a native COBOL project in Visual COBOL is an .EXE or .DLL depending on the type of project that was selected when it was created. You cannot create an .int in Visual COBOL if you are using the Visual Studio 2010 IDE.

You can, however create an .int in Visual COBOL using the command line and the cobol command using the INT"filename.int" directive.

You can call it if it is in the same folder as the .EXE or if it is in a location set by the COBDIR environment variable.

This environment variable can be set using Control Panel->System->Advanced->Environment Variables.

I would recommend though that you rethink this approach and repackage these programs as .dlls under Visual COBOL so that you can build them and debug them directly in the IDE.

If you create a native project that contains all of your source programs then they will all be available when the single .dll output for the project is loaded at runtime.

You can do this using the method I explained in the previous e-mail.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: 173 error can't find called program

Jump to solution
Chris Glazier originally wrote:
Is this managed code or native code that you are using?
01 proc-pointer procedure-pointer.

set proc-pointer to entry "mydll.dll"
call "entryname"...



I would recommend removing the ".dll" as this limits the portability of the CODE to Windows/.Net and would mean you have to change it for jvm or Unix/Linux.
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.