Problem solve Get help with specific problems with your technologies, process and projects.

A quick and easy way to display documents on your iSeries

Without OfficeVision, the WRKLNK command is a simpler method for displaying the contents of a document.

Ron Turull

Somewhere along the line, the DLO (Document Library Objects) system became somewhat reliant on OfficeVision (and some other add-on products). Sure, you can navigate around the DLO system with OS/400 DLO commands, but you are pretty much limited to displaying just the names of the DLO objects -- commonly known as "documents" and "folders."

The displaying document dilemma
Without OfficeVision, simply displaying the contents of a DLO document becomes problematic. In the past, you had two basic choices:

  • Open the document in Windows NotePad or other similar text editor on your PC. This approach works just fine if the document is in ASCII format and you have your AS/400's IFS system shared and configured for use with Windows.
  • Copy the document to an OS/400 physical file. Use the CPYFRMPCD to copy the document to either a regular physical file or a source physical file. This approach is workable under certain conditions, but you must know ahead of time if you are dealing with EBCDIC or ASCII data because you may need to translate it.

An easier approach
A much simpler approach to quickly display the contents of a document (or any IFS object as it turns out, but that's another story) is to use the Work with Object Links (WRKLNK) command. Don't let the term "link" trip you up -- it is simply how objects are kept track of in the Integrated File System (IFS).

For example, say you have a document named "MSG0006" in folder "TEMP." The IFS link to that document would be "/Qdls/temp/msg0006". Note that most of the IFS file systems are not case-sensitive; this is true for the QDLS file system, which is the IFS file system associated (i.e., linked) with the DLO system. So, the link "/Qdls/temp/msg0006" is broken down like this:

  • The beginning slash (/) tells IFS to start at the root.
  • The "Qdls" says to use the DLO system (if you have your IFS systems mapped as a network drive on you PC, you will see "Qdls" as a folder).
  • The "temp" says to look in the DLO first-level folder named "TEMP" (this will also appear as a folder on you PC).
  • Finally, the "msg0006" is the name of the DLO document.

To work with a specific document like the one just discussed, we can issue the following command:

WRKLNK OBJ('/Qdls/temp/msg0006')

You can also use wildcards to work with a several documents (or links) at once. For example:

WRKLNK OBJ('/Qdls/temp/*')

will give us a listing of all the documents (and perhaps some lower-level folders) in the TEMP folder. An example of the resulting screen is shown below in Figure 1. It shows all the documents and folders contained in folder TEMP.

Figure 1: A listing of all the documents and folders in the TEMP folder.


Displaying the document?
What does all this have to with displaying the DLO document? Well, you may have noticed from the sample screen-shot that there is an option titled "5=Dislay." Simply type a '5' next to the document and press Enter, and you will see the data contained in that document. The nice thing about it is you don't have to worry about what character set (or CCSID) it is in; the Display function will figure it out.

Also note that there is an Edit function as well. The Work with Object Links screen allows you to edit the data in the document, a great feature for a quick change. Use option '2'. You can even navigate through the IFS by using option '5' next to items of type FLR, DIR and other directory-type objects.

(Note: If you aren't familiar with the IFS system, we will take a closer look at it and its links in the coming installments because a thorough understanding of the IFS is essential for the proper administration of any iSeries.)

About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years experience programming for and managing AS/400-iSeries systems.


  • List the contents of the IFS directory member Denzil D'Souza had a hurdle in one of his projects to list the contents of an IFS directory -- in the root system. The solutions he found on the Internet were all oriented to using C function, which is interesting, but was not feasible to use as the client had restricted the development language to ILE RPG and CLLE. So through a little bit of 'fiddling around', he found this method.
  • Deleting IFS directories that contain files member Terry Brown shows you how to use WRKLNK to delete directories that are empty or contain files.
  • Delete stubborn IFS entries
    Sometimes, if users have access to the IFS through Windows, files with strange names appear in the IFS. For example, "C:{filename}", etc. If you try to delete them using the WRKLNK command and option 4, you get an error message that the file doesn't exist even though it appears in the directory listing. Robert Clay shows you how to delete them in this Hall of Fame tip.

Dig Deeper on Performance

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.