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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Micro Focus Cobol/2 Call External Cobol Program 1

Status
Not open for further replies.

frankielen

Programmer
Jun 13, 2001
2
MY
I need the help urgently,

I am writing a MF Cobol/2 program, and because of the program size > 64k base memory, so I split into into few programs, including some call-function programs.

My problem is, after calling the sub-program and with Exit-Program from the called program and back to the main program, I found that it does not release and close the sub-program, and when I try to call another sub-program, I got the RT 157 - Out of Memory.

Anybody can tell me how to close the sub-program and release the memory after return from the called program ?

I need the solution urgently...thanks.

 
HI,
I think you should use CANCEL Command in the main program.

after your used CALL and your exited from the called program, use CANCEL Command, it will release the memory.
bye
my e-mail <faoco@courrier.net>


 
I tried to use CANCEL command to release it, but seem to be the system still holding the sub-program in the memory, here is the example program :-

main program:-

01 ws-link-alpha.
03 ws-link-01 pic x(10).
03 ws-link-02 pic x(20).

procedure division.
...
...
call &quot;sub-program&quot; using ws-link-alpha.
cancel &quot;sub-program&quot;.
...
call &quot;sub-program2&quot; using ws-link-alpha.
(cause RT 157 - Out of Memory)

Sub-program:-
linkage section.
01 ws-link-alpha.
03 ws-link-01 pic x(10).
03 ws-link-01 pic x(20).
procedure division using ws-link-alpha.
...
...
exit program.
stop run.


 
I'm a mainframe guy, so I don't know if these comments apply.

Pgms can be designated as static or dynamic. Static subpgms are part of the main pgm, so can't be deleted from memory.

Some other mainframe concepts that may be causing your problem are:

reusable
resident

Check how you are building you modules to see if any of these concepts are being invoked.

You may also want to take out the &quot;stop run&quot;; it's not being executed but the compiler might be misled by its presence. Who knows? My next suggestion may be a chiken foot. But try these first.

Regards, Jack.
 
Hi,

the problem is that the cancel can't work because of the static call you are using.

When the statement is:

CALL &quot;MYPROG&quot; USING...

because of the literal it is static.

if you code

01 MYPROG PIC X(8) VALUE &quot;MYPROG&quot;.

CALL MYPROG USING ...

it is clear that it is dynamic.

Without changing your program perhaps there is a COBOL option to convert the static calls into dynamic. They sometimes have that.

Regards,

Crox
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top