× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Cancel would work Michael - as long as the advice in the manual for using a variable is followed.

i.e. Move 'MYPROG' to ProgName.
Cancel ProgName. <-- This works

Cancel 'MYPROG'. <-- This doesn't.

The reason the first one works is that the program pointer is cleared as well as the program's reset mechanism being invoked. The second simply resets the program - which is rather like what happens in ILE RPG when you set on LR i.e. the program is flagged to reset on next call.

This is all ILE to ILE.

Cancel will _not_ work OPM to ILE or vice versa.

Cancel OPM to OPM is implemented differently to ILE but the same approach should work.



On 2013-07-01, at 8:58 PM, MichaelQuigley@xxxxxxxxxx wrote:

Jon,

Does a CANCEL statement in the calling program simply set the same program
object for re-activation? i.e., Will the next call after a CANCEL use the
same pointer with all storage in its initial state or will the pointer to
the program object also be resolved again?

Thanks,
Michael Quigley
Computer Services
The Way International
www.TheWay.org

cobol400-l-bounces@xxxxxxxxxxxx wrote on 06/28/2013 03:52:29 PM:
----- Message from Jon Paris <jon.paris@xxxxxxxxxxxxxx> on Fri, 28
Jun 2013 15:52:19 -0400 -----

To:

"COBOL Programming on the IBM i \(AS/400 and iSeries\)" <cobol400-
l@xxxxxxxxxxxx>

Subject:

Re: [COBOL400-L] COBOL for RPG programmers: How do you shut down a
program?

If you mean other COBOL programs then you're out of luck without
some messing about.

One way to do it is to change the program that calls this one so
that it calls via a variable not a literal. Then when the program is
to be switched out change the variable temporarily to another
program, call it, then change the variable back and the pointer will
be re-resolved.

Really this is no different from an RPG IV program in an AG. The
problem you have lies not with how _this_ program exits but rather
how you tell the _caller_ to re-resolve the pointer.


On 2013-06-28, at 2:18 PM, David Gibbs <david@xxxxxxxxxxxx> wrote:

On 6/28/2013 1:10 PM, Jon Paris wrote:
Is it COBOL/400 or ILE COBOL. If ILE COBOL what activation group.
It is also important to know if it is the first COBOL program in a
series or one later in the chain.

It's an OPM program.

It looks like there are other programs on the call stack in front
of the program that's causing the problem.

david

--
IBM i on Power Systems - For when you can't afford to be out of
business
--
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/cobol400-l.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.