DSPFD (Display File Description) Command Description

DSPFD Command syntax diagram

Purpose

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 Programming topic in the Information Center.

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.

Required Parameter

FILE
Specifies the qualified name of the file or the qualified generic name of several files that have their descriptions shown, printed, or directed to a database file. This parameter can specify that all files in the specified library or libraries (*LIBL/*ALL for example), or that all files in all libraries (*ALL/*ALL), have their descriptions provided.

Note: The user must have authority to both the specified libraries and the specified files before the file descriptions are provided.

The name of the file description 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.

*USRLIBL: Only the libraries in the user portion of the job's library list are searched.

*ALL: All libraries in the system, including QSYS, are searched.

*ALLUSR Libraries

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

*ALL: The descriptions of all files in the library or libraries with the specified library qualifier are shown.

generic*-file-name: Specify the generic name of the file or group of files that have their descriptions shown. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*. The asterisk substitutes for any valid characters. A generic name specifies all objects with names that begin with the generic prefix for which the user has authority. If an asterisk is not included with the generic (prefix) name, the system assumes it to be the complete object name. For more information on the use of generic names, refer to generic names.

file-name: Specify the full name of the file whose description is shown.

Optional Parameters

TYPE
Specifies the types of file information that are provided. See Table 1 at the end of this command description for the values that can be specified on the TYPE parameter in combination with the FILEATR, OUTFILE, and FORMAT parameters.

Note: Only one type can be specified if a file name is specified for the OUTFILE parameter.

Single Values

*ALL: All the types of information that apply to the specified file are provided.

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

*BASATR: The basic attribute information common to all files is provided. The correct output file format is QWHFDBAS from system file QAFDBASI.

Note: TYPE(*BASATR) is valid only if OUTPUT(*OUTFILE) is specified and a file name is specified for the OUTFILE parameter.

Multiple Values

*ATR: The attribute information for the specified file is provided. For database files, the attributes include the access path type and the maximum number of members. The correct output file format is the format unique to the requested file attribute.

*ACCPTH: For physical and logical files only, the access paths of the specified file are provided. For keyed access paths, the composite key description is also provided. The correct output file format is QWHFDACP from system file QAFDACCP.

*MBRLIST: For physical and logical files only, an alphabetical list that contains the names of all members in the specified file and a brief description of each member is provided. The correct output file format is QWHFDML from system file QAFDMBRL.

*SELECT: For logical files only, the select/omit attribute is provided. The correct output file format is QWHFDDSO from system file QAFDSELO.

*SEQ: For physical and logical files only, the collating sequence is provided. The correct output file format is QWHFDSEQ from system file QAFDCSEQ.

*RCDFMT: The record format names and record format level information for the file, including the record format name(s) and data association information for referenced files are provided. The correct output file format is QWHFDFMT from system file QAFDRFMT.

*MBR: For physical and logical files only, information about the file members (names, creation dates, sizes, types, and other attributes) in the specified file is provided. Members are in the order in which they were created. The correct output file format is QWHFDMBR from system file QAFDMBR.

*SPOOL: For device files only, the spooling attributes of the specified diskette or printer file are provided. The spooling attributes include the number of output copies produced, the output priority, and the maximum number of records in the file. The correct output file format is QWHFDSPL from system file QAFDSPOL.

*JOIN: For join logical files only, the join from-file, the join to-file, and the fields that are involved in the join are provided. The correct output file format is QWHFDJN from system file QAFDJOIN.

*TRG: For physical files only, 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
Specifies whether the output from the command is provided at the requesting work station, printed, or placed in a database output file. More information on this parameter is in commonly used parameters.

*: Output requested by an interactive job is shown on the display. Output requested by a batch job is printed with the job's spooled output.

*PRINT: The output is printed with the job's spooled output.

Note: If OUTPUT(*OUTFILE) is specified, a type other than *ALL must be specified for the TYPE parameter (only one type may be specified). If TYPE(*ATR) is specified while OUTPUT(*OUTFILE) is specified, FILEATR(*ALL) or FILEATR(*MXDF) cannot be specified.

*OUTFILE: The output is directed to the database file specified on the OUTFILE parameter.

FILEATR
Specifies the type of file whose attributes are shown. See Table 1 at the end of this command description for the values that can be specified on the FILEATR parameter in combination with the TYPE, OUTFILE, and FORMAT parameters.

Note: If SYSTEM(*RMT) or SYSTEM(*ALL) is specified, the only valid file attributes are *PF, *LF, and *ALL for displayed output, printed output, or output file processing.

*ALL: The attributes of all files are shown.

Note: *ALL cannot be specified if a value is specified for the OUTFILE parameter, and TYPE(*ATR) is specified.

*DSPF: The attributes of display files are provided. This includes both *DSPF and *DSPF38. If a value is specified for the OUTFILE parameter and TYPE(*ATR) is specified, display files or mixed files with display device entries are shown. The correct output file format is QWHFDDSP from system file QAFDDSP.

*PRTF: The attributes of printer files are provided. This includes both *PRTF and *PRTF38. The correct output file format is QWHFDPRT from system file QAFDPRT.

*DKTF: The attributes of diskette files are provided. This includes both *DKTF and *DKTF38. The correct output file format is QWHFDDKT from system file QAFDDKT.

*TAPF: The attributes of tape files are provided. This includes both *TAPF and *TAPF38. The correct output file format is QWHFDTAP from system file QAFDTAP.

*CMNF: The attributes of communications files are provided. This includes both *CMNF and *CMNF38. If a value is specified for the OUTFILE parameter and TYPE(*ATR) is specified, only communication files or mixed files with communications device entries are shown. The correct output file format is QWHFDCMN from system file QAFDCMN.

*BSCF: The attributes of BSC communications files are provided. This includes both *BSCF and *BSCF38. If a value is specified for the OUTFILE parameter and TYPE(*ATR) is specified, only BSC communication files or mixed files with BSC communications device entries are shown. The correct output file format is QWHFDBSC from system file QAFDBSC.

*MXDF: The attributes of mixed files are provided.

Note: *MXDF cannot be specified if a value is specified for the OUTFILE parameter and TYPE(*ATR) is specified.

*PF: The attributes of physical files are provided. This includes both *PF and *PF38. The correct output file format is QWHFDPHY from system file QAFDPHY.

*LF: The attributes of logical files are provided. This includes both *LF and *LF38. The correct output file format is QWHFDLGL from system file QAFDLGL.

*SAVF: The attributes of save files are provided. This includes both *SAVF and *SAVF38. The correct output file format is QWHFDSAV from system file QAFDSAV.

*DDMF: The attributes of the Distributed Data Management (DDM) files are provided. This includes both *DDMF and *DDMF38. The correct output file format is QWHFDDDM from system file QAFDDDM.

*ICFF: The attributes of ICF files are provided. The correct output file format is QWHFDICF from system file QAFDICF.

OUTFILE
Specifies the qualified name of the database output file to which the output of the display is directed.

When creating the database output file, the current date, time, and system name must be included. The system name is the name of the source system, not the target system.

If the file entered as the OUTFILE does not exist, the system creates it in the specified library, or in the *CURLIB library when *LIBL is specified as the library name. The text for the created file is 'Outfile for DSPFD' and the public authority is *EXCLUDE. The file is correctly formatted.

If the file specified on the OUTFILE parameter exists and has the correct format, the system uses the file.

Note: The outfile format must correspond to that of the TYPE and FILEATR parameter descriptions. See Table 1 at the end of this command description for the values that can be specified on the OUTFILE parameter in combination with the TYPE, FILEATR, and FORMAT parameters.

The name of the database file 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 receives the output of the command. If no file by that name is found, a file by that name is created and stored either in the specified library, or, if not qualified, in the current library. The file can be used again by other DSPFD commands that request the same types of information. The IBM-supplied model database files cannot be specified.

OUTMBR
Specifies the name of the database file member to which the output is directed.

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 on the OUTFILE parameter. If the member exists, the user has the option to add records to the end of the existing member or to clear the existing member before adding the new records.

member-name: Specify the file member that receives the output. If OUTMBR(member-name) is specified and the member does not exist, the system creates it.

Element 2: Operation to Perform on Member

*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
Specifies whether the information provided is about files on the local system (*LCL), on the remote system or systems (*RMT), or on both the local and the remote systems (*ALL). For performance considerations, unless explicitly looking for information about files on systems other than the local system, the default value of *LCL must not be changed.

*LCL: The information provided is about local files only.

*RMT: The information provided is about remote files that have been named on the RMTFILE parameter of successfully issued CRTDDMF commands. To view this information, specify the name of the distributed data management (DDM) file, not the name of the remote file. Only information returned by the remote system is shown.

*ALL: The information provided is about files on both the local and the 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 was named on the RMTFILE parameter of the CRTDDMF command.

The following table lists the values that can be specified on the TYPE parameter in combination with the FILEATR, OUTFILE, and FORMAT parameters.

Note: Only one type can be specified if a file name is specified for the OUTFILE parameter.

Table 1. DSPFD Type, File Attribute, Output File, and Record Format Combinations

TYPE FILEATR1 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
*MBRLIST Note 2 QAFDMBRL QWHFDML
*SELECT Note 3 QAFDSELO QWHFDDSO
*SEQ Note 2 QAFDCSEQ QWHFDSEQ
*RCDFMT Note 1 QAFDRFMT QWHFDFMT
*MBR Note 2 QAFDMBR QWHFDMBR
*SPOOL Note 4 QAFDSPOL QWHFDSPL
*JOIN Note 5 QAFDJOIN QWHFDJN
*TRG Note 6 QAFDTRG QWHFDTRG
*CST Note 6 QAFDCST QWHFDCST
*NODGRP Note 7 QAFDNGP QWHFDNGP
1 The user 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 the user is requesting file types that match the appropriate request.

Notes:

  1. Any entry or multiple entries can be made in the FILEATR parameter.
  2. Only for physical and logical files
  3. Only for logical files
  4. Only for device files
  5. Only for join logical files
  6. Only for physical files
  7. Only for distributed physical files

Examples for DSPFD

In the following examples, assume that the commands are entered at a display work station and that the user of the command is authorized to access all relevant libraries and objects.

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.

Additional Considerations

When the DSPFD command is entered, the specified libraries are searched for the file or files specified by the FILE parameter; then a group of records that give file-level information about each file is created. The records are placed in the printer device file named QPDSPFD. If OUTPUT(*PRINT) is specified on the command, the records are listed on the printer in the following order:

  1. On the first line, the leftmost fields show system identifier numbers. The right side shows the date and time the job was run and the page number.
  2. The file, library, type of information, file attributes, and processor are shown (page 1 only).
  3. The specific file, library, and type of file (to which the following information applies) are shown.
  4. Header information that identifies the type of information being presented is shown, followed by the requested attribute information.

If the attributes of more than one file are shown or printed, the attributes of the next file are shown only after all of the requested attributes for the first file are shown. For printed output, a separate page is used for each type of information that is printed, as indicated by the TYPE parameter.

For displayed or printed output, if no detailed information exists for the specified file type, an appropriate indication is given under the section heading for that type of display. For example, if a logical file is shown and TYPE(*MBR *MBRLIST) was specified, but no members have yet been defined for the file, the message (no members in file) is shown or printed under the section headings for the member attributes display and for the member list display.

For output to a display, the first four lines of each display contain information about the spooled file and fields used for display spooled file functions.

Numeric values in select/omit field descriptions are shown without decimal points. See the description of the fields (by using the Display File Field Description (DSPFFD) command) to determine the decimal positions.

Error messages for DSPFD

*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.