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



Sorry about the slashes in the parameters below - something happened with copy/paste from the web page.

Vern

On 3/23/2017 7:44 AM, Vernon Hamberg wrote:
Paul

Since I suggested you find an API, I'll see what help I can give you - and Bruce's book is the best resource you could get for learning how to interpret the various prototype declarations for APIs.

You can get more information in the QSYSINC library - the EIM APIs are declared in the documentation as C/C++ APIs, so the place to look first is the H source member - in there is a source file named EIM.

There IS also an EIM member in the QSYSINC/QRPGLESRC file - it MIGHT be useful but consists mostly of data structures, which you can use as models, maybe, for making your own. For example, if the DS' have binary data type elements, use integer data types instead.

OK, now for the return type - it is int - so your RPG prototype needs to return an int(10 : 0).

Now for parameters:

EimHandle */eim/

eim is the name of the parameter, the asterisk means this is a pointer, and the data type being pointed to is EimHandle - you can find what the underlying type is in the EIM member I mentioned. It is probably a 10-digit integer.

enum EimAssociationType/associationType /

enum is a special way of defining a set of values of a certain data type- here it will be an integer. You can find its definition in the EIM member, but it's in the web page - 4 values, from 1 to 4, are valid.

This parameter has to be passed by value (no asterisk) - so use the VALUE keyword on the prototype.
//

EimIdentifierInfo */idName/

EIMIdentifierInfo is a struct, like a data structure in RPG - it is described further down in the web page, including an enum that is used as one of the structure elements (subfield in RPG DS terms, basically).

Note the asterisk - this is a pointer to the structure, so you can simply define a data structure elsewhere, then use LIKEDS - RPG passes as pointers, so you're good to go.

char */registryName/
char */registryUserName/

Both of these are pointers to character - in C/C++ this means a string of characters that is terminated with the null character (x'00'). There is special stuff in RPG now to make this easier, as in one of the OPTIONS keyword options - *STR, I think, but am typing this from memory, and it's early!

EimRC */eimrc/

This is where errors are reported. EimRC is declared as a struct in the EIM member of the H file. It is also probably in the EIM member of the QRPGLESRC in QSYSINC, and this could be useful - maybe make your own version, based on the one in QSYSINC. Again, this is a pointer to that structure, so simply give it a name - RPG automatically handles it as a pointer when passed in the call.


I googled for the API and found several hits - I didn't follow them, but they might be for C/C++, so that means converting to RPG. You could google for "convert C to RPG", Barbara Morris has an article in the RPG Cafe on developerworks IIRC.

I hope this gives you a start - NOT as in startle!!

I gave a COMMON presentation last year on using C/C++ functions in RPG - if you like, send me an email off-list, I'll send it to you - it might be useful.

Cheers
Vern

On 3/23/2017 6:37 AM, Rob Berendt wrote:
Bruce Vining has a book on coding for APIs. Again, another book I've
never cracked but it also comes very highly recommended. IDK if he has
any EIM stuff in there.

Pat Botz used to be the high priest of this stuff at IBM. Now he's hung
up his own shingle and peddles product and consulting for this. IDK if he
has any books on this.

A google search of the RPG list shows someone asking for examples. I hate
it when someone does a reply to start a new unrelated thread. Next time
just type the darned list email address in or add it to your contacts. It
really uglifies the archives. At least it gives you a name and you might
see what he ended up doing.
https://archive.midrange.com/rpg400-l/200703/msg00278.html

“Parles-tu Français ?”
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014702009


Rob Berendt
-- IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail to: 2505 Dekko Drive Garrett, IN 46738 Ship to: Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com From: "Steinmetz, Paul" <PSteinmetz@xxxxxxxxxx> To: "'Midrange Systems Technical Discussion'" <midrange-l@xxxxxxxxxxxx> Date: 03/22/2017 05:28 PM Subject: RE: SSO - creating EIM source associations in batch Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx> I've identified the EIM API needed to do this. eimAddAssociation()--Add EIM Association https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_71/apis/eimaddassociation.htm This cannot be called directly, since it is a service program. Service Program Name: QSYS/QSYEIM I've never worked with service programs, and we only use a few here. I'm looking for an example for this API, either CL or RPGLE. Paul -----Original Message----- From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Vernon Hamberg Sent: Monday, March 20, 2017 12:23 AM To: Midrange Systems Technical Discussion Subject: Re: SSO - creating EIM source associations in batch There are APIs for EIM that can do all the stuff you want - I think someone gave you the path through Knowledge Center to get to them. On 3/18/2017 8:35 PM, Steinmetz, Paul wrote:
I've discovered how to create the EIM identifier and target association
in batch.
CHGUSRPRF USRPRF(PAULS) EIMASSOC('Paul Steinmetz' *TARGET *ADD
*CRTEIMID)

I'm looking for a method to also create the *source association.


Thank You
_____
Paul Steinmetz
IBM i Systems Administrator

Pencor Services, Inc.
462 Delaware Ave
Palmerton Pa 18071

610-826-9117 work
610-826-9188 fax
610-349-0913 cell
610-377-6012 home

psteinmetz@xxxxxxxxxx
http://www.pencor.com/

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email:MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:http://lists.midrange.com/mailman/listinfo/midrange-l
or email:MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives athttp://archive.midrange.com/midrange-l.

Please contactsupport@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link:http://amzn.to/2dEadiD
-- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l. Please contact support@xxxxxxxxxxxx for any subscription related questions. Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD
-- This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l. Please contact support@xxxxxxxxxxxx for any subscription related questions. Help support midrange.com by shopping at amazon.com with our affiliate link: http://amzn.to/2dEadiD



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.