Re: Calling an ile rpg service program procedure that returns a value from a java class

cesco via RPG400-L <[email protected]> Fri, 15 May 2026 14:21:18 +0000 (UTC)
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <[email protected]>
No problema... if you want to really go down the AS400 jt400 direct procedural things maybe PCML would provide less clunky a contract via the document call. Still not pretty.
BUT
In case one want or can reconsider the way to access the info, the prototype you posted seems a simple lookup, without side effects, that doesn't requiring precise synchronous semantics or other exoterica.
Staying in the client-server jt400 world nowadays the "beaten path" is via db interface (that you can use it then via multiple languages, odbc etc).
A direct SELECT to retrieve (and much more generic, extensible when you need the full set of attributes...) via view or UDFT can be simpler, testable interactively, quick to evolve etc. and up very fast, the client can project and ask the field needed etc.










On Friday, May 15, 2026 at 02:08:33 PM GMT+2, Luca Giammattei <[email protected]> wrote: 





Il 15/05/2026 11:23, cesco via RPG400-L ha scritto:
> Ciao Luca,
> It's been a lot since I've coded some calls into RPG via jt400 (too clunky), but apparently you cannot return chars, check docs.
> https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_74/rzahh/javadoc/com/ibm/as400/access/ServiceProgramCall.html#setReturnValueFormat(int)
> If you really want to go that way you need to lift the return into a parameter (explicitely or via RTNCODE maybe) or just a wrapper.
> 
> Maybe an idea is to use simple database access to expose such data, i.e. stored procedure that you can reuse than universally (JDBC from java, ODBC etc.).
> 
> ciao
> 

Thx Cesco, really too clunky, almost useless (I mean the service program call class)
-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.

-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.