Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perform? Call?

Status
Not open for further replies.

170179

Programmer
Dec 28, 2004
4
0
0
BE
Hello everybody,

I want to know what is the difference between:
CALL Prog1.
CALL 'Prog1'.
PERFORM Prog1.

and in so Prog1 is a program? a procedure? a paragraph?

Thanks

 
Did you bother to search on your compiler reference manual?

If not then go to or 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.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Hi,

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.

Regards.

Helmut
 
Just for the "archives"

There are also differences between

Call data-name
vs
Call "literal"

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)

Bill Klein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top