Most businesses have to find ways to improve, or they don't stay in business. Many places have suggestion boxes so that employees can recommend ways of increasing productivity or improving the working environment.
I'd like to put a suggestion into your suggestion box: use group jobs to increase the productivity of users and data processing staff!
What Are Group Jobs?
By default, an interactive job is not a group job. You can run only one job in the session. To run additional jobs, you must start other sessions. You can use the system request key to get an alternate sign-on screen, but that limits you to two jobs. You can use the jump key to get two more sessions if your terminal has a jump key, but most models don't. With PC Support and Client Access, you can use the hot key. Under OS/2 or Microsoft Windows, you can run multiple emulation sessions in separate windows, or you can just go find another available terminal. All of these methods, however, require you to sign on to the system again.
Group jobs allow you to run up to 16 distinct interactive jobs in one session; you sign on only once. (You can use the previously mentioned methods, such as the system request or jump key, to start other groups of up to 16 jobs. I reserve these for when I need to use a different user profile from my usual programmer profile.)
Each of the 16 group jobs has its own QTEMP library, library list, call stack, job log, and so forth. Issuing a Change Job (CHGJOB) command does not affect the other group jobs. The only common resource (besides the workstation, of course) is the group data area (*GDA), which you can read and modify from any group job.
Only one group job is active at a time. The rest are suspended. The Transfer to Group Job (TFRGRPJOB) command allows you to switch from one group job to another and to add new jobs to the group. It is customary to put the TFRGRPJOB command in the Attn key program so you can use the Attn key to switch jobs. Using this technique is not a requirement, but it simplifies handling group jobs.
How Are Group Jobs Created?
To change a nongroup job into a group job, use the Change Group Attributes (CHGGRPA) command.
CHGGRPA GRPJOB(MAIN) + TEXT('Main group job')
The current interactive job is now a group job called MAIN. The text description is not required, but it is helpful.
Now that you've changed your interactive job to a group job, up to 15 more jobs can be added to the group. You add jobs to the group with the TFRGRPJOB command. In the Group job (GRPJOB) parameter, specify a unique name (a name not already used by one of the other group jobs) for the job. In the Initial group program (INLGRPPGM) parameter, specify the name of the program you want the system to run when the group job is created.
TFRGRPJOB GRPJOB(APENTRY) + INLGRPPGM(APC100)
This creates a new group job called APENTRY, running program APC100 (found by searching the library list). Now, two jobs are in the group.
Besides starting the APENTRY job, APC100 sets the attention key program with the Set Attention Program (SETATNPGM) command. The attention key program runs the TFRGRPJOB command to return the user to the first group job (MAIN), when the Attn key is pressed.
Group Jobs for Programmers
Interruptions are a way of life for programmers; I often have three or more projects going on at once. Group jobs help programmers juggle the workload.
Here's an easy, yet effective, way for a programmer to use group jobs. Create CL program ATN002CL from the source code in 1.
Here's an easy, yet effective, way for a programmer to use group jobs. Create CL program ATN002CL from the source code in Figure 1.
Change your user profile to run this program when you press the Attn key.
CHGUSRPRF USRPRF(user_profile) + ATNPGM(ATN002CL)
Add the following code to your user profile's initial program and compile. (If you have no initial program, create a program from the following code and change your user profile's initial program to the name of the program you create.)
RTVGRPA MONMSG MSGID(CPF1311) + EXEC(CHGGRPA GRPJOB(MAIN))
The above code checks to see if your interactive job is a group job, and, if it isn't, makes it a group job called MAIN.
Sign off, and then sign back on for these changes to take effect.
Now, imagine that you're working on a billing program. You have the library list set to include a test library so you won't mess up production files. You're in debug mode. You've issued some overrides and CHGJOB commands for testing purposes. Suddenly, the telephone rings. It's your boss telling you to alter a payroll program immediately.
You press the Attn key, press F6 to start a new group job, and type PAYROLL for the name and QCMD for the initial program. The system retrieves your user profile, runs your initial program, and calls up your initial menu. You set the library list for payroll, edit the payroll program, and recompile. When you're finished, you press the Attn key again, type 1 next to MAIN, press Enter, and you're back to the billing program, where everything is just as you left it.
You can add more group jobs as necessary. If you want to remove a job from the group, type the End Group Job (ENDGRP-JOB) command at a command line while that group job is active.
Group Jobs for Users
Just as you dislike interruptions, users dislike having to completely dismantle what they're doing to handle a higher-priority task. Imagine how you would feel if someone interrupted you with a request for information while you were keying vendor invoices into your accounts payable system. You'd have to suspend the batch you're keying into, navigate a few menus, start an inquiry program, look up some information, answer the request, hang up the telephone, end the inquiry program, renavigate the menus, restart the data entry job, reopen the batch, find the point where you left off, rekey any fields you had keyed on the screen when you were interrupted, and, finally, finish the transaction. This method is inefficient and causes needless frustration.
Imagine the same situation with group jobs. You are keying a transaction. The boss interrupts you with a request for information. You press the Attn key and select the group job that runs the inquiry program. After looking up the information and answering the request, you press the Attn key again, select the data entry job, and continue where you left off.
Setting Up Group Jobs
There's no one correct way to set up group jobs. 2 contains CL program INT002CL that shows one approach. Here, to keep things simple, I start five different group jobs: four display a different OS/400 menu and one signs you off. Assume that this program is your initial program, that your initial menu is *SIGNOFF, and that your profile specifies ATN002CL (see 1) as the Attn key handling program.
There's no one correct way to set up group jobs. Figure 2 contains CL program INT002CL that shows one approach. Here, to keep things simple, I start five different group jobs: four display a different OS/400 menu and one signs you off. Assume that this program is your initial program, that your initial menu is *SIGNOFF, and that your profile specifies ATN002CL (see Figure 1) as the Attn key handling program.
When you sign on, the system runs INT002CL. The first thing INT002CL does is retrieve the group job name of the job. Since the job is not a group job, the first IF statement (labeled A) proves true (&GRPJOBNAME is equal to '*NONE'). The nongroup job becomes a group job named SIGNOFF. The next command is a transfer to group job MAIN. Since there is no MAIN job in the group, this adds a new job to the group. Job SIGNOFF is suspended. If the operator transfers back (normally through the "Transfer to Group Job" panel presented when the Attn key is pressed) to SIGNOFF, the program will continue running at the next command (at label JOB_01).
The new job starts running, executing program QCMD. QCMD reads the user profile, finds that INT002CL is the initial program, and starts running it. At this point, two copies of INT002CL are running from the terminal. The first copy is in job SIGNOFF, and it is suspended just before label JOB_01. The second copy is in job MAIN. The first IF proves false, but the second one (labeled B) is true because &GRPJOBNAME is now equal to 'MAIN'. The system changes the text description of this group job, MAIN, to 'AS/400 Main Menu' and transfers to group job ASSIST. As before, this is a new group job, so the system creates job ASSIST, suspends MAIN, transfers to ASSIST, and begins to run QCMD. If you return to MAIN, execution will continue at label JOB_02.
This process continues, each group job creating the next and each running different parts of INT002CL. The last group job created should transfer to the group job you want to begin working with when you sign on. That's when you finally get a screen that allows you to do something. In this case, the last group job, DATA, transfers to job MAIN, and you begin working. You can press the Attn key at any time to see the name of the active group job, plus a list of the suspended group jobs.
When you finish working, type SIGN-OFF at a command line (if you have access to one), choose a menu option to sign off (if there is one), or press the Attn key and select the SIGNOFF group job, which will prompt the SIGNOFF command. Signing off ends all group jobs.
This program could easily be modified to become more useful. For example, instead of displaying menus, you could call application programs. The main group job might display an Accounts Payable main menu, another group job might call a vendor inquiry program, and another might call a Customer inquiry program. Whatever menus you decide to display or applications you decide to run, the important thing is that this method allows you to set up a group of jobs that you can easily transfer between.
It's Easy and It's Free
I've given you an easy way to increase productivity without buying hardware or software. Check out the OS/400 Work Management V3R1 guide for more ideas than the few I can cover here. It has a whole chapter devoted to group jobs.
The older I get, the more convinced I am that life is what you make of it. Group jobs can greatly improve the quality of office life for you and the people who depend on the computer you oversee.
Ted Holt is an associate technical editor for Midrange Computing.
Reference
OS/400 Work Management V3R1 (SC41-3306, CD-ROM QBKALG00).
Getting Started with Group Jobs
Figure 1: Attention Key Program ATN002CL
/*==================================================================*/ /* To compile: */ /* */ /* CRTCLPGM PGM(XXX/ATN002CL) SRCFILE(XXX/QCLSRC) */ /* */ /*==================================================================*/ PGM TFRGRPJOB GRPJOB(*SELECT) MONMSG MSGID(CPF1310) ENDPGM
Getting Started with Group Jobs
Figure 2: Initial Program INT002CL
/*==================================================================*/ /* To compile: */ /* */ /* CRTCLPGM PGM(XXX/INT002CL) SRCFILE(XXX/QCLSRC) */ /* */ /*==================================================================*/ PGM DCL VAR(&GRPJOBNAME) TYPE(*CHAR) LEN(10) MONMSG MSGID(CPF1310) EXEC(GOTO CMDLBL(SIGNOFF)) MONMSG MSGID(CPF9999) RTVGRPA GRPJOB(&GRPJOBNAME) IF COND(&GRPJOBNAME *EQ '*NONE') THEN(DO) CHGGRPA GRPJOB(SIGNOFF) TEXT('Sign off') TFRGRPJOB GRPJOB(MAIN) INLGRPPGM(QCMD) JOB_01: ? SIGNOFF LOG(*NOLIST) MONMSG MSGID(CPF6801) /* F3 or F12 */ TFRGRPJOB GRPJOB(*PRV) GOTO CMDLBL(JOB_01) ENDDO IF COND(&GRPJOBNAME *EQ 'MAIN') THEN(DO) CHGGRPA TEXT('AS/400 Main Menu') TFRGRPJOB GRPJOB(ASSIST) INLGRPPGM(QCMD) JOB_02: GO MENU(MAIN) MONMSG MSGID(CPF9999) TFRGRPJOB GRPJOB(*PRV) GOTO CMDLBL(JOB_02) ENDDO IF COND(&GRPJOBNAME *EQ 'ASSIST') THEN(DO) CHGGRPA TEXT('Operational Assistant') TFRGRPJOB GRPJOB(USER) INLGRPPGM(QCMD) JOB_03: GO MENU(ASSIST) MONMSG MSGID(CPF9999) TFRGRPJOB GRPJOB(*PRV) GOTO CMDLBL(JOB_03) ENDDO IF COND(&GRPJOBNAME *EQ 'USER') THEN(DO) CHGGRPA TEXT('User Tasks') TFRGRPJOB GRPJOB(DATA) INLGRPPGM(QCMD) JOB_04: GO MENU(USER) MONMSG MSGID(CPF9999) TFRGRPJOB GRPJOB(*PRV) GOTO CMDLBL(JOB_04) ENDDO IF COND(&GRPJOBNAME *EQ 'DATA') THEN(DO) CHGGRPA TEXT('Files, Libraries, and Folders') TFRGRPJOB GRPJOB(MAIN) INLGRPPGM(QCMD) JOB_05: GO MENU(DATA) MONMSG MSGID(CPF9999) TFRGRPJOB GRPJOB(*PRV) GOTO CMDLBL(JOB_05) ENDDO /* If you want to let the user start new jobs, + activate the following RETURN command, + otherwise new jobs will be signed off immediately */ /* RETURN /* Go to initial menu specified in user profile */ SIGNOFF: SIGNOFF LOG(*LIST) ENDPGM
LATEST COMMENTS
MC Press Online