Top Interview Questions
AS/400 stands for Application System/400. It is a midrange computer system developed by IBM (International Business Machines) and was first introduced in 1988. AS/400 is widely known for its reliability, stability, security, and strong database integration. Over time, AS/400 has evolved and is now officially called IBM i, running on IBM Power Systems.
Even today, many banks, insurance companies, retail chains, manufacturing firms, and government organizations continue to use AS/400 systems because of their high performance and low downtime.
The AS/400 platform has gone through several name changes and upgrades:
1988 – AS/400 introduced
1995 – Renamed to iSeries
2006 – Renamed to System i
2008 onwards – Known as IBM i running on Power Systems
Despite the name changes, the core concepts and strengths remain the same.
AS/400 uses an operating system called OS/400, now known as IBM i. It tightly integrates:
Operating system
Database
Security
Job management
This integration makes AS/400 easier to manage compared to other systems.
AS/400 includes IBM Db2 for i, a powerful relational database built directly into the operating system.
Advantages:
No separate installation required
High performance
Strong data integrity
Automatic optimization
AS/400 uses an object-based system, where everything is an object:
Files
Programs
Queues
Users
Each object has specific authority and security rules, which makes the system very secure.
Security is one of the biggest strengths of AS/400:
Object-level security
User profiles
Role-based access
Auditing and logging
Because of this, AS/400 systems are rarely affected by viruses or malware.
AS/400 systems are famous for:
99.9% uptime
Minimal system crashes
Ability to run for years without reboot
This makes them ideal for mission-critical applications like banking and ERP systems.
AS/400 supports multiple programming languages:
Most popular AS/400 language
Used for business logic
Evolved into RPG IV (Free Format RPG)
Used in legacy business applications
Still supported in AS/400
Used for job control and system operations
Similar to scripting
Supported for modern application development
Used to access and manage Db2 database
AS/400 uses a unique file system structure:
Libraries – Containers for objects
Files – Can be physical files (tables) or logical files (views)
Members – Data stored inside files
This structure provides strong organization and data control.
AS/400 is a job-based system:
Every task runs as a job
Jobs are managed using job queues
Multiple jobs can run simultaneously
This allows excellent multitasking and performance management.
Extremely Reliable – Rare system failures
High Security – Strong object-level security
Integrated Database – No need for external DB installation
Low Maintenance Cost – Minimal administration
Backward Compatibility – Old programs still run on new systems
Scalable – Supports small to very large businesses
Limited Talent Pool – Fewer developers compared to Java or .NET
Legacy Image – Considered old-fashioned
Cost – Hardware and licensing can be expensive
UI Limitations – Traditional green-screen interfaces
However, modern IBM i supports web interfaces, APIs, and cloud integration, reducing these limitations.
AS/400 is not outdated. IBM i supports:
Web services
REST APIs
Cloud hosting
Integration with Java, Python, and Node.js
Modern IDEs like Rational Developer for i (RDi)
Many companies modernize their AS/400 applications instead of replacing them because of data reliability and business continuity.
AS/400 is commonly used in:
Banking and finance systems
ERP systems
Inventory management
Payroll processing
Order management systems
Large organizations prefer AS/400 due to data safety and long-term stability.
AS/400 skills are still in demand:
RPG Developer
AS/400 Administrator
IBM i Support Engineer
Since fewer professionals are available, experienced AS/400 developers often get good salaries.
Answer:
AS400, also called IBM iSeries, is a midrange server designed for small and medium businesses. It’s known for reliability, security, and integrated architecture. AS400 supports multiple programming languages like RPG, COBOL, Java, and SQL. It’s widely used for enterprise applications.
Answer:
Integrated System: Combines OS, database, and security.
Reliability: Known for high uptime.
Scalability: Can handle growing business needs.
Security: Built-in security features.
Multi-language Support: Supports RPG, COBOL, SQL, Java, C.
DB2 Database: Integrated relational database for data storage.
Answer:
AS400 uses IBM i (formerly OS/400) as its operating system. IBM i provides integrated database, security, and middleware services, making application development and execution seamless.
Answer:
| Feature | AS400 | Regular PC Server |
|---|---|---|
| OS | IBM i (OS/400) | Windows/Linux |
| Architecture | Integrated system | Separate components |
| Reliability | Very high | Moderate |
| Database | Built-in DB2 | External DB |
| Security | Built-in, strong | Requires additional tools |
| Programming | RPG, COBOL, SQL, Java | Mostly C, Java, Python |
Answer:
A library in AS400 is a logical grouping of objects (files, programs, etc.). It helps in organizing and managing objects efficiently. Libraries are similar to folders in Windows but specifically designed to store AS400 objects.
Answer:
Physical File (PF): Stores data physically on the disk.
Logical File (LF): Provides a view or index of data from physical files.
Source Physical File (PF-SRC): Stores source code for programs or commands.
Answer:
| Feature | Physical File (PF) | Logical File (LF) |
|---|---|---|
| Data Storage | Stores actual data | Does not store data, provides a view |
| Usage | Base table for applications | Access and retrieve data efficiently |
| Indexing | May or may not have indexes | Can create multiple indexes |
Answer:
Everything in AS400 is considered an object, including:
Files (PF, LF)
Programs (RPG, COBOL)
Libraries
Device descriptions
Messages
Objects have types like PGM (program), FILE, LIB (library), and CMD (command).
Answer:
RPG (Report Program Generator): Widely used for business logic.
COBOL: For legacy applications.
CL (Control Language): To control AS400 commands and jobs.
SQL: For database operations.
Java & C: Supported for modern applications.
Answer:
CL is a scripting language used to execute commands, automate tasks, and control AS400 operations.
Example commands:
WRKOBJ – Work with objects
WRKACTJOB – Work with active jobs
DSPLIB – Display library contents
Answer:
A job is a unit of work executed on AS400. There are three main types:
Interactive Job: Initiated by a user on a terminal.
Batch Job: Runs in the background without user intervention.
Subsystem Job: Managed by AS400 subsystems.
Answer:
A subsystem controls a group of jobs. It manages resources like CPU, memory, and devices.
Example: QINTER subsystem handles interactive jobs.
Example: QBATCH subsystem handles batch jobs.
Answer:
AS400 has built-in security features:
User Profiles: Define access and permissions.
Object Authority: Controls access to files, programs, and libraries.
Passwords & Authentication: Enforces strong password policies.
Audit Journal: Tracks system activities for compliance.
Answer:
Library: A container for AS400 objects (files, programs, etc.) with a type system.
Folder: A simple directory structure in Windows or Linux.
Libraries are more structured and integral to AS400’s object-oriented architecture.
Answer:
WRKLIB – Work with libraries
WRKOBJ – Work with objects
WRKJOB – Work with jobs
DSPFD – Display file description
WRKSPLF – Work with spool files
GO MAIN – Main menu of commands
Answer:
A spool file is a temporary file that holds output data before printing. Example: Reports generated by an RPG program are stored in spool files.
Answer:
DB2 for i is the integrated relational database in AS400. It allows SQL queries, transactions, and indexing. Unlike traditional databases, it is tightly integrated with the OS and AS400 objects.
| Feature | Interactive Job | Batch Job |
|---|---|---|
| User Interaction | Yes, needs user input | No, runs in background |
| Execution | Immediate | Queued and scheduled |
| Example | Terminal-based RPG program | Nightly report generation |
Answer:
A library list is a sequence of libraries the system searches to find objects. It works like a path environment variable in Windows/Linux.
Example: When a program references EMPLOYEE, AS400 searches the library list to find the object.
Answer:
RPG is a high-level programming language used for business applications. Its main functions include:
Processing data from files
Generating reports
Performing calculations
Handling transactions
| Feature | RPG III | RPG IV |
|---|---|---|
| Free-form | No | Yes, supports free-form syntax |
| Modernization | Older applications | Modern features, easier to read |
| File handling | Fixed format | Enhanced file handling options |
Answer:
PDM (Programming Development Manager) is a tool for managing source files, libraries, and objects. It provides menus for creating, editing, compiling, and deleting objects efficiently.
WRKOBJ → Work with a specific object type in a library
WRKLIB → Work with all objects within a library
Answer:
Using SEU (Source Entry Utility) or CL commands:
CRTPF FILE(LIBRARY/FILE) RCDLEN(100)
CRTPF → Create Physical File
RCDLEN → Record length
Answer:
Programs can be run via:
Command line:
CALL PGM(LIBRARY/PROGRAM)
Menu options in interactive session
Answer:
A Source Physical File (PF-SRC) stores source code for programs or commands. Each member of the source file contains code for a specific program, command, or procedure.
Example: QRPGLESRC is a source file for RPGLE programs.
Answer:
A member is a subdivision of a source physical file. It allows storing multiple programs or objects in one source file.
Example: EMPLOYEE and SALARY can be members in QRPGLESRC.
| Feature | Interactive Job | Batch Job |
|---|---|---|
| Initiated by | User at terminal | Scheduled or submitted |
| Execution | Runs immediately | Queued to run later |
| User Interaction | Yes | No |
| Example | Entering data in forms | Generating payroll reports |
Answer:
WRKACTJOB (Work with Active Jobs) displays all running jobs on the system. It helps in:
Monitoring performance
Checking CPU/memory usage
Ending stuck jobs
Answer:
A Job Queue stores jobs waiting to run in batch mode. Jobs in the queue execute according to priority and subsystem rules.
Command: WRKJOBQ – Work with job queues
Interactive Jobs: User-initiated, runs on terminal
Batch Jobs: Runs in background, no user interaction
System Jobs: Manages OS-level tasks
Subsystem Jobs: Controlled by subsystems, can be interactive or batch
Answer:
A Job Schedule Entry automates the execution of batch jobs at specific times.
Command: ADDJOBSCDE – Add job schedule entry
Command: WRKJOBSCDE – Work with job schedule entries
Answer:
Use the command:
WRKACTJOB
Displays job status: Active, Held, Waiting, or Ended
You can filter by job type, user, or subsystem
| Feature | PRTF (Printer File) | DSPF (Display File) |
|---|---|---|
| Usage | For printing reports | For interactive screens |
| Output | Print spool files | Display on screen |
| Associated with | Spool file | Program display |
Answer:
CL (Control Language) programs automate tasks using AS400 commands.
Example: Automating batch jobs, calling programs, or managing files.
Sample snippet:
PGM
CRTLIB LIB(TESTLIB)
CRTPF FILE(TESTLIB/EMPFILE) RCDLEN(100)
ENDPGM
Answer:
A Data Queue allows communication between jobs or programs. It supports asynchronous data transfer.
Commands:
CRTDTAQ – Create data queue
SNDDTAQ – Send data to queue
RCVDTAQ – Receive data from queue
Answer:
A Service Program contains reusable code modules that can be called by multiple programs.
Useful for:
Business logic encapsulation
Reducing code duplication
Created via: CRTSRVPGM command
Library (LIB) – Container for objects
Program (PGM) – Compiled executable
File (FILE) – Physical or logical files
Command (CMD) – CL commands
Menu (MENU) – For interactive user menus
Device (DEVD) – Printer, display, or disk devices
Answer:
User Profiles: Define users and their authority
Object Authority: Controls access to specific files or programs
Group Profiles: Assign permissions to a group
Audit Journal (QAUDJRN): Tracks database operations
| Feature | DB2 for i (AS400) | Traditional SQL Database |
|---|---|---|
| Integration | Fully integrated with OS | Separate from OS |
| Object handling | Everything is an object | Tables, views only |
| Security | Built-in object authority | External security |
| Backup/Recovery | Integrated | Manual or external tools |
Answer:
Use CRTLF command:
CRTLF FILE(TESTLIB/EMPLOYEE) SRCFILE(TESTLIB/QRPGLESRC) SRCMBR(EmpLF)
Creates an indexed or logical view of a physical file for faster access
Answer:
Command:
DSPLIBL
Shows libraries in the current job’s library list
Order matters; AS400 searches libraries sequentially
Answer:
A User Profile defines:
Username and password
Library list
Job description
Object authority
Command to create:
CRTUSRPRF USRPRF(USER1) PASSWORD(P@ssword)
Answer:
A Job Description defines:
Default library list
User profile to run under
Job queue, subsystem, and priority
Answer:
Use WRKACTJOB to check active jobs and CPU usage
Use WRKSYSACT to monitor system resources
Analyze job logs using DSPJOBLOG
Monitor batch jobs with WRKSBMJOB
Answer:
A Spool File stores output before printing.
Commands:
WRKSPLF – View and manage spool files
DLTSPLF – Delete a spool file
CPYSPLF – Copy to database file or printer
| Command | Usage |
|---|---|
CRTCLPGM |
Creates a compiled CL program |
CRTCLCMD |
Creates a CL command for user execution |
Interactive CL Program: Takes input from user and runs immediately
Batch CL Program: Runs in background without user input
| Feature | SEU (Source Entry Utility) | PDM (Programming Development Manager) |
|---|---|---|
| Function | Edit source code | Manage source files, compile, delete |
| Navigation | Simple text editor | Menu-driven, more advanced |
| Usage | Writing program code | Full source and object management |
Answer:
A Job Log records messages related to a job’s execution:
Program errors
System messages
Job completion info
Command: DSPJOBLOG
Answer:
AS400 (IBM iSeries) architecture is designed as an integrated system with the following components:
Hardware: IBM Power Systems
Operating System: IBM i (OS/400)
Database: DB2 for i
Subsystems: Manage interactive and batch jobs
Security & Authority Management: User profiles, object authority
Integrated Middleware: Messaging, queues, and transaction processing
Advantages:
Single integrated system
High reliability and uptime
Simplified administration
Answer:
A Service Program (SRVPGM) contains reusable modules or procedures. It allows multiple programs to call the same logic without duplication.
Created using CRTSRVPGM
Can include procedures that can be bound at compile time or run time
Improves modularity and maintainability
Answer:
RPGLE (RPG IV): Modern version of RPG with free-form syntax
Supports modular programming with procedures
Supports SQL embedded for database operations
Differences from RPG III:
| Feature | RPG III | RPGLE (RPG IV) |
|---|---|---|
| Free-form code | No | Yes |
| SQL integration | Limited | Supported |
| Modularization | Limited | Procedures & service programs |
Answer:
Using parameterized programs for flexibility
Error handling with MONMSG for message monitoring
Job submission via SBMJOB for batch processing
Modularization using subprogram calls and procedures
Logging actions in spool files or log tables
Answer:
Use Job Schedule Entries (ADDJOBSCDE) to run batch jobs at specified times
Jobs submitted to batch using SBMJOB
Monitor with WRKSBMJOB and WRKJOBQ
Set job priorities and subsystem allocations for optimal performance
Answer:
Steps:
Check active jobs: WRKACTJOB
Monitor system performance: WRKSYSACT
Analyze job logs: DSPJOBLOG
Review database access:
Optimize logical files and indexes
Use SQL query optimization (EXPLAIN PLAN)
Subsystem tuning: Allocate memory, CPU resources efficiently
Cleanup: Remove unused spool files and temporary objects
Answer:
A subsystem manages a group of jobs, defining how they run and what resources they use.
Commands:
WRKSBS – Work with subsystems
CHGSBSD – Change subsystem description
Performance tuning:
Set maximum job entries
Allocate threads and memory
Separate batch and interactive jobs into different subsystems
Answer:
DB2 for i is integrated and fully object-oriented
Supports physical files (PF), logical files (LF), and indexes
SQL queries can be embedded in RPGLE or run directly
Supports transaction processing and journaling
Example:
SELECT * FROM EMPLOYEE WHERE DEPT = 'IT';
For performance:
Use proper indexes
Avoid full table scans
Optimize joins
Answer:
In CL:
Use MONMSG to monitor specific messages or errors
Example:
MONMSG MSGID(CPF0000) EXEC(DO)
SNDPGMMSG MSGID(CPF0000)
ENDDO
In RPGLE:
Use MONITOR, ON-ERROR, and ENDMON blocks
Example:
MONITOR
READ EMPFILE EMPREC;
ON-ERROR
// Log error or handle exception
ENDMON;
Answer:
Journaling tracks changes to files or objects, providing:
Audit trails
Recovery mechanisms
Change tracking
Commands:
STRJRNPF – Start journaling for physical files
DSPJRN – Display journal entries
ENDJRN – End journaling
Answer:
Data Queue (DTAQ): Allows asynchronous communication between programs or jobs
Commands:
CRTDTAQ – Create a queue
SNDDTAQ – Send data
RCVDTAQ – Receive data
Example use-case: Sending messages from an order entry job to a shipping program
Monitor active jobs with WRKACTJOB and filter by CPU or wait
End stuck jobs using ENDJOB
Analyze batch queues with WRKJOBQ
Use job logs to trace errors and execution issues
Answer:
Automates batch job execution
Reduces manual intervention
Integrates with subsystems and job queues
Can trigger jobs based on time, events, or file changes
| Feature | Physical File (PF) | Logical File (LF) | External Table (SQL) |
|---|---|---|---|
| Data Storage | Stores actual data | Indexed view of PF | SQL table representation |
| Purpose | Base data storage | Access optimization | External integration |
| Example | EMPLOYEE | EMPLOYEE_BY_DEPT | EXTERNAL_SQL_EMP |
Answer:
Use SQL instead of record-level access where possible
Avoid unnecessary loops and record reads
Use JOINs and indexes in SQL queries
Modularize code with service programs to reduce redundancy
Monitor memory and CPU usage
Answer:
Use proper commit strategies (COMMIT or ROLLBACK)
Implement record-level locking instead of table-level locks
Monitor lock conflicts using WRKOBJLCK
Use isolation levels in SQL (RR, CS, UR)
Answer:
Subfiles are used to display multiple records on a display file (DSPF)
Types:
Load-all subfile: Load all records at once
Display subfile: Load records as needed
Commands/keywords: SFLCTL, SFLDSP, SFLDSPCTL
Answer:
Use MONITOR / ON-ERROR / ENDMON blocks
For database errors, monitor CPF messages
Example:
MONITOR
UPDATE EMPFILE;
ON-ERROR
WRITE ERRMSG;
ENDMON;
Answer:
Commands:
WRKSYSACT – System activity
WRKACTJOB – Active job monitoring
WRKDSKSTS – Disk status
WRKSYSSTS – CPU, memory, subsystem info
Scenario: A batch job fails during payroll generation
Steps:
Check job log: DSPJOBLOG
Verify data files for missing records
Restart job using SBMJOB
Inform users and document issue
Join multiple tables efficiently:
SELECT E.EMPID, E.NAME, D.DEPTNAME
FROM EMPLOYEE E
JOIN DEPARTMENT D ON E.DEPTID = D.DEPTID
WHERE D.DEPTNAME = 'IT';
Use indexes for faster retrieval
Use EXPLAIN PLAN to optimize queries
Answer:
PTFs are updates/fixes applied to OS or software
Used to correct bugs or improve performance
Commands:
WRKPTF – Display installed PTFs
APYPTF – Apply PTF
Journals capture changes to files for auditing or recovery
Journal Receiver stores the journal entries
Commands:
STRJRNPF – Start journaling
DSPJRN – Display journal entries
Review spool files: WRKSPLF
Delete old spool files: DLTSPLF
Copy reports to physical files: CPYSPLF
Automate spool processing with CL programs.
Answer:
Use WRKSYSACT to monitor overall system activity.
Use WRKACTJOB to check active jobs, CPU usage, memory, and status.
Use WRKDSKSTS to monitor disk usage and status.
Use WRKSYSSTS for detailed CPU, memory, and subsystem information.
Advanced monitoring can be done with Performance Explorer (PEX) or Job Watcher tools.
Answer:
Submit batch jobs using SBMJOB.
Schedule recurring jobs with ADDJOBSCDE.
Monitor scheduled jobs using WRKJOBSCDE.
Monitor batch job execution using WRKSBMJOB and WRKJOBQ.
Set priorities and subsystem allocations to optimize performance.
Answer:
Use SQL queries instead of sequential file processing where possible.
Use indexes and logical files to reduce full table scans.
Avoid unnecessary loops or record reads.
Modularize code with service programs to avoid redundancy.
Monitor memory and CPU usage for resource-heavy programs.
Answer:
Use record-level locking instead of table-level locking.
Implement proper commit control (COMMIT or ROLLBACK).
Use appropriate isolation levels:
UR (Uncommitted Read)
CS (Cursor Stability)
RS (Read Stability)
RR (Repeatable Read)
Monitor locks using WRKOBJLCK or WRKUSRJOB.
Answer:
Ensures transaction integrity by grouping database operations into a single unit.
Commands:
STRCMTCTL – Start commitment control
COMMIT – Commit changes
ROLLBACK – Undo changes in case of error
Commonly used in financial applications to maintain data consistency.
| Operation | Description | Use Case |
|---|---|---|
CHAIN |
Access a specific record by key | Fast retrieval using primary key |
READ |
Sequential access | Loop through all records |
SELECT |
SQL access | Query with filters or joins |
Answer:
Prefer record-level locks to minimize contention.
Use commit control properly to avoid long-held locks.
Monitor locks using WRKOBJLCK or WRKUSRJOB.
Sequence batch jobs to reduce simultaneous access on the same records.
Handle deadlocks by catching CPF messages (e.g., CPF04A00) and retrying.
Answer:
Subfiles display multiple records on interactive screens.
Types:
Load-all subfile – Loads all records at once
Display subfile – Loads records as needed
Keywords in RPGLE: SFLCTL, SFLDSP, SFLDSPCTL.
Used in menus, reports, and transaction screens.
Answer:
Use MONITOR, ON-ERROR, and ENDMON for runtime exceptions.
Example:
MONITOR
UPDATE EMPLOYEE;
ON-ERROR
WRITE ERRMSG;
ENDMON;
Handles database or runtime errors gracefully.
Answer:
Spool files store output before printing or exporting.
Commands:
WRKSPLF – Work with spool files
CPYSPLF – Copy to database file or printer
DLTSPLF – Delete unnecessary files
Best practices: Automate cleanup via CL programs or batch jobs.
Answer:
Data queues allow asynchronous messaging between programs or jobs.
Commands:
CRTDTAQ – Create data queue
SNDDTAQ – Send data
RCVDTAQ – Receive data
Example: An order entry program sends order details to a shipping program.
| Feature | Interactive CL | Batch CL |
|---|---|---|
| Input | User input required | Runs without user input |
| Execution | Immediate | Queued or scheduled |
| Use Case | Data entry screens | Reports, payroll |
Answer:
Journals track changes to files or objects for auditing or recovery.
Journal Receiver stores these entries.
Commands:
STRJRNPF – Start journaling a file
ENDJRNPF – End journaling
DSPJRN – Display journal entries
Answer:
Use MONMSG in CL programs to handle specific messages.
Example:
MONMSG MSGID(CPF0000) EXEC(DO)
SNDPGMMSG MSGID(CPF0000)
ENDDO
In RPGLE, use MONITOR blocks to catch CPF messages.
Answer:
Create User Profiles to define access.
Assign object-level authority (Read, Write, Execute, All).
Use Group Profiles for role-based access.
Enable audit journal (QAUDJRN) for compliance.
Apply PTFs for security updates.
Answer:
Identify long-running jobs using WRKACTJOB.
Analyze batch job queues using WRKJOBQ.
Check system resource usage: WRKSYSACT, WRKSYSSTS.
Optimize database access: logical files, indexes, and reorganization.
Monitor spool files and memory usage.
Answer:
PTFs are updates or fixes provided by IBM for OS or software applications.
They are applied to correct bugs, improve performance, or enhance security.
Commands:
WRKPTF – Display installed PTFs
APYPTF – Apply a new PTF
Best practices: Apply PTFs during scheduled maintenance windows to avoid downtime.
Answer:
Use indexes for frequently accessed columns.
Avoid full table scans; use selective queries.
Use EXPLAIN PLAN to analyze query execution paths.
Minimize nested queries; use joins efficiently.
For large tables, consider table partitioning or query optimization techniques.
Answer:
Journaling captures changes to objects for audit or recovery.
Commands:
STRJRNPF FILE(LIB/FILE) – Start journaling a physical file
DSPJRN – Display journal entries
ENDJRNPF – End journaling
Journaling can track inserts, updates, and deletes.
Useful in financial, payroll, or inventory systems.
Answer:
Commands:
WRKSPLF – Work with spool files
CPYSPLF – Copy spool file to database or another printer
DLTSPLF – Delete spool files to free up storage
Best practices:
Automate cleanup of old spool files via CL programs or batch jobs
Archive critical reports for compliance
Answer:
Service programs (SRVPGM) contain reusable procedures or modules.
Benefits:
Reduces code duplication
Modularizes business logic
Created using CRTSRVPGM.
Example: A service program UTILSRV may contain procedures like CALCULATE_TAX or VALIDATE_DATA.
| Feature | Interactive CL | Batch CL |
|---|---|---|
| Input | Requires user input | Runs without user input |
| Execution | Immediate | Scheduled or queued |
| Example | Data entry screens | Nightly report generation |
Answer:
CL Programs:
Use MONMSG to handle specific messages.
Example:
MONMSG MSGID(CPF0000) EXEC(DO)
SNDPGMMSG MSGID(CPF0000)
ENDDO
RPGLE Programs:
Use MONITOR, ON-ERROR, ENDMON.
Example:
MONITOR
UPDATE EMPFILE;
ON-ERROR
WRITE ERRMSG;
ENDMON;
Answer:
Check job log: DSPJOBLOG.
Identify CPF messages or database errors.
Verify dependent files for missing records.
Correct the issue and resubmit using SBMJOB.
Document the resolution to prevent recurrence.
Answer:
Data queues (DTAQ) allow asynchronous communication between jobs or programs.
Commands:
CRTDTAQ – Create data queue
SNDDTAQ – Send data to queue
RCVDTAQ – Receive data from queue
Example: An order processing program sends data to a shipping program for asynchronous processing.
Answer:
A User Profile defines:
User ID and password
Library list and job description
Object authority
Commands:
CRTUSRPRF – Create a user
CHGUSRPRF – Change user profile
DSPUSRPRF – Display user profile
Best practice: Use group profiles for role-based access control.
Answer:
Monitor locks using WRKOBJLCK or WRKUSRJOB.
Implement record-level locking to minimize contention.
Use appropriate commit levels: UR, CS, RS, RR.
Sequence batch jobs to avoid simultaneous updates on the same records.
Retry jobs when a lock conflict occurs.
Answer:
Subfiles display multiple records in a screen (DSPF).
Types:
Load-all subfile – Loads all records at once
Display subfile – Loads only records required for display
Common RPGLE keywords: SFLCTL, SFLDSP, SFLDSPCTL.
Example: Employee listing with paging capabilities.
Answer:
Assign object authority (Read, Write, Execute, All) to files, programs, and libraries.
Use group profiles for roles instead of individual users.
Enable audit journal (QAUDJRN) to track access and changes.
Apply PTFs for security patches.
Commands:
GRTOBJAUT – Grant object authority
REVOKE – Remove authority
Answer:
Command: RGZPFM FILE(LIB/FILE) – Reorganize physical file members.
Purpose:
Reclaims unused space
Optimizes performance
Updates indexes
Best practice: Run during low-usage periods to minimize impact.
Answer:
Monitor active jobs: WRKACTJOB.
Check batch job queues: WRKJOBQ.
Review job logs: DSPJOBLOG.
Analyze SQL queries: EXPLAIN PLAN.
Monitor disk, memory, and CPU: WRKSYSACT, WRKSYSSTS.
Optimize file access paths, indexes, and logical files.