search for some of the manuals they have there and read them even if they are not the compiler you are using. The answer to your question will be there.
there is a great difference between call and perform.
With call "another-programm" you start a separate programm. The mainprogramm waits, till the end of the called programm. The communication between the programms ar the fields after "using". You use "call", when you need the result of the call-programm in more then one programm.
Example:
call "another-programm" using field1 field2 field3 ....
--------------------------------------------------------
perform is a part of the mainprogramm
Example:
.....
perform programm-part.
.....
.....
programm-part section.
pps-000.
here you can do anything.
end-section.
The first trys to find AT RUN-TIME a program with a name that matches the CONTENT of the data-name (in storage at the time of the CALL statement)
While the literal format can (but is NOT REQUIRED TO) do "early binding" (i.e. look for the sub-program at "link-edit" or "bind" or "compile" time.
***
There are also differences (in effect (not in semantics) beween calling a "separtely compiled" subprogram vs calling a nested program (one included in the same comilation unit at the calling program).
For nested programs, you would also want to learn about the "COMMON" and "GLOBAL" attributes.
While for separately compiled programs you would want to know about EXTERNAL, USING (both on CALL and Procedure Division syntax) and RETURNING phrase.
***
Next, when doing a CALL statement you should understand the difference between
CALL ... USING
BY REFERENCE (the default)
BY CONTENT (introduced in the '85 Standard)
BY VALUE (common extension and in the '02 Standard)
***
Of course, the INVOKE statement (of "::" inline invocation operator) is used for Object Orientation - and the '02 Standard also introduces "user defined functions".
Various vendors have a variety of extensti on or substym interfaces such as:
CHAIN
EXEC CICS LINK / XCTL
And in VERY old COBOL you might find the
ENTER statement
(not to be connfused with the ENTRY extension)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.