I have a library function used to convert an integer date (CYYMMDD) to an EGL Date. In some cases the seven digit date does not exist and therefore has a zero value. In the conversion function, I check for a zero value and then try to return a null date. However, instead of the null date being returned, I get the current date returned. Is there something I'm doing wrong.
I've cut the code down to the essence of what happens below. The library, a test program that uses the library, and the result returned from the library function to the test program.
Library Code: package com.busapp.wb.svc.lib; library SynonDateConversionLib type BasicLibrary{} function Convert(cyymmddDate int in) returns(date) mmddyyyyDate date?; defaultDateFormat = "MM/dd/yyyy"; mmddyyyyDate = null; return(mmddyyyyDate); end end
A test program using the library: package com.busapp.wb.svc.pgm; import com.busapp.wb.svc.lib.*; // basic program // program TestDateConversion type BasicProgram {} function main() cyymmddDate int = 0; dateOut date? = SynonDateConversionLib.Convert(cyymmddDate); writeStdOut("dateOut = " :: dateOut); end end
and the result returned to the program: dateOut = 02/11/2012
SystemAdmin