Make sure your program includes the binding directory that holds the service program. If you are calling the program form CL then the binding directory will be added during the CRTPGM. If you are using RPGLE then you will put it in the H specs. (HBNDDIR(‘my_bibding_directory’).
Then call the API passing the required parms.
Look at http://code.midrange.com/47dbe785ac.html for calling it using a service program and
http://www.think400.dk/apier_3.htm#eks0017 for calling the API outside of the service program.
You need to code the ‘D’ specs related to the prototype for the API.
You do not need to code the ‘D’ specs related to the formats supported by the API. These D specs can be included into your source program. Format definitions can be found in source file QRPGLESRC of library QSYSINC if you have option 13 of the i operating system installed on your system. For *SRVPGM bound APIs the name of the source file member is the name of the *SRVPGM. That is, you want to copy in the source found in QSYSINC/QRPGLESRC,QJOURNAL.
You do not need to reference the *SRVPGM when compiling your RPGLE program. The system provides a binding directory (QUSAPIBD) which is implicitly used by the operating system when binding ILE programs. The system binder will automatically find the QJOURNAL *SRVPGM for you.
Some of this information can be found <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apiref/ileOverview.htm”>here</a>.
<a href=”http://www.brucevining.com/”>Bruce Vining Services</a>