PowerWire.eu

Independent IBM i, AIX and Linux news and tech tips for Europe and beyond

  • Home
  • News
  • Technical Articles
    • IBM i
    • AIX
    • Linux
    • VIOS
  • Subscribe
  • About Us
  • Contact Us
  • Advertise with PowerWire.eu

Finding Save Files and Freeing Up Disk Space on IBM i

November 26, 2020 by Steve Bradshaw 3 Comments

“Finding Save Files” might sound like a Disney “Straight to TV” sequel to “Finding Nemo” but no, it’s much more pleasurable than that 😉 Few of us enjoy tidying up after ourselves in our home life and in my experience, even less of us like to do it in their IBM i work life.

In this GDPR world in which we now live, we are obliged to track and remove copies of data that we no longer need and one of the most commonly overlooked (in the IBM i world) is data stored in Save Files.

This is hardly surprising as the data stored inside them is not indexed on the system, so these opaque blobs tend to sit around our in systems, hiding in plain sight and gathering virtual dust.

How do I find Save Files on IBM i?

Unfortunately, our friends in Rochester never created a WRKSAVF command. So, we have to be a little more creative.  Save files do show on the WRKF command but they do rather tend to get lost in the crowd of the myriad of files we have on our systems. To identity SAVFs from the other file types, we need to look at the file attribute. In the following example we see a list of objects that are all counted as files on IBM i:

Authors Note: If someone wants to create an RFE for a WRKSAVF command, I would vote for it.

Where to start?

What we need as a starting point is an easy to access, easy to maintain list of all the objects on a system.  Once we have that querying it to find files with a particular attribute is child’s play.

Fortunately, IBM i has the RTVDSKINF command that will do just that for you, conveniently maintaining file QUSRSYS/QAEZDISK.

You can run the RTVDSKINF when ever you like but it will take a while to complete as it need to read through every object in every library on your system. So, this is best run in batch.

Whenever you run this command it replaces the data in QUSRSYS/QAEZDISK. So make sure you finished or copied the data you want from the file before running it again.

ProTip: Use the GO DISKTASKS menu, Option 1 to schedule a regular automatic collection:

Querying the QAEZDISK File

This is just like any other file, so interrogate it in the way that you like best, write a program, WebQuery, Query400, STRSQL, etc.

Or, if you are like me, you use the ACS RUNSQL Scripts function these days, then run the following SQL statement:

select  Diobli, Diobnm, Diobat,  varchar_format(Diobsz, ‘9G999G999G999G999’) as “Size in Bytes”

from qusrsys.qaezdisk

where Diobat = ‘SAVF’ AND Diobow Not Like ‘Q%’

order by Diobsz DESC

limit 200;

In this case I sorted the list of SAVFs by size, regardless of what library they are in. I also omitted the ones starting with a Q as these tend to belong to IBM. I don’t recommend you do that unless you know it is safe to do so.

The beauty of the RUNSQL script is that is it so easy to customise it your needs, so you can tune your specific requirements. Now you know where these save files are hiding you can easily maintain them.

i-UG goes Hybrid

Our next User Group Meeting will be in December and this time it’s a Hybrid. It will of course still be available Virtually via Zoom but also in person and the Mount Hotel in my home town of Wolverhampton. For more details check out  www.i-ug.co.uk

Hope to see you there.

Related Posts

  • How to get the New Navigator for iHow to get the New Navigator for i
  • PDF Direct Printing from IBM iPDF Direct Printing from IBM i
  • New Software Enhancements for POWER SystemsNew Software Enhancements for POWER Systems
  • i-UG’s November event goes Hybrid
  • SMBv3 support in IBM i 7.4SMBv3 support in IBM i 7.4
  • Back to the futureBack to the future

Filed Under: IBM i, Technical Articles Tagged With: IBM i, IBM Power Systems, Steve Bradshaw

Comments

  1. Massimo Duca says

    November 26, 2020 at 10:46 am

    You can also easily get this information with DB2 Services:
    SELECT objname, objattribute, objsize, last_used_timestamp
    FROM TABLE (qsys2.object_statistics(‘*ALLUSR’, ‘*FILE’)) t
    WHERE objattribute = ‘SAVF’

    Better run the statement in batch with RUNSQL command, directing the output into a table.

    SBMJOB CMD(RUNSQL SQL(‘CREATE TABLE mylib.savefiles AS (SELECT
    objname, objattribute, objsize, last_used_timestamp
    FROM TABLE (qsys2.object_statistics(”*ALLUSR”, ”*FILE”)) t
    WHERE objattribute = ”SAVF”)
    WITH DATA ‘) COMMIT(*NONE)) JOB(SAVF)

    Reply
    • Giovanni Ramajola says

      December 29, 2020 at 9:28 am

      Exactly! I will use this query to find and files! Thanks a lot

      Reply
  2. MOHAMMAD JAHED HOSSAIN BIJOY says

    October 18, 2021 at 6:47 am

    Very helpful document.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Free monthly newsletter signup

News

Remain Software Milestone 3

NIEUWEGEIN, Netherlands — Today Remain Software is pleased to announce the third Milestone of TD/OMS V14 and … [Read More...]

PowerWire.eu talk to i-UG’s chairman Mike Ryan about their upcoming annual conference

Hello Mike. As the official representative of COMMON Europe in the U.K, i- UG has always listened to the … [Read More...]

Dot Files on IBM i

For those who have been following my bite size BASH tutorial on You Tube, I thought it about time I wrote an … [Read More...]

More articles from this section

Quick Links

  • Advertise
  • Subscribe

Follow Us…

  • Email
  • LinkedIn
  • Twitter

Search This Website

Copyright © 2022 · Cue Communications · All Rights Reserved

Log in

This site uses cookies More info