Rocket DevOps (formerly Aldon)

 View Only
  • 1.  SQL User defined function

    Posted 12-01-2021 16:31
    Here are the details: I created the object on my task as an SQL Function as PSEUDO source as required. 
    UTLGUIDD *FUNCTN SQL HZN/BAS D DEVDTAYL.  The source member name is not the same as the UDF name and that was defined.  See Function Name below. I can compile the source with RUNSQLSTM from a command line.  When I attempt to compile within the system, I get an error on the report. I looked in the job log for the error, but there is a lot to sort out.  What am I missing? TIA. 

     ASQFUNCTN FUNCTION(LMIDTAYL/UTLGUIDD) SRCFILE(LMIDTAYL/UTLSRC) SRCMBR(UTLGUIDD)
    CMS2361 30 *FUNCTN UTLGUIDD created, but not in accord with SQL extended attribute.



    Object (specific name) : UTLGUIDD
    Type . . . . . . . . . : *FUNCTN
    Function name . . . . : GETUID
    Release . . . . . . . : RANGE/HORIZON/BASE
    Ext Dta Scan Object ------------------ Source ----------------
    Environment Release Attribute Attr Opt Version Status Library Library File Member Type
    ============== ========== ========== === === ======== ======== ========== ========== ========== ========== ======
    PDN *NOT RES *SAME HZNBASPDN HZNBASPDN UTLSRC UTLGUIDD
    Object library group: 9 ALL OBJECTS AND SOURCE FOR RNGMNTLIB
    Source library group: 9 ALL OBJECTS AND SOURCE FOR RNGMNTLIB
    QUA *NOT RES *SAME HZNBASQUA HZNBASQUA UTLSRC UTLGUIDD
    ITG *NOT RES *SAME HZNBASITG HZNBASITG UTLSRC UTLGUIDD
    DVP DEVDTAYL *SAME SQL SQL PRM 00000000 *NOT CUR LMIDTAYL LMIDTAYL UTLSRC UTLGUIDD Pseudo
    Tasks . . . . . . . . . :
    DAVIDTEST2
    Object text . . . . . . :
    Create command . . . . : ASQFUNCTN FUNCTION(LMIDTAYL/UTLGUIDD) SRCFILE(LMIDTAYL/UTLSRC) SRCMBR(UTLGUIDD)

    *...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....0....+....1....+....2.
    5770SS1 V7R3M0 160422 Run SQL Statements UTLGUIDD 12/01/21 15:15:32
    Record *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 SEQNBR Last change
    1 CREATE OR REPLACE FUNCTION Z_PD6105 /GETUID ( ) RETURNS CHAR(36) LANGUAGE RPGLE
    2 EXTERNAL NAME 'UTLGENS(getGUID)' PARAMETER STYLE GENERAL PROGRAM TYPE SUB ;
    * * * * * E N D O F S O U R C E * * * * *
    5770SS1 V7R3M0 160422 Run SQL Statements UTLGUIDD 12/01/21 15:15:32
    Record *...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 SEQNBR Last change
    MSG ID SEV RECORD TEXT
    SQL7997 0 1 Position 1 Function GETUID was created in Z_PD6105.
    Message Summary
    Total Info Warning Error Severe Terminal
    1 1 0 0 0 0
    00 level severity errors found in source


    ------------------------------
    David Taylor
    Senior Developer
    Range Resources Corporation
    Fort Worth TX US
    ------------------------------

    Attachment(s)

    PDF
    PRTFCREATE.PDF   1 KB 1 version
    PDF
    QPJOBLOG.PDF   90 KB 1 version


  • 2.  RE: SQL User defined function

    ROCKETEER
    Posted 12-02-2021 08:07
    Hi David,

    Thank you for your inquiry.

    The most likely issue is the  function definition in LMi.
    The function is described with an extended attribute of SQL when it is pointing to an EXTERNAL NAME 'UTLGENS(getGUID)'
    To correct:
    16=Change
    Extended attribute . . . EXT

    I also recommend hard-coding the "specific name"...
    LANGUAGE RPGLE
    SPECIFIC UTLGUIDD
    EXTERNAL NAME
    ...

    Please keep us informed of your progress.
    Best regards
    Jay

    ------------------------------
    Jay Mikaiel
    Senior Technical Support Engineer
    Rocket Software
    UK
    ------------------------------



  • 3.  RE: SQL User defined function

    Posted 12-02-2021 08:31
    Many thanks, Jay.  The EXT did the job. 

    1 objects were created.

    ------------------------------
    David Taylor
    Senior Developer
    Range Resources Corporation
    Fort Worth TX US
    ------------------------------



  • 4.  RE: SQL User defined function
    Best Answer

    ROCKETEER
    Posted 12-02-2021 09:41
    Hi David,
    You are most welcome. Thank you for confirming your excellent news.

    Regards

    ------------------------------
    Jay Mikaiel
    Senior Technical Support Engineer
    Rocket Software
    UK
    ------------------------------