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




On 22/12/2006, at 9:15 AM, Dan wrote:

Any ideas on how to resolve this would be appreciated!

Let's see:

GENERAL WITH NULLS
All applicable parameters are passed. The parameters are defined to be in the following order: o The first N parameters are the input parameters that are specified on the CREATE FUNCTION statement.
  o An additional argument is passed for an indicator variable array.
  o A parameter for the indicator variable for the result.
Note that the result is returned through as a value of a value returning function.
For example: return_val func(parameter-1, parameter-2, ...)
GENERAL WITH NULLS is only allowed when EXTERNAL NAME identifies a service program.

Your function definition is:

CREATE FUNCTION dandev/TRUEDATE
  (DEC(2,0), DEC(2,0), DEC(2,0), DEC(2,0))
RETURNS DATE
EXTERNAL NAME 'DANDEV/TRUEDATE(TRUEDATE)'
LANGUAGE RPGLE
NO SQL
NOT DETERMINISTIC
NOT FENCED
RETURNS NULL ON NULL INPUT
PARAMETER STYLE GENERAL WITH NULLS

This says the function expects four input parameters, returns a date, and handles null indicators. According to the parameter type description your function must receive 4 input parameters, 1 array of null indicators, and a separate null indicator for the result. Total of 6 parameters.

Your PI is:

     d TrueDate        pi              d
     d  p_CenturyIn                   2p 0
     d  p_YearIn                      2p 0
     d  p_MonthIn                     2p 0
     d  p_DayIn                       2p 0
     d  pni_CenturyIn                 5i 0
     d  pni_YearIn                    5i 0
     d  pni_MonthIn                   5i 0
     d  pni_DayIn                     5i 0
     d  pni_Result                    5i 0

Does that match the description of the parameters? No, it doesn't. You have separate parameters for the null indicators associated with the four input parameters. Thus the last 3 parameters will not be passed and will result in MCH3601 when you attempt to reference them.


Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists

   http://www.flybynight.com.au/
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175                                   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.