Q: Is there a way to get a list of IFS files that have the ALWSAV attribute set to "no"? These files are skipped by the SAV command when I do my backups, and I'd like to verify that I'm not missing anything important. I think that perhaps some of my objects were set to ALWSAV=No by accident!
A: Unfortunately, I don't think i5/OS includes a report that lists objects where the ALWSAV attribute has been set to no. However, I've written my own tool that lists them. In this article, I explain how I did that and provide the code in case you'd like to use it on your system.
My utility is a command named "Find ALWSAV=No Objects (NOSAVOBJ)". You pass one parameter to the utility to tell it where to search in the IFS. It will search all directories, subdirectories and objects that are within the path that you type. Here's what the command looks like when prompted:
Find ALWSAV=No Objects (NOSAVOBJ)
Type choices, press Enter.
IFS subtree to search . . . . .
Bottom
F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display
F24=More keys
|
For example, if you want to search the entire IFS for all ALWSAV=No objects, you could type:
NOSAVOBJ PATH('/')
On the other hand, if you are only interested in listing objects that are located somewhere within the /QIBM directory of the IFS, the following command will only search that subtree of the IFS:
NOSAVOBJ PATH('/QIBM')
The NOSAVOBJ utility will never search the /QSYS.LIB or /QNTC areas of the IFS. To the best of my knowledge, these areas do not support the ALWSAV attribute, so this shouldn't be an issue. Plus, it's best that the /QSYS.LIB area be saved with the SAVLIB command rather than SAV. The /QNTC area only provides access to remote computers over Windows Networking, those computers are best backed up using Windows backup software rather than the SAV CL command.
The utility works by calling the Qp0lProcessSubtree() API. This API can be told to call a subprocedure for every file that matches a given criteria. In this case, I told it to find all IFS files in the given subdirectory, except those that might be in /QSYS.LIB or /QNTC.
I've told Qp0lProcessSubtree() to call a procedure that's in the NOSAVOBJR4 RPG program. This subprocedure takes the IFS path name that was passed from the Qp0lProceussSubtree() API, and uses it as input to the Qp0lGetAttr() API to get the file's attributes.
If Qp0lGetAttr() tells me that the file was marked with ALWSAV=No, then I print the filename. If not, I ignore it and proceed to the next object returned by Qp0lGetAttr().
The output is just a very simple program-described print file. I did not take the time to add fancy headings, page numbers, or anything like that. If you want those features, or you'd rather have it write the name to a disk file, feel free to edit the code and change it to work the way you want it to!
You can download the source code for my NOSAVOBJ utility from the following link:
http://www.pentontech.com/IBMContent/Documents/article/55697_346_ListAlwSavNo.zip [2]
Links:
[1] http://systeminetwork.com/author/scott-klement
[2] http://www.pentontech.com/IBMContent/Documents/article/55697_346_ListAlwSavNo.zip