× 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.



Michael, I don't know if this has already come through to you but you
are looking at severe performance penalties using a dynamically called
program inside of service program.

IBM originally implemented UDF's as programs but it was too slow and
they added the ability for them to be service programs.

If you use your UDF in an SQL statement and you have to process a
100,000 records, you are looking at 100,000 dynamic calls.

A service program procedure call is nano-seconds vs a 100 milliseconds
for a program call.

All this is why I use straight RPG/ILE code in my iDate to make it as
efficient as possible.

This dynamic program call problem is severe enough for IBM that they are
having to redo Stored Procedure Language implementation to try to get
rid of program calls in V5R4. I just hope it feeds back to RPG.

*-------------------------------------------*
C* Execute JDE Server for Date Conversion *
*-------------------------------------------*
PGetDate B EXPORT
D GetDate PI 8S 0
D FromDate 6A
D ToDate 8A
D FromFormat 7A
D ToFormat 7A
D DateSep 7A
D ErrorFlag 1A
D Century 2A
D RetDate S 8S 0 Inz

C*
C CALL 'X0028 '
C* ----- ----------
C PARM FromDate
C PARM ToDate
C PARM FromFormat
C PARM ToFormat
C PARM DateSep
C PARM ErrorFlag
C PARM Century
C* -----
C MOVE Fromdate RetDate
C MOVEL Century RetDate
C RETURN RetDate
P GetDate E



Created via STRSQL

create function AJDMODS/CVTDATE (CHAR (6), CHAR (8), CHAR (7),
CHAR (7),CHAR (7),CHAR (1),CHAR (2))
returns DEC (8,0)
language rpgle
deterministic
no sql
returns null on null input
allow parallel
simple call
external name 'AJDMODS/CONVERT(GetDate)'



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.