× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




On 13/10/2006, at 4:48 AM, Adrienne McConnon wrote:

Now for another question, I now see that my assumption that QWCLOBJL
listed as an API is what initally threw me off.  I assumed I would find
it in a service program.  Is there a command that will help me avoid
this confusion in the future? Is there a WHATISTHISOBJ command or
something like it?  Of course once I realized it was a program - the
WRKOBJ command showed that - I suppose that will be my starting point
next time I need to determine what type an object is.

It's commonly known as documentation. If it doesn't say anything special then it is probably a *PGM object. In general, APIs with 8-character (or less) upper-case names are *PGM objects. APIs with longer names or lower-case characters are bindable. Documentation for bindable APIs also includes the service program name or binding directory name. For almost all IBM bindable APIs you don't need to do anything except spell them correctly and call them correctly by using CALL PROGRAM or CALL PROCEDURE as appropriate. The compilers automatically use a system binding directory that allows them to find the bulk of the APIs. One of the few exceptions is when calling C-runtime functions. These are not found automatically and you'll need to specify the QC2LE binding directory. Other exceptions can include APIs for a specific program product.

For example:

Release Profile Handle (QSYRLSPH, QsyReleaseProfileHandle) API

Required Parameter Group for QSYRLSPH:
1       Profile handle  Input   Char(12)

Optional Parameter for QSYRLSPH:
2       Error code              I/O             Char(*)

Default Public Authority: *USE
Threadsafe: Yes


Syntax for QsyReleaseProfileHandle:
#include <qsyphandle.h>

void QsyReleaseProfileHandle
            (unsigned char * Profile_handle,
             void          * Error_code);

Service Program: QSYPHANDLE
Default Public Authority: *USE
Threadsafe: Yes


The title tells you there are two interfaces: QSYRLSPH and QsyReleaseProfileHandle. Given teh guidelines above you can guess which is which.

There are two interface descriptions: The first shows the parameters for QSYRLSPH, and the second shows QsyReleaseProfileHandle but they both result in the same underlying code being run.

The interface description for QsyReleaseProfileHandle also names the service program containing the API. If that's not enough to make a distinction then the first sentence in the documentation explains it further.

"The Release Profile Handle (OPM, QSYRLSPH; ILE, QsyReleaseProfileHandle) API validates a given profile handle and then releases it."

Notice the use of the terms OPM and ILE? In this case OPM=*PGM and ILE=bindable function.

The only remaining confusion is:
1) The presumption that bindable APIs will only ever be called from C (hence the #include rubbish, and void * etc. definitions) requiring COBOL and RPG IV programmers to translate C data types into COBOL or RPG IV equivalents. 2) The presumption that ILE languages will only ever use the bindable interface (hence the misuse of OPM and ILE). For ILE COBOL and RPG IV the OPM interface is often easier to use because the bindable interfaces frequently make the short-sighted assumption that they will only be invoked from C and use parameters that are easy to use in C (because of direct language support) but a bit harder in COBOL and RPG IV.

Practice and familiarity will make this easier.

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         iSeries Technical Specialists

   http://www.flybynight.com.au/
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175                                   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.