× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Thanks Alan. I will take a look when I have a second.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Campin
Sent: Friday, August 02, 2013 11:57 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Creating UDFs

You have two different libraries essentially. Where the definition of
the UDF is stored and where the service program is at. When you do the
CREATE FUNCTION you give it a library, say QGPL and when you specify the
service program you either give it a library where the service program
is or *LIBL.

The reason they do this is so that you could have two different
definitions in two libraries. Say, one test and one production but it
gets confusing.
If you don't give it a library name, it searches the database and finds
the first one. If you are calling a UDF from outside the i you need to
qualify the UDF with the library. Inside the i, normally you do not.

Go to www.think400.dk/downloads.htm and look for iDate. This is a UDF to
converts iSeries type dates (Numeric, Alpha) to true date data
type..There is a writeup that talks about all this.


On Fri, Aug 2, 2013 at 8:39 AM, Gary Thompson <gthompson@xxxxxxxxxxx>
wrote:

Robert,
I'm not sure, but the following SQL may help answer your question.
This is a statement we have used to track local UDF.

Start of sql-----------------------------------------
SELECT CAST(routine_name AS CHAR(15)) AS Name,
CAST(routine_schema AS CHAR(10)) AS Library,
routine_type AS Type,
CAST(routine_definer AS CHAR(10)) AS Created_By,
function_origin AS Origin,
routine_definition AS Source_Code
FROM qsys2/sysroutines
WHERE routine_definer NOT IN ('QSYS', 'QLPINSTALL', 'QDIRSRV')
AND ( ( routine_type = 'FUNCTION' ) AND
(function_origin NOT IN ('B')) OR
(routine_type = 'PROCEDURE')
)
End of sql -----------------------------------------

Output looks something like:


....+....1....+....2....+....3....+....4....+....5....+....6....+....7.
NAME LIBRARY TYPE CREATED_BY ORIGIN
SOURCE_CODE
VRSP900 BASSD PROCEDURE S4 -
QZDGDBLL QIWS PROCEDURE T9 -
BUDSAPSP QGPL PROCEDURE S7 -
RPSP900 QGPL PROCEDURE S4 -
QZDGDNAV QIWS PROCEDURE S9 -
QZDGDTOQ QIWS PROCEDURE GTHOMPSON -
QZDGDSPF QIWS PROCEDURE SY -
CURCYMD SWIRE FUNCTION GTHOMPSON E -
QQQDBVE QIWS PROCEDURE GTHOMPSON -
QZDGDBPM QIWS PROCEDURE GTHOMPSON -
EDITCODE SWIRE FUNCTION GTHOMPSON E -
DAYDIFCYMD SWIRE FUNCTION GTHOMPSON E -

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Robert Mullis
Sent: Friday, August 02, 2013 8:12 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Creating UDFs

I am trying to create my first UDF to use in embedded SQL in an RPGLE
program. I have created the procedure in a service program with no
problem, but I have a question about the UDF. When the UDF is
created, what library is it created in? Also, if the service program
that the UDF uses is moved to another library, what happens to the
UDF? Does it move to the new library with it?



Thanks,

Robert J. Mullis

--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.



--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.