Display File (DSPF)

The Display File (DSPF) command allows you to display a stream file or a database file.


Keyword Description Choices Notes
STMF Stream file, or Path name Optional, Positional 1
FILE Data base file Qualified object name Optional, Positional 2
Qualifier 1: Data base file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
MBR File member Name, *FIRST Optional, Positional 3

Stream file, or (STMF)

Specify the name of the file to be displayed.

Specifies the path name of the object or a pattern to match the name of the object to be displayed.

The object path name can be either a simple name or a name that is qualified with the name of the directory in which the object is located. A pattern can be specified in the last part of the path name. An asterisk (*) matches any number of characters. A list of all files or subdirectories that match the specified characters will be displayed. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes. If the file name specified is a directory, the a list of the files and subdirectories is displayed. From this list you can edit or display the files in the directory.

For more information on specifying path names, refer to "Object naming rules" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Data base file (FILE)

Specifies the name of the database file to be displayed.

The possible library values are:

All libraries in the library list for the current thread are searched until the first match is found.
The current library for the thread is searched. If no library is specified as the current library for the thread, the QGPL library is searched.
Specify the name of the library to be searched.

File member (MBR)

Specifies the name of the database file member to be displayed.

The possible values are:

The first member in the database file is displayed.
Specify the name of the member to be displayed.


Example 1: Displaying a Stream File

DSPF  STMF('/mydir/myfile.txt')

This command will display file myfile.txt in directory mydir under the root directory.

Example 2: Displaying a Database File Member


This command will display member MYMBR1 of file MYFILE in library MYLIB.

Error messages

*ESCAPE Messages

Display file QDZRUEDT missing or damaged.
Error processing line commands.
Unexpected error opening file.
Cannot allocate work space.
Command not valid.
&1 occurrences of &3 changed. &2 not changed.
Find or replacement string not specified.
Error opening printer file.
File name not specified.
Target line not specified.
CCSID not valid.
Conversion between CCSID &1 and the job's CCSID is not supported.
File is empty.
File cannot be displayed and/or edited.