Running IBM PASE for i programs and procedures
You can start an PASE for i program in a job and call PASE for i procedures from your ILE programs.
You can run your PASE for i program in any of several ways:
- Within an IBM® i job
- From an PASE for i interactive shell environment
- As a called program from an ILE procedure
ILE procedures that let you work with PASE for i programs
PASE for i provides a number of ILE procedure APIs that allow your ILE code to access PASE for i services (without special programming in your PASE for i program):
- Qp2dlclose
- Qp2dlerror
- Qp2dlopen
- Qp2dlsym
- Qp2errnop
- Qp2free
- Qp2jobCCSID
- Qp2malloc
- Qp2paseCCSID
- Qp2ptrsize
Calling a procedure in an PASE for i program from ILE code
You can call a procedure in an PASE for i program from ILE code that runs in a thread that was not created by PASE for i (for example, a Java™ thread or a thread created by ILE pthread_create()). Qp2CallPase() automatically attaches the ILE thread to PASE for i (creating corresponding PASE for i pthread structures), but only if the PASE for i environment variable PASE_THREAD_ATTACH was set to Y when the PASE for i program started.
Returning results from PASE for i to IBM i programs
Using the IBM i _RETURN() function, you can call an PASE for i program and return results without ending the PASE for i environment. This allows you to start an PASE for i program and then call procedures in that program (using Qp2CallPase()) after the QP2SHELL2 (but not QP2SHELL) or Qp2RunPase() API returns.