15
Mon, Apr
7 New Articles

Lower DASD Usage With Automatic Cleanup

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

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 
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: