× 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.


  • Subject: Re: ILE Activation groups...thanks but still in need
  • From: Dave Mahadevan <mahadevan@xxxxxxxx>
  • Date: Fri, 16 Apr 1999 17:15:31 -0400
  • Organization: Stoner and Associates

Brad:

CEETREC kills the group in which it was called.  So after CEETREC, no commands
will be executed.  It is like *ESCAPE with controlled close of everything
including itself at the end.  Try this in a program with many opens, opnqryf
etc. but dont close any of the files.  Issue CALLPRC CEETREC and presto all
files closed, programs removed from the stack, completely cleaned up.  Here is
the dope from the manual.

AS/400 Advanced Series: System API Reference OS/400 Integrated Language
Environment (ILE) CEE APIs
SC41-3861-00

2.6 Normal End (CEETREC) API

+--- Parameters ---------------------------------------------------------+
¦                                                                        ¦
¦ Omissible Parameter Group:                                             ¦
¦                                                                        ¦
¦ +--------------------------------------------------------------------+ ¦
¦ ¦  1 ¦ cel_rc_mod                            ¦ Input  ¦ INT4         ¦ ¦
¦ +----+---------------------------------------+--------+--------------¦ ¦
¦ ¦  2 ¦ user_rc                               ¦ Input  ¦ INT4         ¦ ¦
¦ +--------------------------------------------------------------------+ ¦
+------------------------------------------------------------------------+

The Normal End (CEETREC) API is used to do a normal ending of the activation
group containing the nearest control
boundary.  First, the terminate-imminent condition is sent to give all
intervening call stack entries a chance to clean up, or
stop the end operation.  All call stack entries to the nearest control boundary
end unless the resume cursor is moved while
handling the terminate-imminent condition.  If the call stack entry for the
control boundary is also the oldest call stack entry
in the activation group, the activation group ends, provided that call stack
entries were ended.

2.6.1 Omissible Parameter Group

cel_rc_mod (input)
    A language-specific return code passed from one ILE language to another ILE
language.  The value and meaning is
    language-specific.

user_rc (input)
    A number representing the user portion of the activation group return code.
If this parameter is not supplied, the
    CEETREC API uses the current contents of the activation group return code.
If it is supplied, it takes precedence over
    previously set values.

2.6.3 Usage Notes

   A normal end operation by high-level language exit statements is implemented
by calling the CEETREC API.  The
    termination-imminent condition is sent to the control boundary.

   The activation group and job-level return codes are updated whether or not
the activation group ended, provided call
    stack entries were canceled.

   This API cannot end the default activation group.


"Stone, Brad V (TC)" wrote:

> Dave,
>
> This is the third time I've seen mention of this.  How does CEETREC know
> which AG to kill?  For example...
>
> CLPGM1 (compiled with AG MYAG)
>
> PGM
> CALL            RPGPGM1 /*compiled with AG *CALLER */
> CALLPRC CEETREC
> ENDPGM
>
> When I call CLPGM1, MYAG is created.  it then calls RPGPGM1, then it calls
> CEETREC.  Does this destroy the MYAG activation group for this job?  If so,
> how does it know which AG to kill?
>
> Thanks!
>
> Bradley V. Stone
> Taylor Corporation - OASIS Programmer/Analyst
> bvstone@taylorcorp.com
>
> > -----Original Message-----
> > From: Dave Mahadevan [SMTP:mahadevan@fuse.net]
> > Sent: Friday, April 16, 1999 1:02 PM
> > To:   RPG400-L@midrange.com
> > Subject:      Re: ILE Activation groups...thanks but still in need
> >
> > I use named activation groups and CALLPRC CEETREC and kill the group on
> > exit.
> > This way there is no chance of a problem.  I strongly disagree with *NEW
> > option.  But if you do, I suggest you CALLPRC CEETREC to kill the group on
> > exit.
> >
> > "Stone, Brad V (TC)" wrote:
> >
> > > > Brad, if you see this, thanks...
> > > >
> > > No problem... answers below...
> > >
> > > > But,
> > > > 1.  do I need to do a RCLACTGRP??  Ron ?, at an advanced rpgiv/ILE
> > > > seminar in Atlanta, said yes.  With the advice received, I think I
> > need
> > > > to follow the same plan, but back up to the subsystem menu CL to do
> > the
> > > > reclaim, with the called submenu starting up a named actgrp.  IE, main
> > > > menu1 calls menu 2, menu 2 starts an actgrp, ends and menu1 reclaims
> > > > actgrp...?????
> > > >
> > > I don't see why you should reclaim your activation groups every time.
> > I'd
> > > be interested in hearing reasons why this is a good idea unless your
> > > changing library lists all the time (see my example from the earlier
> > mail).
> >--

Thank You.

Regards

Dave Mahadevan.. mailto:mahadevan@fuse.net


* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the RPG/400 Discussion Mailing List!  To submit a new         *
* message, send your mail to "RPG400-L@midrange.com".  To unsubscribe   *
* from this list send email to MAJORDOMO@midrange.com and specify       *
* 'unsubscribe RPG400-L' in the body of your message.  Questions should *
* be directed to the list owner / operator: david@midrange.com          *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.