IBM i Global

 View Only

 JAVA CALL SRVPGM BY ServiceProgramCall

Xiao Qing Kang's profile image
Xiao Qing Kang posted Mon December 22, 2025 12:14 AM
When calling an SRVPGM program via ServiceProgramCall in Java, the call shows as successful, but I cannot retrieve the output parameters.
Here is the parameter example as follows: after the call, I want to get the return value of input3, but I have failed to do so no matter what I try.
rpgle
     p test            b                   export
     D test            pi              n
     D  input1                        3a   const
     D  input2                       10a   const
     D  input3                       60a
     D rtnFlag         s               n
Note: The return value of input3 can be obtained normally if this SRVPGM is called via a separate PGM program.