A beginner-friendly guide to understanding common file object types on IBM i
Introduction
IBM i organizes data and objects using a powerful object-based architecture. For beginners, the different types of files can be confusing at first - especially when terms like PF, LF, or DTAQ start showing up in menus and commands. This guide breaks down the most commonly used IBM i file types in simple terms, with relatable examples to help you understand their roles and how they fit into everyday tasks.
1. PF - Physical File
What It Is: A PF (Physical File) stores actual data in rows and columns, much like a table in a relational database.
Think of It Like: A spreadsheet with rows of data you can read and update.
Use Case: Customer records, inventory tables, or transaction logs.
Create Example: CRTPF FILE(MYLIB/CUSTOMERS) SRCFILE(MYLIB/QDDSSRC)
2. LF - Logical File
What It Is: An LF (Logical File) is like a virtual view or index on a PF. It doesn't store data, but provides alternate ways to access and sort it.
Think of It Like: A filter or sorted view of your spreadsheet.
Use Case: Sorting customer records by ZIP code or selecting only active accounts.
Create Example: CRTLF FILE(MYLIB/CUSTBYZIP) SRCFILE(MYLIB/QDDSSRC)
3. SAVF - Save File
What It Is: A SAVF (Save File) is used to hold a backup of objects such as programs, libraries, or data files. It is especially useful for moving data between systems.
Think of It Like: A ZIP file containing backups or installable.
Use Case: Backing up a program or transporting it to another system.
Create Example: CRTSAVF FILE(MYLIB/MYSAVF)
4. DTAQ - Data Queue
What It Is: A DTAQ (Data Queue) allows programs to send messages or data to each other asynchronously.
Think of It Like: A shared mailbox where one program sends data and another picks it up later.
Use Case: Order processing systems where one job submits and another fulfills.
Create Example: CRTDTAQ DTAQ(MYLIB/ORDERSQ) MAXLEN(256)
5. OUTQ - Output Queue
What It Is: OUTQ holds spool files (printed output) waiting to be printed or viewed.
Think of It Like: A print queue in Windows.
Use Case: Holding reports, invoices, or logs before printing or archiving.
Create Example: CRTOUTQ OUTQ(MYLIB/SALESOUTQ)
6. CMD - Command Definition File
What It Is: CMD defines custom commands that users can run just like system commands.
Think of It Like: A shortcut or macro for a complex operation.
Use Case: Running a common cleanup task or triggering a job.
Create Example: CRTCMD CMD(MYLIB/MYCLEANUP) PGM(MYLIB/CLEANUPPGM)
7. DTAARA - Data Area
What It Is: A DTAARA is a small memory space used to store a single value or flag.
Think of It Like: A global variable or config setting.
Use Case: Storing the last run date of a job or a system flag.
Create Example: CRTDTAARA DTAARA(MYLIB/LASTRUNDATE) TYPE(*CHAR) LEN(10)
Conclusion
IBM i file types may sound technical at first, but they each serve a clear purpose once you know how they work. Whether you're managing data (PF/LF), transferring objects (SAVF), automating workflows (DTAQ), or generating output (OUTQ), these object types are essential building blocks of the IBM i platform.
Understanding these will not only help you navigate IBM i confidently but also empower you to troubleshoot and automate tasks with more clarity.