Re: Calling a procedure in a service program that returns a char(6) value

Barbara Morris <[email protected]> Wed, 13 May 2026 19:00:49 -0400
Newsgroups gmane.comp.lang.as400.java
Organization IBM
Message-ID <[email protected]>
On 2026-05-13 2:03 p.m., Luca Giammattei wrote:
> Hi everyone, I'm stuck with what I thought was a small problem but can't
> seem to resolve.
>  From a Java class running on a Windows server, I need to:
> 1. connect to a certain IBM i power server; (done)
> 2. set a specific library list with a given custom command; (done)
> 3. call a service program procedure that returns a char(6) value. (And here
> I'm stuck.)
> Despite several attempts, the procedure, assuming it's actually executed,
> ...

To check whether the procedure is actually executed, add a bit of code 
to do something to the system that you can check before and after your 
test. Such as update a data area.

    // CRTDTAARA MYLIB/MYDTAARA TYPE(*CHAR) LEN(100)
    dcl-ds dtaara len(100) dtaara('MYLIB/MYDTAARA') qualified;
       msg char(20);
       *n char(1);
       job char(28);
       *n char(1);
       tstamp timestamp;
    end-ds;
    dcl-ds pgmstat psds qualified;
       jobname char(10) pos(244);
       jobuser char(10) pos(254);
       jobnum  char(6) pos(264);
    end-ds;

    in *lock dtaara;
    dtaara.msg = 'I am here';
    dtaara.job = %trim(pgmstat.jobnum) + '/'
               + %trim(pgmstat.jobuser) + '/'
               + %trim(pgmstat.jobname);
    dtaara.tstamp = %timestamp();
    out dtaara;

After your test
    DSPDTAARA MYLIB/MYDTAARA

-- 
Barbara

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