AS/400 and IBM i interview questions and answers
AS/400 interview questions today are really IBM i questions: the platform that began as the AS/400 now runs as the IBM i operating system on IBM Power servers, still with its object-based design, built-in DB2 for i database and 5250 green-screen applications. Interviewers check that you know objects and libraries, how the library list resolves names, how jobs, subsystems and job queues work, and how to write and debug RPG and CL. Modernization roles add free-form RPG with embedded SQL, DDS-to-SQL conversion and exposing old programs as web services.
By Evin JohnPublished 9 min read
What AS/400 interviews cover
IBM introduced the AS/400 in the late 1980s, and the line was later renamed iSeries and System i before becoming IBM i on Power. Many companies in distribution, manufacturing, banking, insurance and retail still run core order, inventory and finance systems on it, so roles range from RPG developer and IBM i administrator to integration engineer for teams connecting those systems to newer apps. Interviewers know the terminology mixes eras, so using "AS/400" and "IBM i" interchangeably is fine, but say which OS releases and tools you have actually used rather than guessing at the newest.
- Platform questionsObjects, libraries, library lists, jobs, subsystems, spooled files and message handling.
- Language roundRPG (fixed and free-form), CL and embedded SQL; read a program and explain or fix it.
- Database roundPhysical and logical files, DDS versus SQL DDL, record locks, journaling and commitment control.
- Operations and modernizationA stuck job, a level-check error, a slow query, and how you would expose a program to a web front end.
IBM i platform fundamentals
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What does "everything is an object" mean? | Architecture | Programs, files, commands, user profiles, job descriptions and data areas are all typed objects (*PGM, *FILE, *USRPRF, *DTAARA and so on) with their own authority and allowed operations. You cannot, for example, write bytes into a program object like a file. |
| What is a library? | Organization | A container object that holds other objects, one level deep. QSYS holds the system and all other libraries. The integrated file system (IFS) adds a hierarchical, stream-file view alongside it. |
| What is the library list? | Name resolution | The ordered list of libraries a job searches for unqualified object names: a system portion, an optional product library, the current library, then the user portion. The first match wins. |
| What is single-level storage? | Memory model | Main memory and disk are addressed as one large address space, and the system decides what is in memory. Programs work with addresses, not file offsets. |
| What is TIMI and why does it matter? | Portability | The Technology Independent Machine Interface: programs compile to an intermediate form above the hardware, which is how old applications kept running across processor changes. |
| What are subsystems and job queues? | Work management | Subsystems such as QBATCH and QINTER provide the environment jobs run in. Batch jobs wait on a job queue attached to a subsystem, which controls how many run at once. |
| Interactive versus batch jobs? | Jobs | Interactive jobs serve a 5250 session and should be short. Batch jobs are submitted with SBMJOB for long work, so they do not tie up a user's session. |
| What are spooled files and output queues? | Output | Printed or report output is written as spooled files to an output queue, where it can be viewed, held, moved or printed later. |
| How do messages work? | Messaging | Programs send messages to message queues and job logs. Escape messages signal errors that the caller must handle; QSYSOPR receives operator messages that may need a reply. |
| Which commands do you use every day? | Practical use | WRKACTJOB for active jobs, WRKSPLF for spooled files, DSPJOBLOG for a job's messages, WRKOBJLCK for locks, DSPLIBL and EDTLIBL for the library list, and DSPFFD to see a file's fields. |
objects = {
("QSYS", "*CMD"): {"WRKACTJOB"},
("TESTDTA", "*FILE"): {"CUSTMAST", "ORDHDR"},
("PRODDTA", "*FILE"): {"CUSTMAST", "ORDHDR", "ORDDTL"},
("SALESPGM", "*PGM"): {"NIGHTLY"},
}
def resolve(name, objtype, system, curlib, user):
order = system + ([curlib] if curlib else []) + user
for lib in order:
if name in objects.get((lib, objtype), set()):
return f"{lib}/{name}"
return None # the real system would report the object as not found
system = ["QSYS", "QSYS2", "QUSRSYS"]
prod_user = ["PRODDTA", "SALESPGM", "QGPL"]
test_user = ["TESTDTA", "PRODDTA", "SALESPGM", "QGPL"] # someone added TESTDTA first
print(resolve("CUSTMAST", "*FILE", system, None, prod_user))
print(resolve("CUSTMAST", "*FILE", system, None, test_user))
print(resolve("ORDDTL", "*FILE", system, None, test_user)) # falls through to PRODDTA
print(resolve("NIGHTLY", "*PGM", system, "SALESPGM", test_user))
# PRODDTA/CUSTMAST
# TESTDTA/CUSTMAST
# PRODDTA/ORDDTL
# SALESPGM/NIGHTLYThe third line is the classic trap: a test library list that lacks one file silently falls through to production data. Interviewers ask how you would prevent it; good answers mention separate job descriptions per environment, qualified names in critical jobs, and authority that stops test users from changing production files.
DB2 for i and file questions
- Physical file versus logical file? A physical file holds the data in one record format. A logical file is a view over one or more physical files with its own key (access path), selection or join, and holds no data itself.
- DDS or SQL DDL? DDS is the older source format for files and screens. SQL tables, views and indexes do the same job with standard syntax, check data on write, and are preferred for new work; many shops convert DDS physical files to SQL tables while keeping the record format so programs still compile.
- What is a member? A physical file can hold several members, each a separate set of records in the same format. SQL tables use one member, and multi-member files need care when accessed from SQL (an alias per member).
- What is a level check error? A program compiled against one version of a file's record format opens a file whose format changed. The fix is to recompile the programs that use it, not to turn level checking off.
- How do record locks work in RPG? Reading a record for update locks it until it is updated, released or another record is read. Long screens that hold a lock while a user goes to lunch are a classic bug; WRKOBJLCK and the job log show who holds it.
- What are journaling and commitment control? Journaling records changes to files in a journal receiver, which supports recovery, auditing and replication. Commitment control groups changes into transactions with COMMIT and ROLLBACK, and it requires the files to be journaled.
- How do you find a slow SQL statement? Visual Explain and the index advisor in IBM i Access Client Solutions, or the database monitor; then add an index or rewrite the query so the SQL Query Engine can use one.
- How do .NET, Java or Python apps read DB2 for i? Through IBM's ODBC, JDBC or ADO.NET providers, ideally with SQL against tables and views rather than record-level access, and with a dedicated user profile that has only the authority it needs.
RPG, CL and ILE questions
**free
ctl-opt dftactgrp(*no) actgrp(*new);
dcl-f CUSTMAST keyed usage(*input);
dcl-s total packed(11:2) inz(0);
dcl-s sqlTotal packed(11:2) inz(0);
setll *loval CUSTMAST;
read CUSTMAST;
dow not %eof(CUSTMAST);
if CMSTAT = 'A';
total += CMBAL;
endif;
read CUSTMAST;
enddo;
exec sql select coalesce(sum(CMBAL), 0) into :sqlTotal
from CUSTMAST where CMSTAT = 'A';
dsply ('Native ' + %char(total) + ' SQL ' + %char(sqlTotal));
*inlr = *on;
return;PGM
DCL VAR(&LIB) TYPE(*CHAR) LEN(10) VALUE('SALESDTA')
ADDLIBLE LIB(&LIB) POSITION(*FIRST)
MONMSG MSGID(CPF2103) /* library already in the list */
SBMJOB CMD(CALL PGM(NIGHTLY)) JOB(NIGHTLY) JOBQ(QBATCH)
ENDPGM- What is ILE? The Integrated Language Environment: source compiles to modules, which are bound into programs or service programs. Service programs hold reusable procedures with exported signatures, and binding directories help the binder find them.
- What is an activation group and why does it matter? The run-time container for a program's storage and open files. The default activation group mimics old behavior; named groups or *NEW change when files close and memory is released, and mixing them carelessly leaves files open or resets state unexpectedly.
- Fixed-format or free-form RPG? Fixed format puts operations in columns and is still common in old code. Fully free-form RPG reads like a modern language, supports procedures and data structures cleanly, and is what most shops want new code in; you should be able to read both.
- **How does *INLR work?** Setting last record on tells the program to close files and release storage when it returns. Leaving it off keeps the program and its files ready for the next call, which can be faster but surprises people who expect a fresh start.
- How do you handle errors in RPG and CL? In RPG, monitor blocks and built-ins such as %ERROR with the E extender, plus the program status data structure. In CL, MONMSG after a command for specific message IDs, and a global MONMSG for anything unexpected that logs and re-sends.
- How do you debug a program? Compile with debug data, then use STRDBG or the graphical debugger in the IDE your shop uses, set breakpoints and watch variables. For batch jobs, service the job and debug it from another session.
- What IDEs are used? Older shops used PDM and SEU on the green screen; IBM's Eclipse-based Rational Developer for i and extensions for VS Code are common now, with source increasingly kept in Git.
Senior IBM i scenarios
| Scenario | What to check first | Likely direction |
|---|---|---|
| The nightly batch job is stuck in MSGW status. | WRKACTJOB, then the job's messages and DSPJOBLOG. | Answer or fix the inquiry message (often an error a program did not handle), then add proper error handling so it ends with a clear failure instead of waiting. |
| Users report an order screen hangs for minutes. | WRKOBJLCK on the files involved and the jobs holding locks. | A program holding a record lock during user input; read without lock, re-read with lock only when updating. |
| After a file change, many programs fail. | The level check errors in job logs. | Recompile all programs that use the file, found with DSPPGMREF, and plan field additions with care. |
| A report query that ran in seconds now takes minutes. | Visual Explain, index advisor, statistics, and whether a needed index or logical file was removed. | Create the advised index or rewrite the query; test with production-like data volumes. |
| The business wants a web front end for an order-entry screen. | Whether logic is mixed into the display-file program. | Move business logic into service program procedures, expose them through SQL or a web service, and keep the 5250 screen working during the transition. |
| An audit finds users with too much authority. | User profiles with special authorities, *PUBLIC access on sensitive files, adopted authority. | Least privilege by group profiles, *PUBLIC *EXCLUDE on sensitive objects, review of programs that adopt authority, and exit programs on network access such as ODBC and FTP. |
- How do you back up and recover an IBM i system? Full system saves on a schedule with the save menu options, daily SAVLIB or SAVCHGOBJ for changed objects, journals for point-in-time recovery, and tested restores. Many shops add high-availability replication to a second system.
- What is the security level system value? QSECURITY sets the overall security level; higher levels enforce resource security and protect the system integrity. Interviewers want to hear that production runs at a level that enforces object authority.
- How do you keep an old RPG application maintainable? Convert to free-form gradually, move shared logic into service programs with tests, replace DDS with SQL tables where possible, keep source in Git, and document the library list each environment uses.
Fictional example
- Interviewer
- Give me an example of a production problem on IBM i that you diagnosed.
- Candidate
- Our month-end close job kept stopping in MSGW around two in the morning. The job log showed an inquiry message from an RPG program: a decimal data error on a customer balance field. I traced the bad records to a file loaded by a new interface from another system that sometimes wrote blanks into a packed field. Short term, we corrected the records and answered the message. Longer term, I added validation in the interface program, changed the RPG to monitor for the error and write the record to an exceptions file instead of halting, and added a check to the job so operations got an email rather than a waiting job. The next three closes ran without intervention.
AS/400 and IBM i practice plan
- Days 1 and 2: if you have system access (an employer box or a community-hosted public system), list your library list, submit a batch job, and read its job log and spooled files.
- Day 3: create an SQL table and an index, then the equivalent DDS physical and logical file, and compare them with DSPFD.
- Day 4: write a free-form RPG program with a monitor block and an embedded SQL statement, and a CL wrapper with MONMSG.
- Day 5: cause a record lock and a level check on purpose, then find and fix each one.
- Days 6 and 7: prepare two stories, one operations problem and one modernization step, with commands you used and the result.
.NET applications commonly connect to DB2 for i through an ADO.NET provider, so ADO.NET interview questions is useful for integration roles. Analysts who extract IBM i data into workflows meet the other side in Alteryx interview questions, and SQL interview questions covers the query fundamentals DB2 for i shares with other databases.
Green-screen experience is hard to describe without jumping between commands. Natively, an AI interview assistant for Mac and Windows, transcribes a mock IBM i round on your computer so you can check whether your story moved clearly from symptom to job log to fix. During practice, it can read an RPG listing or a job-log message from a screenshot and suggest points to cover, and with Pro or the free trial it can use the résumé and job description you add. Transcripts and notes stay saved for later.
Questions people ask
What AS/400 questions are asked in interviews?
Objects and libraries, the library list, jobs, subsystems and job queues, physical versus logical files, DDS versus SQL, RPG and CL, ILE programs and service programs, record locks, journaling and commitment control.
Is AS/400 the same as IBM i?
IBM i is the current name of the operating system that began on the AS/400 line, which was renamed several times. It now runs on IBM Power servers, and the older name is still widely used in job postings.
What is the difference between a physical and a logical file?
A physical file stores the data in one record format. A logical file is a view over physical files with its own key, selection or join, and stores no data itself.
Do IBM i interviews ask about free-form RPG?
Often. Many shops write new code in free-form RPG with embedded SQL, but you are expected to read older fixed-format code too.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
