Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2011
    Posts
    9

    Unanswered: DB2 stored procedure in PL/I

    hi,

    I compiled DB2 stored procedure in PL/I 3.7 but I'ts abended on sql code which says that the SP is not proper.
    The DB2 version is 8.

    Do you know which parameters I need to add specially to PL/I compile job like NCAL?

    Thanks in advance,
    Jhon

  2. #2
    Join Date
    Apr 2005
    Location
    USA
    Posts
    130
    Could you please share the error info here to see what went wrong?

  3. #3
    Join Date
    Mar 2011
    Posts
    9

    error message

    Hi,

    the error message that shown on log:
    "DB2MSTR DSNX906I @ DSNX9CAC PROCEDURE OR FUNCTION
    DB2MSTR X.Y TERMINATED ABNORMALLY. THE PROCEDURE OR FUNCTION HAS BEEN STOPPED, ASID = 014A WLM_ENV=Z"

    I have the feeling that the compile's parameters is not good..

  4. #4
    Join Date
    Apr 2005
    Location
    USA
    Posts
    130
    Ya. That's is right. Did you compile and link edit the program using DSNRLI?

  5. #5
    Join Date
    Mar 2011
    Posts
    9
    No but with DSNHLI...

  6. #6
    Join Date
    Apr 2005
    Location
    USA
    Posts
    130
    If you execute the procedure in WLM environment you need to link edit to DSNRLI. BTW, how your procedure is defined?

  7. #7
    Join Date
    Mar 2011
    Posts
    9
    Hi,

    Whats the meaning of how is the procedure defined?

  8. #8
    Join Date
    Apr 2005
    Location
    USA
    Posts
    130
    Procedue definition can be viewed from catalog tables like SYSIBM.SYSROUTINES. Check this table and see how the procedure is defined.

  9. #9
    Join Date
    Mar 2011
    Posts
    9
    It help.. Thanks a lot!

    but now there is a different abend :

    SQLCODE: -805
    SQLERRM:
    X.Y.Z.SP.18F069F3023DF4423.OTHER_PROGRAM_WHICH_RIS E_THE_SP.02
    SQLERRD(3): 0.

    maybe it's the sp's bind package of sp's package? ot the OTHER_PROGRAM_WHICH_RISE_THE_SP plan?
    I understand that I don't need plan for sp.

  10. #10
    Join Date
    Apr 2005
    Location
    USA
    Posts
    130
    If the stored procedure contains SQL statements, you must process them like they are in any other SQL application program through the DB2 pre-compiler or the SQL statement co-processor, and you must bind the resulting DBRM into a package. It does not require a plan since it runs under the thread for the calling application.

  11. #11
    Join Date
    Mar 2011
    Posts
    9
    I did bind package to the SP dbrm but the Call program don't have the SP's package in the plan and it still abend on -805

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •