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



Larry:

_ILE RPG IV_
In the InfoCenter, under Programming, Application programming interfaces, Machine interface programming, Machine interface instructions, click on the link "i5/OS machine interface" that takes you to this page:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/rzatk/mitoc.htm

This page lists each instruction. When you click on an instruction and view the page describing it, notice that many (but not all) of the instructions have a section near the start, in a box, that says "Bound program access." (For example, click on the first instruction listed, ACOS). This means that this instruction can be used as an "MI built-in function" in any ILE program (ILE C, C++, ILE CL, ILE COBOL or RPG IV).

This method has the added benefit of the compiler generating "in-line" code to invoke that MI routine, without having to bind to and activate a separate service program, as is the case with the MI Library routines documented in the "ILE C C++ for AS/400 MI Library Reference" here:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/books/sc092418.pdf

_OPM RPG/400_
To issue MI instructions from an OPM language program, create an OPM MI program and CALL it as an external program from within any OPM language (CLP, COBOL/400, RPG/400, etc.) program. The InfoCenter section on "Machine Interface Programming"

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apiref/MIpgmg.htm

has sub-topics on "Writing an MI program" and "Compiling an MI program", in case you are interested to learn more about creating OPM MI callable programs (in effect, creating your own API "wrappers" for various MI instructions).

Or, you could create an ILE bound program that invokes the desired MI built-in, creating your own OPM-callable API "wrapper".

Does that help?

Mark S. Waterbury

> On 3/9/2011 7:20 AM, Larry Ducie wrote:
Hi All,

Is it possible to bind to CVTCN and CVTNC in a RPG program?

I understand that they are MI functions but QC2UTIL1 exports a version of CVTHC (cvthc) and CVTCH (cvtch) and CVTEFN is available to RPG as _CVTEFN.

Does anybody know if it is possible to access CVTCN and CVTNC from RPG? The API finder offers a multitude of APIs and it can be a challenge to find out which are offered by the system, which are offered as part of the C runtime libraries (and therefore available to ILE RPG) and which are MI functions that are not directly accessible to RPG.

Cheers

Larry Ducie


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.