Home > Archive > Cobol > June 2004 > CANCEL (85) and multiple levels of called programs
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
CANCEL (85) and multiple levels of called programs
|
|
| Richard Antony Burton 2004-06-16, 8:55 pm |
| Hi,
Could someone confirm my understanding of CANCEL (85 version). As I understand
it, if I cancel a program that I have called, it should reset the working
storage to initial values ready for the next time I call it again. And from the
85 version onwards, it should also cancel any programs were called by the
program that I called. Right?
I'm on Windows with Micros Focus Net Express 3.1, and have something like this:
Prog1 (exe) --CALL--> Prog2 (dll) --CALL-> Prog3 (dll)
Prog1 then cancels Prog2.
Prog1 (exe) --CALL--> Prog2 (dll) --CALL-> Prog3 (dll)
Prog2 working storage has been reset.
Prog3 working storage has *not* been reset.
This would seem to contradict my understanding. So am I wrong, or is MF doing
something wrong?
TIA,
Richard
| |
| Robert Wagner 2004-06-16, 8:55 pm |
| "Richard Antony Burton" <richardaburton-NOSPAM-@hotmail.com> wrote:
>Hi,
>
>Could someone confirm my understanding of CANCEL (85 version). As I understand
>it, if I cancel a program that I have called, it should reset the working
>storage to initial values ready for the next time I call it again. And from the
>85 version onwards, it should also cancel any programs were called by the
>program that I called. Right?
>
>I'm on Windows with Micros Focus Net Express 3.1, and have something like this:
>
>Prog1 (exe) --CALL--> Prog2 (dll) --CALL-> Prog3 (dll)
>Prog1 then cancels Prog2.
>Prog1 (exe) --CALL--> Prog2 (dll) --CALL-> Prog3 (dll)
>Prog2 working storage has been reset.
>Prog3 working storage has *not* been reset.
>
>This would seem to contradict my understanding. So am I wrong, or is MF doing
>something wrong?
MF is doing it right. Prog3 must be cancelled explicitly by prog2, its logical
parent, or by prog1, which would be poor structure IMO.
The Standard says a cancel will automatically cancel programs INCLUDED in prog2,
not those called by prog2. Included means nested compilations i.e. in the source
file of prog2.
If you want initial values always, an alternative to cancel is INITIAL in
program-id.
| |
| Richard Antony Burton 2004-06-18, 8:55 am |
|
"Robert Wagner" <robert.deletethis@wagner.net> wrote in message
news:40d0bdd5.22483499@news.optonline.net...
> MF is doing it right. Prog3 must be cancelled explicitly by prog2, its
logical
> parent, or by prog1, which would be poor structure IMO.
Thanks for clearing that up.
Richard.
|
|
|
|
|