ILE RPG Concept Interview-1

16 Views


Here are detailed answers to your ILE (Integrated Language Environment) / IBM i (AS400) questions in English:


1. What is a Module?

A module is a compiled unit of code—like a compiled RPG, COBOL, or CL source—in ILE. It’s not directly executable but encapsulates procedures that can be bound into programs or service programs.


2. What is a Procedure?

A procedure, also called a subprocedure, is an individual function or routine within a module. It can have its own interface (parameters, return values) and can be invoked by other procedures.


3. How to define a procedure?

In RPGLE, you define a procedure using Dcl-Proc ... End-Proc for newer free-form, or /. etc. For example:

Dcl-Proc MyProc Export;
  Dcl-Pi MyProc Int(10);
    Param1 Int(10);
  End-Pi;
  // logic
End-Proc;

4. What is PR and PI?

  • PR (Prototype): Declares the interface of an external procedure—name, parameters, return type.

  • PI (Procedure Interface): Defines the actual interface inside the procedure for use by the compiler and runtime.


5. What is a Service Program?

A service program (*SRVPGM) is an object that packages multiple procedures into one entity. It allows external access to its exported procedures and enables dynamic linking (bind by reference) rather than static inclusion.(IBM, scottklement.com)


6. What is bind by copy?

Bind by copy means that modules are compiled into a program: their code is physically copied into the executable. This occurs when modules are specified directly in the program creation command or via a binding directory when needed.(IBM, scottklement.com)


7. What is bind by reference?

Bind by reference attaches a service program to a program without copying the code into the program. Instead, only linking information is bound; the service program resides separately and is dynamically linked at runtime.(IBM, scottklement.com)


8. Command to create and update a service program?

Use the CRTSRVPGM command to create a service program, specifying modules and exports. To update its contents or export list, use UPDSRVPGM, adjusting modules or library as needed.


9. Which command replaces modules in an ILE-bound program without recompiling?

There's no direct command that replaces modules in a bound program without re-creating it; ILE programs are immutable regarding modules—they must be re-created via CRTPGM (or UPDPGM with new options). Changing modules generally requires rebinding or re-creating. (No web citations found for a direct command.)


10. Is a Module executable?

No. A module is not executable on its own; it must be bound into a program or service program to become runnable.


11. Can we call a module?

No. Modules cannot be directly called. They need to be incorporated into a program or service program before being invoked.


12. What is a Binding Directory?

A binding directory is a repository used during binding (CRTPGM/CRTSRVPGM). It provides modules needed to resolve unresolved imports, enabling bind by copy of modules as necessary.(IBM)


13. What is an Activation Group?

An activation group provides the runtime environment for ILE programs or service programs. It controls memory allocation, variable lifetime, and resource cleanup.(go4as400.com, astradyne.net)


14. Difference between CALL, CALLB, and CALLP?

  • CALL: Traditional dynamic call to a program.

  • CALLB: Bound call to another module within the same program, used when modules are bound by copy.

  • CALLP: Procedure call in RPG; used for calling procedures/subprocedures, including those in service programs or modules.


15. How to import and export data between programs?

Use parameter passing via procedures (PR/PI definitions) for procedural interfaces. For service programs, you define exports via binder language (STRPGMEXP ... ENDPGMEXP) to expose procedures and data.(scottklement.com, Programmers.io)


16. What happens when the activation group ends?

When an activation group ends:

  • Resources like static/dynamic storage, open files, and overrides are cleaned up.

  • Commitment control is either committed or rolled back depending on normal or abnormal end.(IBM, astradyne.net)


17. What are Program Entry Procedure (PEP) and User Entry Procedure (UEP)?

  • PEP: First procedure executed in a program—defined during binding with ENTMOD.

  • UEP: Procedure executed when the program is entered by a user (e.g., when called with CALL).


18. What is Binder Language (in simple terms)?

Binder language is a simple syntax block (STRPGMEXP ... ENDPGMEXP) in service programs specifying which procedures/data are exported and assigning a signature. It defines the public interface.(scottklement.com, Programmers.io)


19. When do we receive a Signature Violation error?

A Signature Violation occurs when the binding signature (interface definition) between a program and its service program doesn’t match—typically due to modified exports or reordering.(scottklement.com, Programmers.io)


20. Do all RPGLE programs qualify as ILE programs?

Not necessarily. If compiled with DFTACTGRP(*YES), an RPGLE program becomes OPM-like and cannot use ILE features such as modules, procedures, service programs, or binding directories.(IT Jungle)


21. Is QILE the default activation group?

Not exactly—but if no specific activation group is chosen, naming it QILE is a common convention. It’s a default named group preferred by some practitioners.(Stack Overflow, IBM)


22. Using RCLACTGRP(*Eligible)—what does it mean? Is it a good idea?

RCLACTGRP(*Eligible) deletes non-default activation groups that are no longer active (i.e., have no call stack entries). It helps reclaim resources. Its suitability depends on your application’s design—it's effective for resource cleanup but should be used carefully.(IBM)


23. Default Activation Group parameter changed to *CALLER on CRTPGM/CRTBNDRPG—what group are programs running in? Good idea?

If ACTGRP(*CALLER) is used, the program runs in the caller’s activation group—often the default activation group if launched from command line. This can simplify resource sharing but undermines the isolation benefits of ILE activation groups.(Programmers.io, go4as400.com)


24. Why doesn’t OPNQRYF work with ILE program?

OPNQRYF is an OPM-styled command; in ILE, default activation groups behave differently regarding shared file contexts. Often, OPM constructs like OPNQRYF don’t work if the program is not in the default activation group (*CALLER). Transitioning to SQL or native ILE methods is recommended.


25. Can I mix ILE and non‑ILE programs in the same application?

Yes. You can have both ILE and OPM programs within an application, but mixing them—especially calling ILE programs from OPM or vice versa—requires careful activation group and resource management.


 

Post Comments