Admin Alert: Treating IFS Objects Like Stream File Objects
July 22, 2009 Joe Hertvik
Even though AS/400 Integrated File System (AS/400 IFS) folders can contain the same type of stream file data as network file servers do, many administrators still don’t understand how to perform basic file functions such as checking out and checking in files, and changing properties for an AS/400 IFS Root (/) file object. This week, let’s review some basic but important functions you can perform on IFS stream file objects.
Changing IFS File Properties
The quickest way to change the attributes of IFS PC and Unix stream files is to use the Properties function IBM offers in iSeries Navigator (OpsNav). With OpsNav, you can change the following stream file object attributes:
To change these attributes for an IFS file, locate the IFS Root (/) folder and files you want to change by opening the File Systems→Integrated File System→Root node under your target i5/OS partition in OpsNav. Right-click on the file that you want to change attributes for. Select Properties off the pop-up menu that appears. A Properties screen similar to the following display will appear.
If you check the “read-only” check box on this screen, this file will become a read-only file in the system. If you check the “Hidden” check box, i5/OS will hide the file from scanning users. You can specify the file as a system file by checking the “System” box.
To me, the most interesting option is the “Allow save” check box. Allow save is checked by default for all i5/OS AS/400 IFS objects. If you uncheck Allow save for an IFS object, the object will not be saved when you use the Save (SAV) command to save its parent IFS directory. SAV will not stop backing up other objects in that directory, it will only skip saving that particular file and any other files that you specified should not be saved. Preventing a stream file save can come in handy in the following situations:
While it’s easier to manipulate these stream file attributes in OpsNav, you can also change them on the green-screen by using the Change Attribute (CHGATR) command. Attributes are changed for an object by turning the attribute on and off for a specific IFS file. For example, if I wanted to make the “/home/joeh/test.joe” file a read-only file, I could turn on the file’s read-only attribute with this CHGATR statement.
CHGATR OBJ('/home/joeh/test.joe') ATR(*READONLY) VALUE(*YES)
The name of the file is specified in the Object (OBJ) parameter, the attribute to change is specified in the Attribute (ATR) parameter, and you specify whether you want to turn the attribute on or off by entering *YES or *NO in the New value (VALUE) parameter. You can use CHGATR to change the same stream file attributes for an IFS file that you could also change in OpsNav.
If I wanted to turn “test.joe” into a hidden file, I would run CHGATR this way.
CHGATR OBJ('/home/joeh/test.joe') ATR(*HIDDEN) VALUE(*YES)
If I wanted to designate “test.joe” as a system file, I would run CHGATR this way.
CHGATR OBJ('/home/joeh/test.joe') ATR(*PCSYSTEM) VALUE(*YES)
And if I want to turn off the Allow save attribute, I would run CHGATR like this:
CHGATR OBJ('/home/joeh/test.joe') ATR(*ALWSAV) VALUE(*NO)
There are several other stream file attributes that you can turn on and turn off with CHGATR. For a complete list, press F4 to prompt the command, and press F4 again on the Attribute field in the prompted command.
Checking Out and Checking In Files
In addition to specifying a file as read-only, you can also check out and check in files so that others cannot update an AS/400 IFS stream file while you are working on it. This comes in handy when several people may be updating IFS data for a project and you want to ensure that no one overwrites another person’s changes.
To check out a stream file object in OpsNav, you can once again open the File Systems→Integrated File System→Root node under your target partition and select Properties from the pop-up menu that appears. On the Properties screen, click on the Use tab, and you’ll see the following screen.
To check out the object, click on the “check out” button on this screen, and OpsNav will check out the stream file under the name of the user you opened OpsNav under. Unless a user has *ALL authority to the checked out object or they possess All Object authority (*ALLOBJ) in their user profile, other people will only be able to view and copy the checked file; they will not be able to change it. Only the person who checked out the object will be able to change it.
To check the object back in, open the Use tab in the object’s Properties screen again, and click on the “check in” button that now appears on that screen. This will check the object back in again and allows others to modify it.
Only stream files and Document Library Object (DLO) files can be checked out and checked in. You can also perform these functions with the green-screen Check Out Object (CHKOUT) and Check In Object (CHKIN) commands. For example, I could use the following CHKOUT and CHKIN command to check out and check back in my “/home/joeh/test.joe” file.
CHKOUT OBJ('/home/joeh/test.joe') CHKIN OBJ('/home/joeh/test.joe')
And this would perform the same check out/check in functions that I just showed you how to perform in OpsNav. Be aware, however, that using CHKOUT and CHKIN on the green screen has one significant advantage over using OpsNav for the same functions. The green screen commands allow you to check out and check in multiple IFS and DLO objects by specifying a wildcard character (*) in the Object parameter. For example, if I want to check out all the objects in the “/home/joe” IFS folder, I could easily do that by entering this CHKOUT command.
And this would check out all the objects in my IFS folder. The only exception will be that a wild card CHKOUT command cannot be used to check out any sub-folders residing under my target folder (/home/joeh). It also cannot be used to check out any objects residing in a sub-folder.
To check all of the “/home/joeh” objects back in again, I would run this CHKIN command.
Another Issue with Checking Out IFS Objects
The biggest problem with checking objects in and out is determining which objects are currently checked out. From my research, I have found that there isn’t an easy way to list out all the objects that are currently checked out in the AS/400 IFS. So be aware of that limitation when you use these techniques.
About Our Testing Environment
This article was tested on a System i 550 partition running i5/OS V5R4. We tested the OpsNav features by using the iSeries Navigator program that came with iSeries Access for Windows V5R4M0. Information presented here may also work with earlier versions of the i5/OS and OS/400 operating systems, and with pre-V5R4M0 versions of iSeries Navigator. However, earlier versions may have slightly different features due to improvements that were made from release to release.