You may want to run a totally different job, lets say some kind of an update or fix it kind function, but the current job has files opened (for input only) that may not be compatible with that update function you want to run. You can then start up a group job, which begins a totally seperate job. The *GDA (Group job *DTAARA) can be used to pass parms to the group job. You can leave the group job and continue in the original job right where you exited.
But I think you could also call a job and have it start a new activation group and basically do the same thing…. So my question is … what are the differences between starting up a group job and starting a new activation group.
Quick “Group Job” lab exercise:
<li>Sign on to two separate, fresh sessions. In the first, make sure you’re at the system MAIN menu. In the second, run WRKSBS and enter option 8 against your interactive subsystem so that you can see your first session job. (The following steps are for job #1 unless otherwise noted.)</li><li>Enter TFRGRPJOB. Review the error that should appear. (If no error appears, then this isn’t a truly “fresh” session. It’s already been set up as a group environment.)</li><li>Enter CHGGRPA MAIN. (Nothing visible should happen.)</li><li>Enter TFRGRPJOB. Review the error that should appear. (It should be different from the first error.)</li><li>Enter TFRGRPJOB CMDLN INLGRPPGM(QSYS/QUSCMDLN). (You should see the system command window.)</li><li>In job #2, press <F5=Refresh>. (You should see a secondary ACTIVE process under your original session job. The first process should have status GROUP.)</li><li>Enter TFRGRPJOB USER INLGRPPGM(QSYS/QUSCMDLN). (It should appear as if nothing changed.)</li><li>In job #2, press <F5=Refresh>. (You should see a third process has become ACTIVE. Both of the other processes are status GROUP.)</li><li>Enter GO USER. (The User Tasks menu should appear.)</li><li>Enter TFRGRPJOB. (You should see the earlier system command window display reappear.)</li><li>In job #2, press <F5=Refresh>. (You should see that the second process has gone ACTIVE while the others are GROUP.)</li><li>Enter TFRGRPJOB. (You should see the User Tasks menu reappear.)</li><li>Enter TFRGRPJOB MAIN. (You should see your original MAIN menu reappear.)</li><li>Enter TFRGRPJOB *SELECT. (You should see a list appear. You can choose to transfer to CMDLN or USER.)</li><li>Select CMDLN. (Your command window should reappear.)</li><li>Press <Enter> or <F3> or <F12> to drop out of the QUSCMDLN program. (You should see the MAIN menu reappear.)</li><li>Enter TFRGRPJOB *SELECT. (You should see the previous list reappear, but CMDLN has been removed.)</li><li>In job #2, press <F5=Refresh>. (You should see that the second process has disappeared.)</li><li>Press <F6=Start a new group job>. Enter OASSIST for Group Job, and QEZMAIN for Initial group program. (You should see the Operational Assistant menu appear.)</li>
The idea is that each workstation “session” can manage up to 16 separate sub-jobs — these are called “group jobs” since they exist as a related group.
You enable group jobs with CHGGRPA. You create (or transfer between) group jobs with TFRGRPJOB. You end group jobs by ending the initial group job program or with ENDGRPJOB.
The TFRGRPJOB command is slightly related to the TFRSECJOB command, which switches between primary and secondary jobs in a workstation session. Since those two sides of a workstation session can each handle 16 group jobs, you can have up to 32 ‘jobs’ going within a single ‘session’. You can’t directly transfer between group jobs that are not in the same primary or secondary job.
“Attention” programs are sometimes used to present menus that control which group jobs may be created by individual users. (A group job initial program perhaps would start by retrieving and saving any current attention program and assigning the attention program for group jobs.)
There are plenty of functional details. It takes practice to code programs that work well within group jobs without stepping on each other. Object locks can cause trouble for example.
But you can also present some handy utilities for users (or yourself.)
If I messed up anything in the series above, feel free to update it or post a comment and I’ll do it.