Re: inter subprogram in initial state, but only sometimes



Charles,
Just to clarify (and like you - I know MVS better than VSE - and this ONLY
applies to IBM "mainframes"),

If the subprogram is statically link-edited in, then you are correct a CANCEL
has no impact. (This is why IBM documents that the DYNAM compiler option is
required for ANSI conformance).

HOWEVER, if a statically called subprogram has the "IS INITIAL" phrase of the
program-id paragraph, then it *IS* placed into "initial state" upon every call.
There is a SHARE requirement to make CANCEL work like this too - but I wouldn't
hold my breath for it to happen.

***

In answer to Frank's original question, I do not know of any "single statement"
that a subprogram can use to place itself in "initial state" (sometimes) the
next time it is called.

P.S. There are also issues about Local-Storage vs. Working-Storage (and initial
state), but I don't think VSE supports Local-Storage yet.

--
Bill Klein
wmklein <at> ix.netcom.com
"charles hottel" <jghottel@xxxxxxxxx> wrote in message
news:b721e$43acc269$4f9c609$19654@xxxxxxxxxxxxxxxx
> If the CALLED program is statically linked it should remain in it's last used
> state I think (not 100% sure of this since it is VSE and I my mind is tired
> from a sore throat). To put it back into its initial state code a paragraph
> that does this, and since it knows when it want to do this, you can PERFORM
> the paragraph at that time. I assume you are already avoiding things like
> ALTER GOTO.
>
> <top post no more below>
>
> "Frank Swarbrick" <Frank.Swarbrick@xxxxxxxxxxxxxx> wrote in message
> news:413kmpF1db8d0U1@xxxxxxxxxxxxxxxxx
>>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: Why 13 years?
    ... > space station for the next 30 years as a waist of money. ... > will say cancel VSE because its not sustainable financially, ... > will the US do in space since they know about VSE? ... The US government? ...
    (sci.space.policy)
  • Re: COBOL Working Storage being reset
    ... The subprogram has no 'cancel' and there ... is no LOCAL-STORAGE-SECTION. ... COBOL Working Storage being reset ... A subprogram is usually left in its last-used state when it terminates ...
    (bit.listserv.ibm-main)
  • Re: Why 13 years?
    ... senates and presidents will say cancel ... >>VSE because its not sustainable financially... ...
    (sci.space.policy)