The CALL statement

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

  • 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.
  • 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?
  • Verified Answer

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