Teach your AS/400 to pick up after itself.
Brief: Keeping total DASD usage under control is on everybody's mind. This article shows you how you can use Operational Assistant's automatic cleanup function to great advantage.
Operational Assistant has many personalities. It lets you control printed output, change system values, send messages-the list of its abilities is impressive. You'd think that it must have a high price tag but, in fact, it comes free of charge with OS/400. This article shows you one facet of Operational Assistant: its automatic cleanup function, which you can use to remove from the system old, unwanted information such as messages in message queues, problem logs, job logs, history logs, journal receivers, and so on.
Operational Assistant is comprised of many menus, all of which are linked together to make up a tree. You can learn more about this menu tree in "Operational Assistant Lends a Hand," MC, November 1992. For our purposes, however, only two menus are important: ASSIST and CLEANUP.
Starting Up Operational Assistant
To access Operational Assistant, type the following command at the command line:
GO ASSIST
The system presents the Operational Assistant main menu (ASSIST), which is shown in 1. Alternatively, you can set your user profile so that the ASSIST menu shows up when you press the Attention key. To accomplish this, specify ATNPGM(*ASSIST) in the Change User Profile (CHGUSRPRF) or Change Profile (CHGPRF) command.
The system presents the Operational Assistant main menu (ASSIST), which is shown in Figure 1. Alternatively, you can set your user profile so that the ASSIST menu shows up when you press the Attention key. To accomplish this, specify ATNPGM(*ASSIST) in the Change User Profile (CHGUSRPRF) or Change Profile (CHGPRF) command.
Of all the options in the ASSIST menu, the one that interests us is option 11, which leads us to the SETUP menu. Following that, take option 2 to reach the CLEANUP menu.
The CLEANUP Menu
Once you become familiar with Operational Assistant and with system commands, you'll realize that you could have taken a shortcut by simply typing the following command:
GO CLEANUP
Either way (GO ASSIST followed by options 11 and 2, or GO CLEANUP) takes us to the Cleanup Tasks menu (CLEANUP), which you can see in 2.
Either way (GO ASSIST followed by options 11 and 2, or GO CLEANUP) takes us to the Cleanup Tasks menu (CLEANUP), which you can see in Figure 2.
Customizing Automatic Cleanup
Operational Assistant's cleanup feature should be customized before being used, because the default settings may not be to your liking. Take option 1 to set the automatic cleanup options to the values that suit your particular installation. 3 illustrates the panel that appears.
Operational Assistant's cleanup feature should be customized before being used, because the default settings may not be to your liking. Take option 1 to set the automatic cleanup options to the values that suit your particular installation. Figure 3 illustrates the panel that appears.
The first input field must be "Y" for Operational Assistant to perform cleanup for you. It's the OFF/ON switch that controls the cleanup feature.
Cleanup will start automatically at a given time. You can set it to a fixed time every day or set it to *NONE if you'd rather start cleanup manually yourself.
If you have OS/400 V2R1 or later, you can also set it to *SCDPWROFF. This value works in conjunction with the Power Schedule feature. Cleanup will start at the scheduled power-off time and, after cleanup finishes, the system will power off automatically.
Once you've specified a start-time for cleanup, you can indicate what areas are to be cleaned up automatically. You can select up to five areas:
1. User messages-Messages that were sent to specific users and that have been in the user's message queue longer than a given number of days. The system needs to obtain an exclusive lock on the message queue in order to clean it up; therefore, if the user is signed on, the user's message queue won't be cleaned up.
2. System and workstation messages-Messages that were sent to specific workstations or to QSYSOPR and that have been in the message queues longer than a given number of days. Like user message queues, workstation and QSYSOPR message queues must not have any locks in effect in order to be cleaned up. If a particular workstation is signed on, that workstation's message queue won't be cleaned up-ditto for QSYSOPR.
3. Job logs and other system output-Job logs, program dumps and service dumps accumulate on the system. This option allows you to delete them after a certain number of days. When Operational Assistant's clean-up is first activated, the system changes printer files QPJOBLOG, QPSRVDMP, QPPGMDMP and QPBASDMP to ensure that their output goes to special output queues. That makes it easier to manage them. For job logs, the output queue is QUSRSYS/QEZJOBLOG. For all types of dumps, it's QUSRSYS/QEZDEBUG. It should be noted that these output queue changes remain in effect even when the cleanup operation is ended.
4. System journals and system logs-Deletes the following, when older than a given number of days:
o Journal receivers for system journals QAOSDIAJRN, QDSNX, QSNADS, QSXJRN, QPFRADJ and QACGJRN.
o History files (QSYS/QHST* files).
o Problem logs, provided that system value QPRBHLDITV allows it.
Then it reorganizes problem log database files in QUSRSYS: QASXCALL, QASXFRU, QASXNOTE, QASXPROB, QASXPTF, QASXYMP and QASXEVT.
o Alert database entries. After deleting the entries, cleanup reorganizes database file QUSRSYS/QAALERT.
o Many PTF-related objects.
5. OfficeVision/400 calendar items-Reorganizes documents and database files from the OfficeVision/400 product.
Activating and Deactivating Cleanup
You can take CLEANUP menu options 2 and 3 to activate cleanup. Option 2 schedules it for the time you selected in option 1. Option 3 activates cleanup immediately, which is good for on-demand usage.
If you select option 2, you don't have to worry about activating cleanup again; it will automatically schedule itself the next time. In this case, you may want to deactivate it manually using option 4 for those cases when you need a dedicated system or need to perform certain tasks that would be slowed down by cleanup.
Further Customizing Cleanup
Cleanup can be customized even beyond the options maintained by option 1. If you wish, you can change the IBM-supplied QSYS/QEZUSRCLNP program, which is executed whenever cleanup runs. As originally shipped, this program does nothing at all.
To change this program, follow these steps:
1. Run the Retrieve CL Source (RTVCLSRC) command. This generates CL source code in a source physical file of your choice. The source file can be in any library; in order to avoid problems, select one of your own libraries rather than a system library such as QSYS. Assuming you have a source file QCLSRC in library MYLIB, you should run:
RTVCLSRC PGM(QSYS/QEZUSRCLNP) + SRCFILE(MYLIB/QCLSRC)
2. Run SEU to insert the cleanup tasks you want to perform. For example, you could insert several Reorganize Physical File Member (RGZPFM) commands to reorganize your production database files. You could also take advantage of the opportunity to clear libraries QRPLOBJ and QRCL, if you so desire. Immediately after retrieval, the source code for QEZUSRCLNP looks like that in 4. Take a moment to reformat the source code before you do anything else. Start off by running the command prompter on each statement (move the cursor to a statement, press F4 and then Enter). This reformats the statements in a more readable way. Then you can remove the QSYS/ qualifiers. What's left is illustrated in 5.
2. Run SEU to insert the cleanup tasks you want to perform. For example, you could insert several Reorganize Physical File Member (RGZPFM) commands to reorganize your production database files. You could also take advantage of the opportunity to clear libraries QRPLOBJ and QRCL, if you so desire. Immediately after retrieval, the source code for QEZUSRCLNP looks like that in Figure 4. Take a moment to reformat the source code before you do anything else. Start off by running the command prompter on each statement (move the cursor to a statement, press F4 and then Enter). This reformats the statements in a more readable way. Then you can remove the QSYS/ qualifiers. What's left is illustrated in Figure 5.
3. Sign on as QSECOFR and run the Create CL Program (CRTCLPGM) command to recompile this program:
CRTCLPGM PGM(QSYS/QEZUSRCLNP) + SRCFILE(MYLIB/QCLSRC) + USRPRF(*OWNER) + REPLACE(*YES)
From now on, cleanup will run your own additional disk-saving routines.
Say Goodbye to Garbage
Automatic cleanup relieves you from the tedium of having to start housecleaning chores yourself. With the customized cleanup program, you can include any other cleaning task that Operational Assistant doesn't perform, such as deleting scratch libraries, deleting old spool files, and so on. In fact, there's no limit to what the automatic cleanup can do.
You will benefit enormously by using automatic cleanup. You may even postpone a costly DASD upgrade when you find out how much space you have recovered.
Look Before You Sweep
V2R2M0 of OS/400 added several new functions to Operation Assistant (OA) including the Disk Space Tasks menu (DISKTASKS) shown in A1. You can access DISKTASKS by typing GO DISKTASKS on any command line or by selecting option 4 from the OA SETUP menu. DISKTASKS collects several commands designed to give you information about how disk space is used on your AS/400. The options at the bottom of the menu are old familiar friends: Work with Libraries (WRKLIB), Work with Folders (WRKFLR) and Work with Objects by Owner (WRKOBJOWN).
V2R2M0 of OS/400 added several new functions to Operation Assistant (OA) including the Disk Space Tasks menu (DISKTASKS) shown in Figure A1. You can access DISKTASKS by typing GO DISKTASKS on any command line or by selecting option 4 from the OA SETUP menu. DISKTASKS collects several commands designed to give you information about how disk space is used on your AS/400. The options at the bottom of the menu are old familiar friends: Work with Libraries (WRKLIB), Work with Folders (WRKFLR) and Work with Objects by Owner (WRKOBJOWN).
I want to draw your attention to the first two options on the menu. Option 1 runs an interactive program that ultimately executes the Retrieve Disk Information (RTVDSKINF) command. Option 2 runs the Print Disk Information (PRTDSKINF) command. You can run these jobs from the DISKTASKS menu or manually. If you go the manual route, you will be forced to submit RTVDSKINF to batch.
These two new commands, added with V2R2M0, allow you to collect information about disk usage on the system and produce reports that help you to analyze the data that's collected. To start the process, select option 1 from the DISKTASKS menu-you will see the panel shown in A2. You can schedule data collection to take place at a specific time or on a regular weekly or monthly basis. You should be aware that data collection can take several hours, depending on the amount of DASD you have installed and the other jobs that are active during the process. A good bet is to schedule data collection late at night-it does not require a dedicated system.
These two new commands, added with V2R2M0, allow you to collect information about disk usage on the system and produce reports that help you to analyze the data that's collected. To start the process, select option 1 from the DISKTASKS menu-you will see the panel shown in Figure A2. You can schedule data collection to take place at a specific time or on a regular weekly or monthly basis. You should be aware that data collection can take several hours, depending on the amount of DASD you have installed and the other jobs that are active during the process. A good bet is to schedule data collection late at night-it does not require a dedicated system.
After the data collection job finishes, you can print the disk information that has been gathered by using option 2 (Print disk space information) from the DISKTASKS menu. (If you attempt to run this option before the data collection step finishes, a message will be issued informing you that the collection process has not yet completed.) There are six different reports from which you can choose: Library, Folder, Owner, Specific object and System summary information. All the reports, by default, present information about the object types you have selected, sorted in descending order by size. Most allow optional sorting orders.
The first page of the System Summary Information report is shown in A3. As you can see, it gives you a general breakdown of how your disk space is being used. Consider using these new options in conjunction with automatic cleanup to keep your DASD lean and fit.
The first page of the System Summary Information report is shown in Figure A3. As you can see, it gives you a general breakdown of how your disk space is being used. Consider using these new options in conjunction with automatic cleanup to keep your DASD lean and fit.
Ernie Malaga is a senior technical editor at Midrange Computing.
Lower DASD Usage With Automatic Cleanup
Figure 1 ASSIST Menu
ASSIST AS/400 Operational Assistant (TM) Menu System: MC PGMR To select one of the following, type its number below and press Enter: 1. Work with printer output 2. Work with jobs 3. Work with messages 4. Send messages 5. Change your password 10. Manage your system, users, and devices 11. Customize your system, users, and devices 75. Information and problem handling 80. Temporary sign-off Type a menu option below __ F1=Help F3=Exit F9=Command line F12=Cancel
Lower DASD Usage With Automatic Cleanup
Figure 2 The Cleanup Menu
CLEANUP Cleanup Tasks System: MC PGMR To select one of the following, type its number below and press Enter: 1. Change cleanup options 2. Start cleanup at scheduled time 3. Start cleanup immediately 4. End cleanup Type a menu option below _ F1=Help F3=Exit F9=Command line F12=Cancel
Lower DASD Usage With Automatic Cleanup
Figure 3 Changing Cleanup Options
Change Cleanup Options MC 09/23/91 04:46:12 Type choices below, then press Enter. Allow automatic cleanup . . . . . . . . . . . . . Y Y=Yes, N=No Time cleanup starts each day . . . . . . . . . . 22:00:00__ 00:00:00- 23:59:59, *SCDPWROFF, *NONE Number of days to keep: User messages . . . . . . . . . . . . . . . . . 7____ 1-366, *KEEP System and workstation messages . . . . . . . . 1____ 1-366, *KEEP Job logs and other system output . . . . . . . 7____ 1-366, *KEEP System journals and system logs . . . . . . . . 30___ 1-366, *KEEP OfficeVision/400 calendar items . . . . . . . . 30___ 1-366, *KEEP F1=Help F3=Exit F5=Refresh F12=Cancel
Lower DASD Usage With Automatic Cleanup
Figure 4 Original QEZUSRCLNP Program
/********************************************************************/ /* */ /* 5738SS1 V2R2M0 920925 RTVCLSRC Output 12/04/92 06:26:29 */ /* */ /* Program name . . . . . . . . . . . . . . : QEZUSRCLNP PN*/ /* Library name . . . . . . . . . . . . . . : QSYS PL*/ /* Original source file . . . . . . . . . . : SN*/ /* Library name . . . . . . . . . . . . . . : SL*/ /* Original source member . . . . . . . . . : SM*/ /* Source file change */ /* date/time . . . . . . . . . . . . . . : SC*/ /* Patch option . . . . . . . . . . . . . . : *NOPATCH PO*/ /* User profile . . . . . . . . . . . . . . : *OWNER UP*/ /* Text . . . : TX*/ /* Owner . . . . . . . . . . . . . . . . . : QSYS OW*/ /* Patch change ID . . . . . . . . . . . . : PC*/ /* Patch APAR ID . . . . . . . . . . . . . : PA*/ /* User mod flag . . . . . . . . . . . . . : *NO UM*/ /* ED*/ /********************************************************************/ PGM DCL VAR(&COIBM) TYPE(*CHAR) LEN(128) VALUE(' 5738-SS1 (C) - COPYRIGHT IBM CORP. 1980, 1991 ALL RIGHTS RESERVED. LICENSED - MATERIALS - PROPERTY OF IBM') QSYS/SNDPGMMSG MSGID(CPI1E91) MSGF(QCPFMSG) TOMSGQ(*SYSOPR) - MSGTYPE(*INFO) QSYS/SNDPGMMSG MSGID(CPI1E92) MSGF(QCPFMSG) TOMSGQ(*SYSOPR) - MSGTYPE(*INFO) RETURN COPYWRITE: + QSYS/CHGVAR VAR(&COIBM) VALUE(&COIBM) PGM_END: QSYS/ENDPGM
Lower DASD Usage With Automatic Cleanup
Figure 5 Reformatted QEZUSRCLNP Program
QEZUSRCLNP: PGM DCL VAR(&COIBM) TYPE(*CHAR) LEN(128) + VALUE(' 5738-SS1 (C) COPYRIGHT IBM + CORP. 1980, 1991 ALL RIGHTS RESERVED. + LICENSED MATERIALS - PROPERTY OF IBM') /* Insert this MONMSG command here */ MONMSG MSGID(CPF0000) SNDPGMMSG MSGID(CPI1E91) MSGF(QCPFMSG) TOMSGQ(*SYSOPR) + MSGTYPE(*INFO) /* Insert here your own cleanup commands */ xxxxxx xxxxxx xxxxxx /* End of your insert */ SNDPGMMSG MSGID(CPI1E92) MSGF(QCPFMSG) TOMSGQ(*SYSOPR) + MSGTYPE(*INFO) RETURN COPYWRITE: CHGVAR VAR(&COIBM) VALUE(&COIBM) PGM_END: ENDPGM
Lower DASD Usage With Automatic Cleanup
Figure A1 OA Disk Space Tasks Menu
DISKTASKS Disk Space Tasks System: MC PGMR To select one of the following, type its number below and press Enter: 1. Collect disk space information 2. Print disk space information 10. Work with libraries 11. Work with folders 12. Work with objects by owner Type a menu option below __ F1=Help F3=Exit F9=Command line F12=Cancel
Lower DASD Usage With Automatic Cleanup
Figure A2 Disk Space Collection Setup Panel
Collect Disk Space Information MC PGMR 04/01/93 10:59:03 Information collected . . . . . . : 03/19/93 16:46:14 A job will be submitted to collect disk space information. This job may take several hours to complete, depending on the size of your system. Type choice below, then press Enter. When to collect information . . . _ 1=Date/time 2=Weekly 3=Monthly F1=Help F3=Exit F12=Cancel Disk space information not scheduled to be collected.
Lower DASD Usage With Automatic Cleanup
Figure A3 System Summary Information Report
Unable to reproduce graphic
LATEST COMMENTS
MC Press Online