13
Fri, Dec
4 New Articles

AS/400 Disk Saving Tips

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

Curb the erosion of disk space with these practices.

by Eric Hill

The first thing that goes through my mind when I discuss new projects or I purchase new software is the availability of disk space on my AS/400. Can I fit the new software on the system? How much room will be left after implementation? I have found myself staring at the disk usage percentage on the Work with System Status (WRKSYSSTS) screen as if it was a time bomb.

Disk space on the AS/400 is one of the most important concerns in all MIS shops. But there is little to be found in the IBM manuals that shows you how to conserve or regain disk space. As with many aspects of IBM midrange computers, you often must find things out on your own. I have compiled these disk space saving tips after doing some research and asking quite a few questions of fellow MIS professionals.

IPL and RCLSTG Command

After a spooled file is printed, the AS/400 is left with "spool members," which are unusable segments of disk storage. These spool members accumulate until the machine is IPLed for the seventh time. At this point, the AS/400 cleans up the excess spool members, recovering all the wasted space. To prompt the clean-up on a timely schedule, if at all possible, try to IPL the system once a week.

The Reclaim Storage command (RCL STG) is used to perform a general clean-up of auxiliary storage. This command also reclaims all objects secured with a damaged or destroyed authorization list. RCLSTG should be run especially after unexpected failures occur. Doing so will correct abnormal conditions on permanent objects that might have been damaged when the failure occurred.

All subsystems must be inactive to execute the RCLSTG command. Because of this restriction, carefully select the time when you will run this command. It can take a very long time to complete.

Remove Observability and Optimize Programs

Observability data in a program is data required for on-line debugging. It is automatically inserted in a program when it is compiled. On-line debug is wonderful when you are still in the testing stage of a program, but it is not necessary when the program goes into production. Once the program is running smoothly, remove observability using the Change Program command (CHGPGM) to reduce the program size. Observability can be returned to the program by simply re-compiling it.

The command to create HLL programs (CRTxxxPGM) has a parameter, GENOPT, which can contain *OPTIMIZE or *NOOPTIMIZE. When *OPTIMIZE is used, the compiler generates a program for more efficient processing and possibly requires less storage. According to a "TechTalk" item in Midrange Computing magazine (then DataNetwork, December 1989), "Optimizing deals mainly with register usage optimization, so a program would benefit in path lengths and possibly instruction paging." Compiling an HLL program using GENOPT(*OPTIMIZE) can increase the length of the compile substantially. The program can also be changed for optimization using the CHGPGM command. Later we will discuss a program which removes observability and optimizes programs in all user libraries.

Delete Old Entries from the Problem Log

The AS/400 keeps track of all errors on the system in a log file called QASXPROB. You should periodically delete these entries using the Delete Problem command (DLTPRB). The STATUS parameter of this command specifies the status of the problem to be deleted. It can be *OPENED (the problem has been identified but no problem analysis run); *READY (the problem analysis has been run and the problem is ready to be prepared); *PREPARED (information relating to a service request has been added); or *ALL (all problems older than a specified number of days will be deleted). The DAYS parameter in the command denotes that all problems older than this value will be deleted.

After completing the DLTPRB command, perform the Reorganize Physical File Member command (RGZPGM) to remove the deleted records from QASXPROB.

Delete Old History Files

Old history files take up a great deal of space on disk. These should be systematically saved and deleted. The Work with Objects command (WRKOBJ) with QHST* in the OBJ parameter will display a list of all history files on the system. Once saved, these can be deleted by placing a "4" beside the files to be removed.

In the July 1990 issue of Midrange Computing (or their ResourceLibrary), there is a CL program that will remove history files with an option to keep a certain number of history files.

Clear the QRPLOBJ Library

When you change a program on the AS/400 and you recompile it while another user is executing that program, the AS/400 places the old version of the program in a library called QRPLOBJ. The user continues to use the old program until he or she exits the program. The new program will be used any time after that. However, that old version of the program remains in the QRPLOBJ library. Use the Clear Library command (CLRLIB) to clear this library on a timely basis.

Apply PTFs Permanently

When you load a cumulative PTF package onto the AS/400 and you apply it temporarily, the previous PTFs remain in disk until the new PTFs are applied permanently. After running the AS/400 successfully using the new PTFs, you should apply them permanently to remove the old PTFs.

There are two ways to apply PTFs permanently. The first method can be used during an attended IPL. After taking the option "Perform IPL" from the IPL screen, there will be a screen to work with program temporary fixes. The PTFs can be applied permanently from there.

Another way to apply PTFs permanently is to use the Apply PTF command (APYPTF). Run the Display PTF command (DSPPTF) to get a list of all licensed programs on the system. A separate application will be needed for each licensed program. Place the licensed program name in the LICPGM parameter, indicate SELECT (*ALL), APY(*PERM), DELAYED (*YES), and IPLAPY(*YES). Press Enter to apply these PTFs permanently at the next unattended IPL.

Delete PTF Save Files from QGPL

When PTFs are downloaded to the AS/400 via the Electronic Customer Support (ECS) line, save files are created in library QGPL for these PTFs. Delete these save files after the downloaded PTFs are applied.

Clear Message and Output Queues

Make sure all users are maintaining their message queues on a regular basis, including the QSYSOPR message queue. These queues have a tendency to increase in size very quickly. Train users to use the function keys when they Display Messages (DSPMSG). They can either clear their entire message queues using the F13 key, or remove one message at a time by moving the cursor to a message and pressing the F11 key. The F16 key removes all unanswered messages, which is a good way to unclutter the QSYSOPR message queue.

Check output queues for old spool files that are no longer needed. The Work with Output Queue command (WRKOUTQ) can be helpful in determining which spool files can be deleted, especially if you take the trouble to request the information on hard copy with OUTPUT(*PRINT). Each spool file is fully identified and dated. An easy way to clear an output queue of all spool files is to use the Clear Output Queue command (CLROUTQ).

Manage the Journal Receivers

The AS/400 keeps several internal journals. The names of these journals are:

QAOSDIAJRN (Documents)

QSNADS (SNADS)

QSDSNX (Distributed Services) QSXJRN (Problem Database)

These journals must be maintained periodically because their attached journal receiver fills up. Failure to maintain the journal will cause the journal receiver to keep growing, consuming valuable space. This maintenance process is somewhat involved, but basically it consists of detaching the current journal receiver, saving it on tape, deleting it from disk, and creating a new journal receiver for the journal. The steps required to perform this maintenance follow below.

Detach the current journal receiver and assign a new one to each journal using the Change Journal command (CHGJRN). For the JRN parameter, enter the journal name, and for the JRNRCV parameter, enter *GEN. This will increment the sequence number by one and cause it to be used as the new journal receiver name. List the current attached journal receivers for each of the internal journals using the Work with Journal Attributes command (WRKJRNA). Place the journal name into the JRN parameter and *PRINT in the OUTPUT parameter.

List all the journal receivers using the Display Object Description command (DSPOBJD). Indicate OBJ(*ALL), OBJTYPE(*JRNRCV), and OUTPUT(*PRINT).

Compare the two lists and save the journal receivers which match the names of the internal journals but are not attached.

Delete the journals using the Delete Journal Receiver command (DLTJRNRCV). Chapter 3 of the Backup and Recovery Guide contains just about all the information needed to maintain journals.

Reorganize Office Physical Files

If the AS/400 has Office installed, periodically reorganize the Office physical files which are found in library QUSRSYS. Figures 1a and 1b provide programs called CLEANLIBS and CLEANLIBSF which will clean up all files in all user libraries. The programs were originally presented in the December 1989 issue of Midrange Computing (then DataNetwork). These programs are ideal to use in this situation. They also remove observability and optimize all programs in the library to further save disk space.

Reorganize Application Physical Files

It is a good idea to reorganize all application physical files on a regular basis. Files with a great number of additions and deletions need to be reorganized periodically. The CLEANLIBS program should handle this as well.

Delete Users From On-Line Education

Once a user is finished with the AS/400 on-line education, delete the user from on-line education and reorganize those files. The education files are in QUSRSYS and the CLEANLIBS program will take care of these files, too.

Delete Old Programs

Everyone has had to write one-time fix programs for a quick way out of a problem. Once these are done and are no longer in use, delete the programs and remove the source member. This can save some disk space as well as clean up the source physical file.

These are the space saving measures I use on my AS/400. As almost everyone knows, every little bit of space helps. If you know of any more, please let me know, or contact Midrange Computing with your tip. The more we know, the more space we can save.


AS/400 Disk Saving Tips

Figure 1A CL program CLEANLIBS

 CLEANLIBS: + PGM DCLF FILE(QADSPOBJ) MONMSG MSGID(CPF0000) DSPOBJD OBJ(QSYS/*ALL) OBJTYPE(*LIB) OUTPUT(*OUTFILE) + OUTFILE(QTEMP/LIBLIST) OVRDBF FILE(QADSPOBJ) TOFILE(LIBLIST) OPNDBF FILE(QTEMP/LIBLIST) OPTION(*INP) READ: + RCVF RCDFMT(QLIDOBJD) MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(EOF)) IF COND(%SST(&ODOBNM 1 1) *EQ 'Q') THEN(GOTO CMDLBL(READ)) IF COND(%SST(&ODOBNM 1 1) *EQ '#') THEN(GOTO CMDLBL(READ)) IF COND(%SST(&ODOBNM 1 1) *EQ '$') THEN(GOTO CMDLBL(READ)) IF COND(%SST(&ODOBNM 1 1) *EQ '%') THEN(GOTO CMDLBL(READ)) IF COND(%SST(&ODOBNM 1 1) *EQ '&') THEN(GOTO CMDLBL(READ)) REORGF: + CALL PGM(REORGPF) PARM(&ODOBNM) RMVOBS: + CHGPGM PGM(&ODOBNM/*ALL) RMVOBS(*ALL) OPTIMIZE: + CHGPGM PGM(&ODOBNM/*ALL) OPTIMIZE(*YES) GOTO CMDLBL(READ) EOF: + CLOF OPNID(LIBLIST) ENDPGM 
AS/400 Disk Saving Tips

Figure 1B CL program CLEANLIBSF

 CLEANLIBSF: + PGM PARM(&LIB) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCL VAR(&PERC) TYPE(*DEC) LEN(5 2) DCLF FILE(QAFDMBRL) MONMSG MSGID(CPF0000) DSPFD FILE(&LIB/*ALL) TYPE(*MBRLIST) OUTPUT(*OUTFILE) + FILEATR(*PF) OUTFILE(QTEMP/FILELIST) MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ENDPGM)) OVRDBF FILE(QAFDMBRL) TOFILE(FILELIST) OPNDBF FILE(QTEMP/FILELIST) OPTION(*INP) READ: + RCVF RCDFMT(QWHFDML) MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(EOF)) CHGVAR VAR(&PERC) VALUE(000.00) IF COND(&MLNRCD *GT 0) THEN(DO) CHGVAR VAR(&PERC) VALUE(&MLNDTR / &MLNRCD) ENDDO IF COND(&PERC *EQ 00.10) THEN(DO) RGZPFM FILE(&LIB/&MLFILE) MBR(&MLNAME) ENDDO GOTO CMDLBL(READ) EOF: + CLOF OPNID(FILELIST) ENDPGM: + ENDPGM 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

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: