DDS Keyword Cheat Sheet by Object Type

Data Flow Breakdown

How do DDS components work together in real-world IBM i applications?

  • PF (Physical File) Stores raw business data like customer records, orders, inventory.
  • LF (Logical File) Creates filtered or sorted views of PF data—used for indexing, joins, or selection.
  • DSPF (Display File) Provides the green-screen interface for users to view or enter data. It pulls from PF and LF.
  • PRTF (Printer File) Generates formatted printed output (invoices, reports) using data from PF and LF.
  • User Interaction Users interact with DSPF screens to input or retrieve data.
  • Printer Output PRTF sends structured data to the printer for physical output.
IBM-i DDS File Types and How they work together

Physical File (PF)

Keyword
Purpose
Example
R
Record format definition
A R CUSTREC
Field name
Defines a field
A NAME 30A
K
Key field for indexing
A K CUSTID
TEXT
Field or record description
A TEXT('Customer Name')
COLHDG
Column heading for display
A COLHDG('Name')

Logical File (LF)

Keyword
Purpose
Example
R
Record format definition
A R CUSTVIEW
PFILE
Points to the physical file
A PFILE(CUST)
K
Key field for sorting
A K NAME
SELECT
Includes records matching criteria
A SELECT STATE EQ 'TX'
JOIN
Joins multiple PFs (advanced)
A JOIN(CUSTORD)

Display File (DSPF)

Keyword
Purpose
Example
R
Screen format definition
A R CUSTSCRN
CFxx
Function key definition
A CF03(03 'Exit')
B
Field position (row/column)
A NAME 30A B 5 10
DSPATR
Display attributes (e.g. reverse, blink)
A DSPATR(RI)
COLOR
Field color
A COLOR(BLU)
EDTCDE
Edit code for numeric formatting
A TOTAL 9P 2 EDTCDE(J)

Printer File (PRTF)

Keyword
Purpose
Example
R
Print format definition
A R INVOICE
SPACEB
Blank lines before printing
A SPACEB(2)
SKIPB
Skip to line before printing
A SKIPB(1)
DATE
Prints system date
A DATE
TIME
Prints system time
A TIME
BARCODE
Prints barcode (if supported)
A BARCODE(CODE39)
{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>