Can someone kindly tell me what is the real advantage of using an activation group. I mean other than the fact that we can deactivate a bunch of programs together what real advantage does activation group provide us over not using it.
Prior to ILE Activation groups, every program ran in a given job shared certain resources, with activation groups these are shared only within an activation group.
I'll point you toward the ILE Concepts manual
All ILE programs and service programs are activated within a substructure of a job called an activation group. This substructure contains the resources necessary to run the programs. These resources fall into the following general categories: Static program variables Dynamic storage Temporary data management resources Certain types of exception handlers and ending procedures
The separation of these resources among activation groups supports a fundamental concept. That is, the concept that all programs activated within one activation group are developed as one cooperative application.
The temporary data management resources include the following:
Open files (open data path or ODP)
Commitment definitions Local SQL cursors
Remote SQL cursors
Hierarchical file system (HFS)
User interface manager
Query management instances
Open communications links
Common Programming Interface (CPI) communications
But what's the benefit you asked. Simple really, when working with applications and/or tools from various vendors, activation groups provide for segregation between them.
Let me provide a "real-life" example of activations groups saving the day. I was building a application that used Scott Klement's awesome HTTP API tooling. As is best practice, the *SRVPGM was defined with ACTGRP(*CALLER). My use case, PGMA, required maintaining a persistent connection to a given end point. However, periodically, I also needed to call PGMB which also used HTTP API to hit another endpoint. HTTP API isn't designed to support multiple connections at the same time. However, by simply running PGMA and PGMB is separate activation groups, I could get multiple copies of the HTTP API *SRVPGM activated and successfully connect to multiple endpoints at the same time.