Highlighted
Absent Member.
Absent Member.
863 views

The CALL statement

Jump to solution

I'm using Visual COBOL in Visual Studio 2015 and I'm having trouble doing a simple CALL statement.  In NetExpress the called program .CBL had to be in the same directory and it always worked.  Not sure where to put the called .CBL program in Visual COBOL.  This is a very simple program to show students how to retrieve the date in various formats using a CALL statement instead of hard coding the code.  I've tried to place it in various different folders but get the following error:

173     Called program file not found in drive/directory [DATE-TIME] 

I've even created a folder called [DATE-TIME] and placed the code inside of this folder but I get the same result.  Here is the code

IDENTIFICATION DIVISION.
PROGRAM-ID. DATE-TIME-EXAMPLE.
*  
******************************************************************
*
* This is an example of a program that "calls" another program
* (in this case the DATE-TIME program).
*
******************************************************************
ENVIRONMENT DIVISION.
DATA DIVISION.

WORKING-STORAGE SECTION.
COPY DATE-TIME.COP.
01 DUMMY pic X.

PROCEDURE DIVISION.
100-MAIN.
CALL 'DATE-TIME' USING DATE-TIME-PASS-AREA
DISPLAY DATE-YYMMDD
DISPLAY DATE-MMDDYY
DISPLAY DATE-MMDDYY-SLASHES
DISPLAY DATE-YYYYMMDD
DISPLAY DATE-MMDDYYYY
DISPLAY DATE-MMDDYYYY-SLASHES
DISPLAY TIME-HHMMSSXX
DISPLAY TIME-HHMMSSXX-COLONS
display 'Finished'
accept dummy
STOP RUN.

Any help would be appreciated

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: The CALL statement

Jump to solution

You might want to have a look at this great tutorial made by [mention:d603b3bbafb34624b638067562f96d5f:e9ed411860ed4f2ba0265705b8793d05] on projects and solutions, which will help you to understand how and where Visual COBOL or Visual Studio creates its output files.

–Ғɑɳօ

View solution in original post

0 Likes
3 Replies
Highlighted
New Member.

RE: The CALL statement

Jump to solution
In my case I store the compiled object code in the same directory for both the host and the called program and Visual Cobol works just like Server Express used to. Can you try that? As long as you have COBPATH set you should be good.
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: The CALL statement

Jump to solution
You do not call .CBL programs, you call the compiled programs as either .INT, .GNT or .DLLs depending on the compile options that you are using.

If you have a main .EXE which issue the call statement:
CALL 'DATE-TIME' USING ...
It would be looking for a program called DATE-TIME.int, DATE-TIME.gnt or DATE-TIME.dll in the same folder as the main .EXE.
If it is in a different location then you would need to point to that folder by setting COBPATH.

What is the name of your subprogram as it resides on disk?
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: The CALL statement

Jump to solution

You might want to have a look at this great tutorial made by [mention:d603b3bbafb34624b638067562f96d5f:e9ed411860ed4f2ba0265705b8793d05] on projects and solutions, which will help you to understand how and where Visual COBOL or Visual Studio creates its output files.

–Ғɑɳօ

View solution in original post

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.