AS400

AS400

Top Interview Questions

About AS400

 

AS/400 (IBM i) – Complete Overview

Introduction to AS/400

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.


Evolution of AS/400

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.


Key Features of AS/400

1. Integrated Operating System

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.

2. Built-in Database (DB2)

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


3. Object-Based Architecture

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.


4. High Security

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.


5. Reliability and Stability

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.


Programming Languages in AS/400

AS/400 supports multiple programming languages:

1. RPG (Report Program Generator)

  • Most popular AS/400 language

  • Used for business logic

  • Evolved into RPG IV (Free Format RPG)

2. COBOL

  • Used in legacy business applications

  • Still supported in AS/400

3. CL (Control Language)

  • Used for job control and system operations

  • Similar to scripting

4. Java

  • Supported for modern application development

5. SQL

  • Used to access and manage Db2 database


AS/400 File System

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.


Job Management in AS/400

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.


Advantages of AS/400

  1. Extremely Reliable – Rare system failures

  2. High Security – Strong object-level security

  3. Integrated Database – No need for external DB installation

  4. Low Maintenance Cost – Minimal administration

  5. Backward Compatibility – Old programs still run on new systems

  6. Scalable – Supports small to very large businesses


Disadvantages of AS/400

  1. Limited Talent Pool – Fewer developers compared to Java or .NET

  2. Legacy Image – Considered old-fashioned

  3. Cost – Hardware and licensing can be expensive

  4. UI Limitations – Traditional green-screen interfaces

However, modern IBM i supports web interfaces, APIs, and cloud integration, reducing these limitations.


AS/400 in Modern IT

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.


Real-World Uses of AS/400

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.


Career Scope of AS/400

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.

Fresher Interview Questions

 

1. What is AS400?

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.


2. What are the key features of AS400?

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.


3. What is the operating system used in AS400?

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.


4. What is the difference between AS400 and a regular PC server?

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

5. What is a library in AS400?

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.


6. What are the different types of files in AS400?

Answer:

  1. Physical File (PF): Stores data physically on the disk.

  2. Logical File (LF): Provides a view or index of data from physical files.

  3. Source Physical File (PF-SRC): Stores source code for programs or commands.


7. What is the difference between a Physical File and Logical File?

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

8. What are AS400 objects?

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).


9. What programming languages are used in AS400?

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.


10. What is CL (Control Language) in AS400?

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


11. What is a Job in AS400?

Answer:
A job is a unit of work executed on AS400. There are three main types:

  1. Interactive Job: Initiated by a user on a terminal.

  2. Batch Job: Runs in the background without user intervention.

  3. Subsystem Job: Managed by AS400 subsystems.


12. What is a Subsystem in AS400?

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.


13. How does AS400 handle security?

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.


14. What is the difference between a library and a folder?

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.


15. What are the common AS400 commands for beginners?

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


16. What is a Spool File in AS400?

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.


17. What is a DB2 database in AS400?

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.


18. Difference between Interactive Job and Batch Job

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

19. What is an AS400 Library List?

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.


20. What is the role of RPG in AS400?

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


21. What is the difference between RPG III and RPG IV?

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

22. What is PDM in AS400?

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.


23. What is the difference between WRKOBJ and WRKLIB?

  • WRKOBJ → Work with a specific object type in a library

  • WRKLIB → Work with all objects within a library


24. How do you create a physical file in AS400?

Answer:
Using SEU (Source Entry Utility) or CL commands:

CRTPF FILE(LIBRARY/FILE) RCDLEN(100)
  • CRTPF → Create Physical File

  • RCDLEN → Record length


25. How do you run a program in AS400?

Answer:
Programs can be run via:

  • Command line:

CALL PGM(LIBRARY/PROGRAM)
  • Menu options in interactive session


26. What is a Source Physical File in AS400?

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.


27. What are members in AS400?

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.


28. What is the difference between interactive and batch jobs?

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

29. What is WRKACTJOB in AS400?

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


30. What is a Job Queue?

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


31. What are the types of jobs in AS400?

  1. Interactive Jobs: User-initiated, runs on terminal

  2. Batch Jobs: Runs in background, no user interaction

  3. System Jobs: Manages OS-level tasks

  4. Subsystem Jobs: Controlled by subsystems, can be interactive or batch


32. What is a Job Schedule Entry?

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


33. How do you check the status of jobs in AS400?

Answer:
Use the command:

WRKACTJOB
  • Displays job status: Active, Held, Waiting, or Ended

  • You can filter by job type, user, or subsystem


34. What is the difference between PRTF and DSPF in AS400?

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

35. What is a CL program?

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

36. What is a Data Queue in AS400?

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


37. What is a Service Program in AS400?

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


38. What are the types of objects in AS400?

  • 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


39. How is database security managed in AS400?

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


40. What is the difference between DB2 for i and traditional SQL databases?

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

41. How do you create a logical file on a physical file?

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


42. How do you display a library list?

Answer:
Command:

DSPLIBL
  • Shows libraries in the current job’s library list

  • Order matters; AS400 searches libraries sequentially


43. What is a User Profile in AS400?

Answer:
A User Profile defines:

  • Username and password

  • Library list

  • Job description

  • Object authority
    Command to create:

CRTUSRPRF USRPRF(USER1) PASSWORD(P@ssword)

44. What is a Job Description?

Answer:
A Job Description defines:

  • Default library list

  • User profile to run under

  • Job queue, subsystem, and priority


45. How do you troubleshoot performance issues in AS400?

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


46. What is a Spool File and how do you manage it?

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


47. What is the difference between CRTCLPGM and CRTCLCMD?

Command Usage
CRTCLPGM Creates a compiled CL program
CRTCLCMD Creates a CL command for user execution

48. What is an Interactive vs. Batch CL Program?

  • Interactive CL Program: Takes input from user and runs immediately

  • Batch CL Program: Runs in background without user input


49. What is the difference between SEU and PDM?

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

50. What is a Job Log?

Answer:
A Job Log records messages related to a job’s execution:

  • Program errors

  • System messages

  • Job completion info
    Command: DSPJOBLOG

Experienced Interview Questions

 

1. What is the architecture of AS400?

Answer:
AS400 (IBM iSeries) architecture is designed as an integrated system with the following components:

  1. Hardware: IBM Power Systems

  2. Operating System: IBM i (OS/400)

  3. Database: DB2 for i

  4. Subsystems: Manage interactive and batch jobs

  5. Security & Authority Management: User profiles, object authority

  6. Integrated Middleware: Messaging, queues, and transaction processing

Advantages:

  • Single integrated system

  • High reliability and uptime

  • Simplified administration


2. What is an SSP (Server Service Program) in AS400?

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


3. Explain RPGLE concepts and differences from RPG III

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

4. What are the common CL programming practices you follow for automation?

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


5. How do you handle job scheduling and batch processing?

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


6. How do you handle performance tuning in AS400?

Answer:
Steps:

  1. Check active jobs: WRKACTJOB

  2. Monitor system performance: WRKSYSACT

  3. Analyze job logs: DSPJOBLOG

  4. Review database access:

    • Optimize logical files and indexes

    • Use SQL query optimization (EXPLAIN PLAN)

  5. Subsystem tuning: Allocate memory, CPU resources efficiently

  6. Cleanup: Remove unused spool files and temporary objects


7. What is a Subsystem and how do you configure it for performance?

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


8. Explain database management in AS400 (DB2 for i)

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


9. How do you implement error handling in CL and RPG?

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;

10. Explain journaling in AS400

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


11. What is a Data Queue, and how do you use it?

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


12. Explain advanced job management techniques

  • 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


13. What is the role of the Job Scheduler in AS400?

Answer:

  • Automates batch job execution

  • Reduces manual intervention

  • Integrates with subsystems and job queues

  • Can trigger jobs based on time, events, or file changes


14. Explain the difference between Physical File, Logical File, and External Table

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

15. How do you optimize RPGLE programs for performance?

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


16. How do you handle DB2 locking and concurrency issues?

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)


17. Explain the concept of Subfiles in RPGLE

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


18. How do you implement exception handling in RPGLE?

Answer:

  • Use MONITOR / ON-ERROR / ENDMON blocks

  • For database errors, monitor CPF messages

  • Example:

MONITOR
   UPDATE EMPFILE;
ON-ERROR
   WRITE ERRMSG;
ENDMON;

19. How do you monitor system performance in AS400?

Answer:

  • Commands:

    • WRKSYSACT – System activity

    • WRKACTJOB – Active job monitoring

    • WRKDSKSTS – Disk status

    • WRKSYSSTS – CPU, memory, subsystem info


20. Real-time problem scenario handling

  • Scenario: A batch job fails during payroll generation
    Steps:

  1. Check job log: DSPJOBLOG

  2. Verify data files for missing records

  3. Restart job using SBMJOB

  4. Inform users and document issue


21. Advanced SQL queries in AS400

  • 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


22. Explain PTF (Program Temporary Fix) in AS400

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


23. What are Journals and Journal Receivers?

  • Journals capture changes to files for auditing or recovery

  • Journal Receiver stores the journal entries

  • Commands:

    • STRJRNPF – Start journaling

    • DSPJRN – Display journal entries


24. How do you handle spool file management for 4-year experience tasks?

  • Review spool files: WRKSPLF

  • Delete old spool files: DLTSPLF

  • Copy reports to physical files: CPYSPLF

  • Automate spool processing with CL programs.


25. How do you monitor system performance in AS400?

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.


26. How do you handle job scheduling and batch processing?

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.


27. How do you optimize RPGLE programs for 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.


28. How do you handle DB2 locking and concurrency issues?

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.


29. What is Commitment Control in AS400?

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.


30. Explain the difference between CHAIN, READ, and SELECT in RPGLE

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

31. How do you handle locking and deadlock issues in DB2 for i?

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.


32. What are subfiles in display files (DSPF)?

Answer:

  • Subfiles display multiple records on interactive screens.

  • Types:

    1. Load-all subfile – Loads all records at once

    2. Display subfile – Loads records as needed

  • Keywords in RPGLE: SFLCTL, SFLDSP, SFLDSPCTL.

  • Used in menus, reports, and transaction screens.


33. Explain exception handling in RPGLE with example

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.


34. What is a spool file, and how do you manage it efficiently?

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.


35. How do you use data queues for inter-program communication?

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.


36. Explain the difference between interactive and batch CL programs

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

37. What is a Journal and Journal Receiver?

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


38. How do you handle error messages (CPF messages) in AS400?

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.


39. How do you implement security in AS400?

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.


40. How do you troubleshoot performance issues in AS400?

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.


41. Explain PTF (Program Temporary Fix) in AS400

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.


42. How do you optimize SQL queries in AS400 (DB2 for i)?

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.


43. How do you implement journaling for auditing purposes?

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.


44. How do you manage spool files in production?

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


45. What is a service program and how do you use it?

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.


46. Explain the difference between interactive and batch CL programs

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

47. How do you implement exception handling in CL and RPGLE programs?

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;

48. How do you handle batch job failures in AS400?

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.


49. Explain data queues and their usage

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.


50. What is a user profile and how is it managed?

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.


51. How do you handle DB2 locking conflicts?

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.


52. Explain Subfiles in interactive screens

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.


53. How do you implement security and object authority?

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


54. How do you perform database reorganization in AS400?

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.


55. How do you troubleshoot performance issues in AS400?

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.