How do I call an API which is in a service program

20 pts.
Tags:
AS/400 programming
RPGLE
RPGLE Program
I hope somebody can shed some light on the following. I need to call an API "QjoRtvJrnReceiverInformation" which is in service program QJOURNAL. I am not new to ILE but experience of using service programs and using API's within service programs is limited Do I need to code all the 'D' specs and call the API or do I need to bind the service pgm into the program which I create. Can anyone shed some light on this please?

Software/Hardware used:
AS400 - RPGLE

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Bruce Vining
<a href=”http://www.brucevining.com/”>Bruce Vining Services</a>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following