19
Sun, May
7 New Articles

ILE Activation Groups, Part 3

RPG
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

In Part 1 we looked at activation group basics.  Part 2 at types.

Editor's Note: This article is excerpted from chapter 17 of 21st Century RPG: /Free, ILE, and MVC, by David Shirey.

So, How Should Activation Groups Be Used?

Oh, I know what you want.

You want me to tell you exactly how to use the activation groups. What to use and when. Yeah, that sounds like a win-win for me. It will be almost like being at home with my family. They love to get advice from me.

But, I suppose there are some things I could say.

First, let’s consider the two values *NEW and named.

We said before that the difference between them was that *NEW assigns the name automatically, and named leaves that assignment up to you. But there is one other difference, too.

If you use *NEW, then the activation group ends when the last program in that group ends. It polices its own existence very nicely. That is because IBM assigns the name and so feels a certain responsibility for it.

But if you use named, then you have to do a RCLACTGRP to get it to stop. You name it, you reclaim it. Oh, yeah.

What seems to be important here is: how often is the stinkin’ job going to run? If it runs once every time the moon occults Arcturus, (one of my favorite stars), then I would think that it makes sense to have this run under *NEW so that cleanup occurs automatically when it is done. Chances are it is not going to run twice in a day, so you don’t lose anything by using *NEW and letting the system name the activation group.

On the other hand, if it is going to run repeatedly all day, then it makes sense to have an activation group just sitting out there waiting for the program to show up. In this case, make it named. But just remember to do a RCLACTGRP at the end of the day or whenever this job is likely to be done.

What does matter is the use of the *CALLER activation group. Anytime you have a situation where you have one program calling others in a group and you want to share resources (including overrides), the first program should be either *NEW or named, and the others should be *CALLER. Which option you use (*NEW or named) will depend on how you feel about being the one who cleans up the activation groups.

And what about QILE?

While you could use it to run your programs, it is probably the worst option to use simply because everybody might be using it, and you could very easily end up in a reclaim situation or an override situation that is not in the best interests of your application. The smart money here is on *NEW/named and *CALLER.

As I said earlier, the cool kids do not recommend using QILE, but the truth is I have seen references that go both ways.

One source that I consulted thought QILE was fine even though it required the reclaim.

Another source thought it was the worst option, and the author became visibly agitated when it appeared someone was going to use it. So much for the experts.

If it matters, IBM does not recommend QILE, and instead suggests the use of named activation groups. IBM make a good point in that activation groups were designed to represent applications, and so using a generic one is not exactly what they had in mind. Although the way they have marketed the i is not exactly what I had in mind (I would consider using the blonde, British girl from the Viagra commercials as their spokesperson), so you can decide. Plus, there is a difference between IBM technical advice and marketing advice.

In the end, the general rule of thumb is to start the first program in a sequence (like the C of an MVC) in a *NEW or named activation group, depending on whether you want to do the cleanup or have it done for you and how likely it is that the job will be rerun (and so can take advantage of an activation group that is just sitting out there waiting).

And most things that are called from that first program should be *CALLER.

And Service Programs?

The exception to this is service programs. Remember, service programs can be potentially called from a large number of other programs. So if you have a service program that is called by many apps and you use *CALLER for it, it could result in a copy of it being in many different activation groups.

But by naming the activation group of the service program when it is called, that activation group could stay open and be available to those many calls. The connection to the calling programs is still intact, as that is set up through the EXPORT keyword and the binding language entries. You would have to remember, however, that if you did this, then the static and global variables of the service program are going to be available to other environments, something that could be either good or bad. Or a non-issue. Plus, of course, you would have to clean up after it yourself. You should never let the need to clean up determine your choice of activation group types. Just remember to not forget it. Setting up the RCLACTGRP in a CL program that runs automatically once a day or whatever is probably the best way.

Bottom Line

But most important of all, pay attention to what needs to be done, if anything, to end an activation group. Don’t just assume it will happen because as we have seen in some cases, it doesn’t. And also pay attention to your programs, and to setting INLR on if you want the activation group to end.

Yeah, that’s the bitch of ILE: it gives you flexibility, but it forces you to take ownership and make some decisions. Welcome to the new millennium. Glad I could help simplify things.

WRKJOB: Work with Job Command

Just a final note about this command, as you may have not thought about it.

With this command you can see the activation groups that are involved with your job. Specifically, option 11 shows you the programs in the job and the activation group they are running in. Option 18 then shows you a list of the activation groups involved.

Want to learn more?  You can pick up Dave Shirey's book, 21st Century RPG: /Free, ILE, and MVC, at the MC Press Bookstore Today!

David Shirey

David Shirey is president of Shirey Consulting Services, providing technical and business consulting services for the IBM i world. Among the services provided are IBM i technical support, including application design and programming services, ERP installation and support, and EDI setup and maintenance. With experience in a wide range of industries (food and beverage to electronics to hard manufacturing to drugs--the legal kind--to medical devices to fulfillment houses) and a wide range of business sizes served (from very large, like Fresh Express, to much smaller, like Labconco), SCS has the knowledge and experience to assist with your technical or business issues. You may contact Dave by email at This email address is being protected from spambots. You need JavaScript enabled to view it. or by phone at (616) 304-2466.


MC Press books written by David Shirey available now on the MC Press Bookstore.

21st Century RPG: /Free, ILE, and MVC 21st Century RPG: /Free, ILE, and MVC
Boost your productivity, modernize your applications, and upgrade your skills with these powerful coding methods.
List Price $69.95

Now On Sale

BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$0.00 Raised:
$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: