Display File Description (DSPFD)

The Display File Description (DSPFD) command shows one or more types of information retrieved from the file descriptions of one or more database and/or device files. The information is provided for each file that has the specified name and that is found in the libraries named in the specified library qualifier to which the user has access. The information can be shown, printed, or directed to a database output file (OUTFILE). More information on files used by the DSPFD command is in the Database category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Restrictions:

  1. Before the specified files can be shown, the user must have object operational authority to those files.
  2. Of the libraries identified by the library qualifier, only libraries to which the user has read authority are searched for the specified files.
  3. If TYPE(*ALL), TYPE(*MBR), or TYPE(*MBRLIST) is specified and if the file is a physical file, the user needs at least one data authority (read, write, update, or delete) to the file to receive information about the members.

Parameters

Keyword Description Choices Notes
FILE File Qualified object name Required, Positional 1
Qualifier 1: File Generic name, name, *ALL
Qualifier 2: Library Name, *LIBL, *CURLIB, *USRLIBL, *ALLUSR, *ALL
TYPE Type of information Single values: *ALL, *BASATR
Other values (up to 10 repetitions): *ATR, *ACCPTH, *MBRLIST, *SELECT, *SEQ, *RCDFMT, *MBR, *SPOOL, *JOIN, *TRG, *CST, *NODGRP
Optional, Positional 2
OUTPUT Output *, *PRINT, *OUTFILE Optional, Positional 3
FILEATR File attributes Single values: *ALL
Other values (up to 12 repetitions): *DSPF, *PRTF, *DKTF, *TAPF, *CMNF, *BSCF, *MXDF, *PF, *LF, *SAVF, *DDMF, *ICFF
Optional
OUTFILE File to receive output Qualified object name Optional
Qualifier 1: File to receive output Name
Qualifier 2: Library Name, *LIBL, *CURLIB
OUTMBR Output member options Element list Optional
Element 1: Member to receive output Name, *FIRST
Element 2: Replace or add records *REPLACE, *ADD
SYSTEM System *LCL, *RMT, *ALL Optional

File (FILE)

Specifies the name and library of the files.

This is a required parameter.

The possible values for file names are:

file-name
Specify the full name of the file. Information is shown for this file only.
generic*-file-name
Specify a generic name. Information is provided for all files whose names begin with the specified characters.
*ALL
Information is provided for all files in the library or libraries.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*USRLIBL
If a current library entry exists in the library list for the current thread, the current library and the libraries in the user portion of the library list are searched. If there is no current library entry, only the libraries in the user portion of the library list are searched.
*CURLIB
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.
*ALL
All libraries in the system, including QSYS, are searched.
*ALLUSR
All user libraries are searched. All libraries with names that do not begin with the letter Q are searched except for the following:

#CGULIB     #DSULIB     #SEULIB
#COBLIB     #RPGLIB
#DFULIB     #SDALIB

Although the following Qxxx libraries are provided by IBM, they typically contain user data that changes frequently. Therefore, these libraries are considered user libraries and are also searched:

QDSNX       QRCLxxxxx   QUSRDIRDB   QUSRVI
QGPL        QSRVAGT     QUSRIJS     QUSRVxRxMx
QGPL38      QSYS2       QUSRINFSKR
QMGTC       QSYS2xxxxx  QUSRNOTES
QMGTC2      QS36F       QUSROND
QMPGDATA    QUSER38     QUSRPOSGS
QMQMDATA    QUSRADSM    QUSRPOSSA
QMQMPROC    QUSRBRM     QUSRPYMSVR
QPFRDATA    QUSRDIRCF   QUSRRDARS
QRCL        QUSRDIRCL   QUSRSYS

  1. 'xxxxx' is the number of a primary auxiliary storage pool (ASP).
  2. A different library name, in the format QUSRVxRxMx, can be created by the user for each previous release supported by IBM to contain any user commands to be compiled in a CL program for the previous release. For the QUSRVxRxMx user library, VxRxMx is the version, release, and modification level of a previous release that IBM continues to support.
name
Specify the name of the library to be searched.

Type of information (TYPE)

Specifies the type of file information provided. *ALL is valid only if information is displayed or printed. *BASATR is valid only if information is stored in a database output file. For the other parameters, one or more values can be specified if information is shown or printed. Only one value can be specified if information is stored in a database output file.

The possible values are:

*ALL
All the types of information applicable to the specified files are shown or printed.

Note: *ALL cannot be specified if a file name is specified on the OUTFILE parameter.

*BASATR
The file level attribute information common to all files is shown.
*ATR
Attribute information meaningful for the specified file is provided.
*ACCPTH
Access paths for physical and logical files are provided. For keyed access paths, the composite key description is also shown.
*MBRLIST
An alphabetical list and brief description of all file members in the specified file is provided.
*SELECT
The select/omit attribute for logical files is provided.
*SEQ
The collating sequence for physical and logical files is provided.
*RCDFMT
The record format names and record format level information for the specified file are provided.
*MBR
Information about the file members in physical and logical files is provided.
*SPOOL
The spooling attributes for the specified diskette or printer file are provided.
*JOIN
The join from-file, the join to-file, and the fields involved in the join are provided for join logical files.
*TRG
The number of trigger programs, each trigger program name and library, and the trigger events, trigger times, and trigger update conditions for each file with a trigger are provided. The correct output file format is QWHFDTRG from system file QAFDTRG.
*CST
For physical files only, information about the constraint relationships associated with the file is provided. The correct output file format is QWHFDCST from the system file QAFDCST.
*NODGRP
For distributed physical files only, data partitioning and relational data base information copied from a node group (*NODGRP) at file creation time is provided. The correct output file format is QWHFDNGP from the system file QAFDNGP.

Output (OUTPUT)

Specifies where the output from the command is sent.

*
The output is displayed (if requested by an interactive job) or printed with the job's spooled output (if requested by a batch job).
*PRINT
The output is printed with the job's spooled output.
*OUTFILE
The output is directed to the database file specified for the File to receive output (OUTFILE) parameter.

File attributes (FILEATR)

Specifies the type of file whose attributes are shown. For remote files, the only parameters allowed are *PF, *LF, or *ALL.

The possible values are:

*ALL
The attributes of all files are provided. This parameter is not allowed if *OUTFILE is specified on the Output prompt (OUTPUT parameter), and *ATR is specified on the Type of information prompt (TYPE parameter).
*DSPF
The attributes of display files are provided.
*PRTF
The attributes of printer files are provided.
*DKTF
The attributes of diskette files are provided.
*TAPF
The attributes of tape files are provided.
*CMNF
The attributes of communications files are provided.
*BSCF
The attributes of BSC files are provided.
*MXDF
The attributes of mixed files are provided.
*PF
The attributes of physical files are provided.
*LF
The attributes of logical files are provided.
*ICFF
The attributes of ICF files are provided.
*SAVF
The attributes of save files are provided.
*DDMF
The attributes of the Distributed Data Management (DDM) files are provided.

File to receive output (OUTFILE)

Specifies the database file to which the output of the command is directed. If the file does not exist, this command creates a database file in the specified library. If the file is created, the public authority for the file is the same as the create authority specified for the library in which the file is created. Use the Display Library Description (DSPLIBD) command to show the library's create authority.

Qualifier 1: File to receive output

name
Specify the name of the database file to which the command output is directed.

Qualifier 2: Library

*LIBL
The library list is used to locate the file. If the file is not found, one is created in the current library. If no current library exists, the file will be created in the QGPL library.
*CURLIB
The current library for the thread is used to locate the file. If no library is specified as the current library for the thread, the QGPL library is used.
name
Specify the name of the library to be searched.

Note: If a new file is created, the system uses as a model one of the following output files in QSYS with one of the following format names, depending on the values specified on the Type of information prompt (TYPE parameter) and the File attributes prompt (FILATR parameter). For more information about the OUTFILE format, refer to Database category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.

Command Parameters              Output File Created
TYPE        FILEATR             OUTFILE     FORMAT
*BASATR      Note 1             QAFDBASI    QWHFDBAS
*ATR         *BSCF              QAFDBSC     QWHFDBSC
*ATR         *CMNF              QAFDCMN     QWHFDCMN
*ATR         *DSPF              QAFDDSP     QWHFDDSP
*ATR         *PRTF              QAFDPRT     QWHFDPRT
*ATR         *DKTF              QAFDDKT     QWHFDDKT
*ATR         *TAPF              QAFDTAP     QWHFDTAP
*ATR         *PF                QAFDPHY     QWHFDPHY
*ATR         *LF                QAFDLGL     QWHFDLGL
*ATR         *ICFF              QAFDICF     QWHFDICF
*ATR         *SAVF              QAFDSAV     QWHFDSAV
*ATR         *DDMF              QAFDDDM     QWHFDDDM
*ACCPTH      Note 2             QAFDACCP    QWHFDACP
*SELECT      Note 3             QAFDSELO    QWHFDSO
*SEQ         Note 2             QAFDCSEQ    QWHFDSEQ
*MBR         Note 2             QAFDMBR     QWHFDMBR
*SPOOL       Note 4             QAFDSPOL    QWHFDSPL
*RCDFMT      Note 1             QAFDRFMT    QWHFDFMT
*MBRLIST     Note 2             QAFDMBRL    QWHFDML
*JOIN        Note 5             QAFDJOIN    QWHFDJN

Note: You must specify the FILEATR parameter only when TYPE(*ATR) is used. The default of FILEATR(*ALL) is valid on any of the other TYPE values as long as you are requesting file types that match the appropriate request.

Output member options (OUTMBR)

Specifies the name of the database file member that receives the output of the command.

Element 1: Member to receive output

*FIRST
The first member in the file receives the output. If OUTMBR(*FIRST) is specified and the member does not exist, the system creates a member with the name of the file specified for the File to receive output (OUTFILE) parameter. If the member already exists, you have the option to add new records to the end of the existing member or clear the member and then add the new records.
name
Specify the name of the file member that receives the output. If it does not exist, the system creates it.

Element 2: Replace or add records

*REPLACE
The system clears the existing member and adds the new records.
*ADD
The system adds the new records to the end of the existing records.

System (SYSTEM)

Specifies whether the information that is returned is about files on the local system or files on remote systems.

The possible values are:

*LCL
The information returned is about local files only.
*RMT
The information returned is about remote files only.
*ALL
The information returned is about both local and remote files.

Examples

Example 1: Displaying Definition of a File

DSPFD   FILE(*ALL/FILE1)

This command shows the definition of FILE1 as defined in all libraries authorized for the user on the local system. The information is displayed at the work station running the command.

Example 2: Displaying Attributes of Local DDM File

DSPFD   FILE(LIBRARY1/FILE1)

This command shows the definition of FILE1 as defined in LIBRARY1. If FILE1 is a Distributed Data Management (DDM) file, only the attributes of the local DDM file are shown at the work station running the command.

Example 3: Displaying Definition of All Files

DSPFD   FILE(*ALL/*ALL)  TYPE(*ALL)  SYSTEM(*ALL)

This command shows the definition of all the files in all libraries authorized for the user on both the local and on all remote systems. For DDM files, the displays first show information about the local DDM file and then, if available, information about the remote file that is named on the RMTFILE parameter of that CRTDDMF command. The information is shown at the work station running the command.

Error messages

*ESCAPE Messages

CPF3011
TYPE not found for file &1 in library &2.
CPF3012
File &1 in library &2 not found.
CPF3014
No file specified as &1 in &2 can be displayed.
CPF3020
No files in &1 in &2 have the specified FILEATR.
CPF3021
File &1 not allowed with SYSTEM(*RMT).
CPF3022
SYSTEM(*RMT) not allowed for files &1 in &2.
CPF3030
&3 records added to member &4 in file &1 in &2.
CPF3061
Record format &3 not found for outfile &1.
CPF3064
Library &1 not found.
CPF3067
Error while opening file &1 in &2.
CPF3068
Error while writing to file &1 in &2.
CPF3069
Error while closing file &1 in &2.
CPF3070
Error creating member &3 in file &1.
CPF3072
File &1 in &2 is a system file.
CPF3074
Not authorized to library &1.
CPF3075
Library &1 not available.
CPF3076
Error occurred when on display.
CPF3077
Error occurred when canceling display.
CPF3084
Error clearing member &3 in file &1.
CPF326B
Damage to file &1 in library &2.
CPF9851
Overflow value for file &1 in &2 too small.
CPF9852
Page size too narrow for file &1 in &2.
CPF9899
Error occurred during processing of command.