Display Files, Printer Files, and Database Files: Same Object Type, Different Jobs
IBM i groups display files, printer files, and database files under a single object type — *FILE — which can be genuinely confusing until you understand that shared type is about system-level classification, not about these three kinds of files doing anything similar. Their actual purposes couldn't be more different.
A display file is what drives an interactive 5250 screen. It defines the layout, fields, and behavior of what a user sees and interacts with during an interactive session — the closest thing IBM i has to a user interface definition file. When an RPG program reads from or writes to a display file, it's reading input a user typed or presenting a screen for them to view.
A printer file, by contrast, controls spooled output — the formatting and content of what eventually becomes a printed report or, more commonly today, a PDF or other electronic output. Printer files define things like page layout, line spacing, and field positioning for output that's meant to be read outside of an interactive session, whether that's a physical printout or a report emailed to a business user.
Database files are what most developers picture first when they hear the word file: physical files storing actual data, and logical files providing alternate views or access paths over that data. These are the files embedded SQL and native I/O operations actually read from and write to as an application processes business transactions.
All three share the *FILE object type because, from the operating system's perspective, they're all defined and managed through similar mechanisms — but a developer working with them needs to think about each in completely different terms. A display file's job is user interaction. A printer file's job is producing output. A database file's job is storing and retrieving data. Confusing these roles, or assuming a file's type tells you its purpose, is a fast way to misread an unfamiliar application.
Practically, commands like DSPFD let a developer inspect any of these file types and see exactly what kind of file they're actually looking at, along with its key attributes — a small habit that prevents a lot of confusion when working through an unfamiliar codebase.
This lesson is Lesson 10 of IBM i Platform Foundations in IBM i ILE RPG Mastery, rounding out the file-type fluency needed before the course moves into hands-on RPG file I/O.