WRKF provides WRKOBJ-like file detail

Try WRKF instead of WRKOBJ the next time you're looking for a specific file on your system.

You Can View User Feedback To Tip

In working with OS/400 files, many people rely on the Work with Objects (WRKOBJ) command to find files and programs inside OS/400's DB2/UDB file system. If, for example, I wanted to work with all the files that start with the letter 'Q' in my library list, I could enter WRKOBJ in the following way:


As most green-screeners know, that produces a list of files you can edit the authority for, copy, delete, display a description, or change the description. Not limiting itself to files, WRKOBJ also displays other OS/400 objects, such as programs (*PGM), output queues (*OUTQ), tables (*TBL), and data queues (*DTAQ). It's a fairly elementary tool that allows you to locate and work with OS/400 objects anywhere on your system.

There's only one problem with WRKOBJ: It's not granular enough when locating files. When listing files, it's written to show only OS/400 objects that have an object type of *FILE. It's not detailed enough when you consider that generic OS/400 *FILE objects can be any one of a dozen or so file types, including DFU files, logical files, physical files and save files. For files, I prefer a WRKOBJ-like command that I can use to work with specific OS/400 file objects. And IBM provides one with the Work with Files (WRKF) command.

WRKF is like WRKOBJ, but it's designed to let you work with objects that have specific file attributes. The difference is that although WRKOBJ looks for and displays any OS/400 file object, WRKF deals only with files. As such, you can use it to search for certain types of files. Taking my earlier example, if I wanted to find all the save files that started with the letter 'Q' in my library list, I could type in WRKF as follows:


And that gives me a more granular view of save files only, rather than all the files that start with 'Q'. The WRKF screen that appears has many of the same options for selected file manipulation as the WRKOBJ screen, as well as a few file-specific options you don't find on WRKOBJ. The WRKF options include the following:

'1' - Create a new file from this screen
'3' - Copy the selected file
'4' - Delete the selected file
'5' - Display a physical file member
'8 - Display the file description
'9' - Use the Save Object (SAVOBJ) command to save the file
'10' - Use the Restore Object (RSTOBJ) command to restore the file
'13' - Change the file description

Treating WRKF as a file-specific version of WRKOBJ, I can use it to quickly locate and manipulate file objects on my system. And because WRKF contains the File Attributes (FILEATR) parameter, I can pinpoint certain types of files easier than using WRKOBJ. The big difference between the two commands is that WRKOBJ looks only at the overall *FILE object type; it doesn't select files by File Attribute. WRKF does.

The syntax is pretty much the same as WRKOBJ with one or two differences. Here are the only two parameters you have to worry about when entering a WRKF command:

1. File/Library (FILE) -- Specifies the file name template and the library locations to look for in locating that file(s). Like WRKOBJ, you can enter a specific file name, a generic file name (the first few letters of the name followed by a wildcard '*'), or all the files that match the specified library location and file attribute (*ALL). For the libraries to search in, you can tell WRKF to search a specific library name, your library list (*LIBL), the current library for the job (*CURLIB), the libraries listed in the user portion of the library list (*USRLIBL), all user libraries that don't begin with the letter 'Q' (*ALLUSR), or all the libraries on your system (*ALL). This parameter pair allows you to be as specific or as general as you wish in selecting files to display.

2. File Attributes (FILEATR) -- The type of files to return in the search, including Distributed Data Management Files (DDMF); Data File Utilities (DFU); Logical Files (LF); Physical Files (PF); Printer Files (PRTF); and Save Files (SAVF). For a complete list, press the Help key (F1) on this parameter. FILEATR values are entered without a leading '*', and you can enter only one file attribute parameter with the command.

Filling in the parameters, WRKF retrieves only the file types you want, and that can make it easier to make minor adjustments. So the next you're looking for a specific file on your system, try WRKF instead of WRKOBJ. It might make all the difference in finding what you need.

About the author: Joe Hertvik is an IT professional and freelance writer who has been working with OS/400 since the days of the System/38 in the mid-1980s. Joe can be reached at jhertvik@midrangeserver.com.


  • On the comparison of WRKF and WRKOBJ you say that the WRKOBJ is not granular enough. I agree it has its short falls but you can specify the type of object on the command. IE. *FILE, *PGM, etc. The WRKF also has the ability to further define your view by specifing a type. IE. PF, DDMF, DSPF, etc. I use both depending on the need. —Doug Summers


Other tips written by Joe Hertvik:

This was first published in February 2002

Dig deeper on iSeries system performance and monitoring



Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: