Wednesday, May 28, 2008

Display Documents on your iSeries:

We can navigate around the DLO system with i5/OS DLO commands, but we are much limited to displaying just the names of the DLO objects – commonly known as "documents" and "folders."
We usually had two basic choices:
1. 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-iSeries's IFS system shared and configured for use with Windows.
2. Copy the document to an OS/400-i5/OS 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.

A much simpler approach to quickly display the contents of a document (or any IFS object) is to use the Work with Object Links (WRKLNK) command.
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 you 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/*')
This command lists the available documents in the specified folder. There is an option titled "5=Display." Simply type a '5' next to the document and press Enter, and you will see the data contained in that document. And 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.

No comments: