Midrange News for the IBM i Community

Posted by: Robert Gilsdorf
Wayne, Michigan
What Am i missing?
has no ratings.
Published: 03 Nov 2011
Revised: 23 Jan 2013 - 1979 days ago
Last viewed on: 24 Jun 2018 (4089 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

What Am i missing? Published by: Robert Gilsdorf on 03 Nov 2011 view comments(5)

I have an SQL function that the system cannot seem to find.

I create the procedure with the following statement:


 CM CHAR(4),                                
 TRAC CHAR(14),                             
 STDATE DECIMAL(8,0),                       
 ENDATE DECIMAL(8,0),                       
 CNTTYP CHAR(2),                            
 STPTYP CHAR(2) )                           
 RETURNS DECIMAL(7,0)                       
 LANGUAGE RPGLE                             
 SPECIFIC RSHPROBJ/ONTIM                    
 NO SQL                                     
 CALLED ON NULL INPUT                       
 NO EXTERNAL ACTION                         




I call it with the following:

SELECT DUMMY1 , ONTIM('01  ', '8640          ', 20111101, 20111102, 'LT', 'AL') FROM dummy                               

and it is not found. I see it with the proper 6 parameters in iSeries navigator


The RPGLE program has the following entries:


    DONTIM            PR
     D* * Input Vars
     D  CM                                 Like(BSCM)
     D  Tractor                            Like(BSTRA)
     D  StDate                        8  0
     D  EnDate                        8  0
     D  CntType                       2A
     D  StpType                            Like(BSSTYP)
.....D* * Return Var
     D  OTCOUNT                       7  0
     D* * Input Vars Null Indicators
     D  CMi                           5I 0
     D  Tri                           5I 0
     D  SDi                           5I 0
     D  EDi                           5I 0
     D  CTi                           5I 0
     D  STi                           5I 0
     D* * Output Var Null Indicator
     D  Rtni                          5I 0
     D* * SQL status Vars
     D  SQLState                      5
     D  SQLFuncName                 139
     D  SQLSpecName                 128
     D  SQLMsg                       70    Varying 




BSCM is 4A

BSTRA is 14A


The module compiles and is in SQLSRVPGM3 and the ONTIM procedure is exported.

Everything seems to agree, but it is not found.

Error is "ONTIM in *LIBL type *N not found." and RSHPROBJ is in my *LIBL

Return to midrangenews.com home page.
Sort Ascend | Descend