Stored Procedure calling RPGLE - IBM AS400

This is a discussion on Stored Procedure calling RPGLE - IBM AS400 ; I am having a problem with a stored procedure that calls an RPGLE program. When calling the stored procedure from a PHP or an ODBC connection, the RPG program never executes. When I calling it from IBM iSeries Access or ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Stored Procedure calling RPGLE

  1. Stored Procedure calling RPGLE

    I am having a problem with a stored procedure that calls an RPGLE
    program. When calling the stored procedure from a PHP or an ODBC
    connection, the RPG program never executes. When I calling it from
    IBM iSeries Access or another RPG program, it executes fine. I know
    this because I have the program send me a message with the job
    information when it executes. I don't receive those messages when I
    execute it via PHP or an ODBC connection.

    Below is the code for the stored procedure. I assume the problem is
    in this code or is related to how something is configured. Any help
    (or tips) would be appreciated, because I am pretty much stuck.

    DROP PROCEDURE MYLIB.SP_WEBAUTH;
    CREATE PROCEDURE MYLIB.SP_WEBAUTH (IN var1 CHAR(15),
    IN var2 CHAR(6),
    OUT valid CHAR(1))
    LANGUAGE RPGLE
    PARAMETER STYLE GENERAL
    DYNAMIC RESULT SETS 0
    EXTERNAL NAME 'MYLIB/WEBAUTH'


  2. Re: Stored Procedure calling RPGLE

    On Aug 6, 2:17 pm, Matt wrote:
    > I am having a problem with a stored procedure that calls an RPGLE
    > program. When calling the stored procedure from a PHP or an ODBC
    > connection, the RPG program never executes. When I calling it from
    > IBM iSeries Access or another RPG program, it executes fine. I know
    > this because I have the program send me a message with the job
    > information when it executes. I don't receive those messages when I
    > execute it via PHP or an ODBC connection.
    >
    > Below is the code for the stored procedure. I assume the problem is
    > in this code or is related to how something is configured. Any help
    > (or tips) would be appreciated, because I am pretty much stuck.
    >
    > DROP PROCEDURE MYLIB.SP_WEBAUTH;
    > CREATE PROCEDURE MYLIB.SP_WEBAUTH (IN var1 CHAR(15),
    > IN var2 CHAR(6),
    > OUT valid CHAR(1))
    > LANGUAGE RPGLE
    > PARAMETER STYLE GENERAL
    > DYNAMIC RESULT SETS 0
    > EXTERNAL NAME 'MYLIB/WEBAUTH'


    Sounds like a library issue to me, are you using the same profile to
    do the tests.


  3. Re: Stored Procedure calling RPGLE

    A common problem using the given procedure definition, would be the
    use of CHAR versus VARCHAR. Unless the type is defined by a field or
    bound in a program, the VARCHAR must be used because the SQL will type
    the parameter as VARCHAR. If not, then SQL0204 would be the result.
    Review of the joblog for the failed call request would probably show an
    error message. If that does not resolve, some thoughts:
    Specifically in each case, how was the procedure invoked. What is
    meant by 'send me a message'? A message sent to an external message
    queue would seem to be the best method to verify. What was the SQLcode
    for the SQL CALL? Was the CALL from RPG actually an SQL CALL from
    SQLRPG? If not, then probably best to work from there. The Run SQL
    Scripts where a request to CALL MYLIB.SP_WEBAUTH ('A', 'A', ?) is both
    functional and somewhat simplified as compared with embedded.

    Regards, Chuck
    --
    All comments provided "as is" with no warranties of any kind
    whatsoever and may not represent positions, strategies, nor views of my
    employer

    Matt wrote:
    > I am having a problem with a stored procedure that calls an RPGLE
    > program. When calling the stored procedure from a PHP or an ODBC
    > connection, the RPG program never executes. When I calling it from
    > IBM iSeries Access or another RPG program, it executes fine. I know
    > this because I have the program send me a message with the job
    > information when it executes. I don't receive those messages when I
    > execute it via PHP or an ODBC connection.
    >
    > Below is the code for the stored procedure. I assume the problem is
    > in this code or is related to how something is configured. Any help
    > (or tips) would be appreciated, because I am pretty much stuck.
    >
    > DROP PROCEDURE MYLIB.SP_WEBAUTH;
    > CREATE PROCEDURE MYLIB.SP_WEBAUTH (IN var1 CHAR(15),
    > IN var2 CHAR(6),
    > OUT valid CHAR(1))
    > LANGUAGE RPGLE
    > PARAMETER STYLE GENERAL
    > DYNAMIC RESULT SETS 0
    > EXTERNAL NAME 'MYLIB/WEBAUTH'
    >


  4. Re: Stored Procedure calling RPGLE

    > Sounds like a library issue to me

    I forgot to update this thread, but it was a library issue. Thanks for
    the help.



+ Reply to Thread