Here’s the 10th set of 20 AS400/IBM i interview Q&A (Data areas, LF, DFU, SQL, Subfiles, RPGLE).
1. What Are The Valid User Defined Data Area Types?
-
*DTAARA types:
-
*CHAR → character
-
*DEC → decimal
-
*LGL → logical (boolean)
-
2. What Is Multi-format Logical File?
-
A Logical File (LF) that combines record formats from multiple PFs.
-
Used when data must be joined or presented in different ways.
3. What Is The Select And Omit Criteria In Logical File?
-
DDS keywords in LF: SELECT includes records meeting condition, OMIT excludes records.
-
Example:
OMIT WHERE FIELD = 'X'
.
4. Can Fields Be Concatenated In a Logical File Level?
-
✅ Yes, using CONCAT in DDS.
-
Example:
FLD1 CONCAT FLD2
.
5. When we use the "All" Keyword?
-
Used in CPYF command:
MBROPT(*ALL)
→ copies all members. -
Also in library lists:
DSPLIB LIB(*ALLUSR)
.
6. What Is Difference Between CAT, TCAT, BCAT?
-
CAT → Concatenate with 1 blank in between.
-
TCAT → Trim right operand, then concatenate.
-
BCAT → Trim both operands, then concatenate.
7. In Which Specification The Report Layout Can Be Defined?
-
In O-specs (Output specifications) in RPG (for printer files).
8. What Does DFU Program allow You To Do On A Record?
-
DFU (Data File Utility) allows Add, Update, Delete, Display records in a PF without writing a program.
9. When Are The Unique Constraints Executed?
-
Enforced at insert or update time on the file.
10. When Are The Referential Constraints Executed?
-
Enforced at insert, update, or delete time depending on relationship.
-
Example: Insert fails if parent doesn’t exist.
11. Why Is The Declare Cursor Statement Used For?
-
Declares a cursor for row-by-row processing in SQL.
-
Example:
EXEC SQL DECLARE C1 CURSOR FOR SELECT * FROM MYFILE;
12. Which CL Command Can Be Used At Program Execution To Redirect The File Named In An RPG Program?
-
OVRDBF → overrides a file with another file/member before program runs.
13. How To Write *PSSR ?
-
Example RPG IV program status subroutine:
Begsr *PSSR;
// error handling code
*INLR = *ON;
RETURN;
Endsr;
14. What Is Procedure Prototype And Procedure Interface?
-
Prototype: Defines how a procedure is called (parameters, return type).
-
Interface: Defines how a procedure receives parameters inside.
15. Explain The Keywords EDTCDE & EDTWRD?
-
EDTCDE → Edit Code (predefined formats, e.g., blanks, commas).
-
EDTWRD → Edit Word (user-defined mask, e.g., ‘,,9.99’).
16. What Key Word Is Used When Screen Is Re-display?
-
RSTDSP → redisplay screen.
-
Also SFLDSPCTL for subfiles.
17. What Is Overlay?
-
DDS keyword → allows one display format to overlay another without clearing screen.
18. Difference Between View And Index?
-
View → Virtual table created with SQL, shows data subset (no physical data).
-
Index → Access path created for performance, may enforce uniqueness.
19. Mandatory Keywords Of Subfile?
-
SFL (subfile record format).
-
SFLCTL (subfile control format).
-
SFLSIZ, SFLPAG (subfile size, page size).
20. What Is %LOOKUP Opcode?
-
%LOOKUP
→ Searches an element in array or table. -
Returns index position if found, else 0.
✅ That’s 200 Q&A total (10 sets).
AS400 interview questions | Answers with explanation for 20 questions | Part10