DSPF (Display File) Command Description

DSPF Command syntax diagram

Purpose

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

Required Parameters

STMF
Specifies the name of the file to be displayed. If the file specified is a directory instead of a file, a list of objects in the directory is shown. Either this parameter or the FILE parameter is required.

'stream-file-path-name': Specify the path name of the stream file or a pattern to match the name of the stream file to be displayed.

The path name can be either a simple name or a name that is qualified with the name of the directory in which the file is located. A pattern can be specified in the last part of the path name. An asterisk (*) matches any number of characters. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes.

FILE
Specifies the name of the database file that contains the member to be displayed. If no library qualifier is specified, the library list is used to locate the file. Either this parameter or the STMF parameter is required.

The name of the database file member can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

database-file-name: Specify the name of the database file that contains the member to be displayed.

Optional Parameter

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

*FIRST: The first member in the database file is displayed.

member-name: Specify the name of the file member to be displayed.

Examples for DSPF

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

DSPF  FILE(MYLIB/MYFILE) MBR(MYMBR1)

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

No error messages.