inter subprogram in initial state, but only sometimes



I know that if you put the "IS INITIAL" clause on the PROGRAM-ID statement
it will reload all of working-storage every time the program is called.
I also know that the calling program can CANCEL the called program in order
to remove it from memory, thus causing a "new" version of the program to be
loaded the next time it is called.
But is there a way for the CALLED program to basically cancel itself once it
is complete? In other words, I want the sub-program to sometimes be entered
in it's last used state and sometimes in it's initial state. But only the
sub-program itself needs to know when it wants to do one and when it wants
to do the other. Of course it could pass something back to the caller
instructing the caller to cancel it, but the caller is not forced to obey
this.

I don't actually have a need for this, but it did get me thinking...

COBOL for VSE/ESA 1.1.1

Thanks,
Frank


---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
.



Relevant Pages

  • Re: inter subprogram in initial state, but only sometimes
    ... >> sub-program itself needs to know when it wants to do one and when it ... >working-storage items, close files etc and generally return itself to ... >What does cancel achieve that a few moves and closes would not? ... Frank Swarbrick ...
    (comp.lang.cobol)
  • Re: inter subprogram in initial state, but only sometimes
    ... > But is there a way for the CALLED program to basically cancel itself once ... I want the sub-program to sometimes be ... Of course it could pass something back to the caller ... > Frank Swarbrick ...
    (comp.lang.cobol)
  • Re: Alternative COBOL "telco" source program
    ... > If the caller does a Cancel, Values will be there on the next Call. ... > caller forgets or abends or someone else calls your .dll, ... required usage is not redundant. ...
    (comp.lang.cobol)
  • Re: Alternative COBOL "telco" source program
    ... > If the caller 'forgets' to cancel and expects initial values then it ... > is a program bug. ... Reminds me of an old saw, in which I still believe: ...
    (comp.lang.cobol)
  • Re: CANCEL Mis-behaving
    ... Frank Swarbrick wrote: ... As soon as the cancel statement is processed, Program A exits for no ... What is your reasoning behind performing the CANCEL? ... COBOL that used an assembler routine to do dynamic calls ...
    (comp.lang.cobol)