**FREE /COPY *LIBL/QDURATION,RPGMODHDR // heading specification /COPY *LIBL/QDURATION,DURATNPR00 // duration prototypes /COPY *LIBL/QDURATION,DURATNCY00 // duration copybook /COPY *LIBL/QDURATION,DURATNCN00 // duration constants //************************************************************************************************** // convert numeric date to date // input: // (1) numeric date // (2) date format (optional). default is *iso // return data structure: // (1) date data type (initialized to lowest date) // (2) success indicator (initialized to *off) //************************************************************************************************** DCL-PROC $Duratn_CvtDate#ToDate EXPORT; DCL-PI *N LIKEDS(dsDuratn_RetDate); ##D# LIKE(Duratn_FldRef.Date#8) VALUE; ##Fmt LIKE(Duratn_FldRef.DurationFmt) VALUE OPTIONS(*NOPASS); END-PI; DCL-DS dsReturn LIKEDS(dsDuratn_RetDate) INZ(*LIKEDS); IF %PARMS = 2; IF NOT $this_VldDate#Fmt(##Fmt) OR NOT $Duratn_VldDate#(##D#:##Fmt); RETURN dsReturn; // invalid ENDIF; ELSEIF NOT $Duratn_VldDate#(##D#); RETURN dsReturn; // invalid ENDIF; IF %PARMS = 1; dsReturn.Date = %DATE(##D#); ELSEIF ##Fmt = CONST_CDMY; dsReturn.Date = %DATE(##D#:*CDMY); ELSEIF ##Fmt = CONST_CMDY; dsReturn.Date = %DATE(##D#:*CMDY); ELSEIF ##Fmt = CONST_CYMD; dsReturn.Date = %DATE(##D#:*CYMD); ELSEIF ##Fmt = CONST_DMY; dsReturn.Date = %DATE(##D#:*DMY); ELSEIF ##Fmt = CONST_EUR; dsReturn.Date = %DATE(##D#:*EUR); ELSEIF ##Fmt = CONST_ISO; dsReturn.Date = %DATE(##D#:*ISO); ELSEIF ##Fmt = CONST_JIS; dsReturn.Date = %DATE(##D#:*JIS); ELSEIF ##Fmt = CONST_JUL; dsReturn.Date = %DATE(##D#:*JUL); ELSEIF ##Fmt = CONST_LONGJUL; dsReturn.Date = %DATE(##D#:*LONGJUL); ELSEIF ##Fmt = CONST_MDY; dsReturn.Date = %DATE(##D#:*MDY); ELSEIF ##Fmt = CONST_USA; dsReturn.Date = %DATE(##D#:*USA); ELSEIF ##Fmt = CONST_YMD; dsReturn.Date = %DATE(##D#:*YMD); ENDIF; IF dsReturn.Date <> *LOVAL; dsReturn.Success = *ON; ENDIF; RETURN dsReturn; END-PROC; //************************************************************************************************** // convert numeric date to numeric date // input: // (1) numeric date // (2) from date format // (3) to date format // return data structure: // (1) numeric date (initialized to zeroes) // (2) success indicator (initialized to *off) //************************************************************************************************** DCL-PROC $Duratn_CvtDate#ToDate# EXPORT; DCL-PI *N LIKEDS(dsDuratn_RetDate#); ##D# LIKE(Duratn_FldRef.Date#8) VALUE; ##FromFmt LIKE(Duratn_FldRef.DurationFmt) VALUE; ##ToFmt LIKE(Duratn_FldRef.DurationFmt) VALUE; END-PI; DCL-DS dsReturn LIKEDS(dsDuratn_RetDate#) INZ(*LIKEDS); IF NOT $this_VldDate#Fmt(##FromFmt) OR NOT $this_VldDate#Fmt(##ToFmt) OR NOT $Duratn_VldDate#(##D#:##FromFmt); RETURN dsReturn; // invalid ENDIF; IF ##FromFmt = ##ToFmt; dsReturn.Date# = ##D#; ELSEIF ##FromFmt = CONST_CDMY; EXSR $From_CDMY; ELSEIF ##FromFmt = CONST_CMDY; EXSR $From_CMDY; ELSEIF ##FromFmt = CONST_CYMD; EXSR $From_CYMD; ELSEIF ##FromFmt = CONST_DMY; EXSR $From_DMY; ELSEIF ##FromFmt = CONST_EUR; EXSR $From_EUR; ELSEIF ##FromFmt = CONST_ISO; EXSR $From_ISO; ELSEIF ##FromFmt = CONST_JIS; EXSR $From_JIS; ELSEIF ##FromFmt = CONST_JUL; EXSR $From_JUL; ELSEIF ##FromFmt = CONST_LONGJUL; EXSR $From_LONGJUL; ELSEIF ##FromFmt = CONST_MDY; EXSR $From_MDY; ELSEIF ##FromFmt = CONST_USA; EXSR $From_USA; ELSEIF ##FromFmt = CONST_YMD; EXSR $From_YMD; ENDIF; IF dsReturn.Date# <> 0; dsReturn.Success = *ON; ENDIF; RETURN dsReturn; BEGSR $From_CDMY; IF ##ToFmt = CONST_CMDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CDMY):*CMDY0)); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CDMY):*CYMD0)); ELSEIF ##ToFmt = CONST_DMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CDMY):*DMY0)); ELSEIF ##ToFmt = CONST_EUR; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CDMY):*EUR0)); ELSEIF ##ToFmt = CONST_ISO; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CDMY):*ISO0)); ELSEIF ##ToFmt = CONST_JIS; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CDMY):*JIS0)); ELSEIF ##ToFmt = CONST_JUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CDMY):*JUL0)); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CDMY):*LONGJUL0)); ELSEIF ##ToFmt = CONST_MDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CDMY):*MDY0)); ELSEIF ##ToFmt = CONST_USA; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CDMY):*USA0)); ELSEIF ##ToFmt = CONST_YMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CDMY):*YMD0)); ENDIF; ENDSR; BEGSR $From_CMDY; IF ##ToFmt = CONST_CDMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CMDY):*CDMY0)); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CMDY):*CYMD0)); ELSEIF ##ToFmt = CONST_DMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CMDY):*DMY0)); ELSEIF ##ToFmt = CONST_EUR; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CMDY):*EUR0)); ELSEIF ##ToFmt = CONST_ISO; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CMDY):*ISO0)); ELSEIF ##ToFmt = CONST_JIS; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CMDY):*JIS0)); ELSEIF ##ToFmt = CONST_JUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CMDY):*JUL0)); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CMDY):*LONGJUL0)); ELSEIF ##ToFmt = CONST_MDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CMDY):*MDY0)); ELSEIF ##ToFmt = CONST_USA; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CMDY):*USA0)); ELSEIF ##ToFmt = CONST_YMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CMDY):*YMD0)); ENDIF; ENDSR; BEGSR $From_CYMD; IF ##ToFmt = CONST_CDMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CYMD):*CDMY0)); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CYMD):*CMDY0)); ELSEIF ##ToFmt = CONST_DMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CYMD):*DMY0)); ELSEIF ##ToFmt = CONST_EUR; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CYMD):*EUR0)); ELSEIF ##ToFmt = CONST_ISO; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CYMD):*ISO0)); ELSEIF ##ToFmt = CONST_JIS; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CYMD):*JIS0)); ELSEIF ##ToFmt = CONST_JUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CYMD):*JUL0)); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CYMD):*LONGJUL0)); ELSEIF ##ToFmt = CONST_MDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CYMD):*MDY0)); ELSEIF ##ToFmt = CONST_USA; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CYMD):*USA0)); ELSEIF ##ToFmt = CONST_YMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*CYMD):*YMD0)); ENDIF; ENDSR; BEGSR $From_DMY; IF ##ToFmt = CONST_CDMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*DMY):*CDMY0)); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*DMY):*CMDY0)); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*DMY):*CYMD0)); ELSEIF ##ToFmt = CONST_EUR; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*DMY):*EUR0)); ELSEIF ##ToFmt = CONST_ISO; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*DMY):*ISO0)); ELSEIF ##ToFmt = CONST_JIS; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*DMY):*JIS0)); ELSEIF ##ToFmt = CONST_JUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*DMY):*JUL0)); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*DMY):*LONGJUL0)); ELSEIF ##ToFmt = CONST_MDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*DMY):*MDY0)); ELSEIF ##ToFmt = CONST_USA; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*DMY):*USA0)); ELSEIF ##ToFmt = CONST_YMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*DMY):*YMD0)); ENDIF; ENDSR; BEGSR $From_EUR; IF ##ToFmt = CONST_CDMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*EUR):*CDMY0)); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*EUR):*CMDY0)); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*EUR):*CYMD0)); ELSEIF ##ToFmt = CONST_DMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*EUR):*DMY0)); ELSEIF ##ToFmt = CONST_ISO; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*EUR):*ISO0)); ELSEIF ##ToFmt = CONST_JIS; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*EUR):*JIS0)); ELSEIF ##ToFmt = CONST_JUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*EUR):*JUL0)); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*EUR):*LONGJUL0)); ELSEIF ##ToFmt = CONST_MDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*EUR):*MDY0)); ELSEIF ##ToFmt = CONST_USA; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*EUR):*USA0)); ELSEIF ##ToFmt = CONST_YMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*EUR):*YMD0)); ENDIF; ENDSR; BEGSR $From_ISO; IF ##ToFmt = CONST_CDMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*ISO):*CDMY0)); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*ISO):*CMDY0)); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*ISO):*CYMD0)); ELSEIF ##ToFmt = CONST_DMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*ISO):*DMY0)); ELSEIF ##ToFmt = CONST_EUR; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*ISO):*EUR0)); ELSEIF ##ToFmt = CONST_JIS; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*ISO):*JIS0)); ELSEIF ##ToFmt = CONST_JUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*ISO):*JUL0)); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*ISO):*LONGJUL0)); ELSEIF ##ToFmt = CONST_MDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*ISO):*MDY0)); ELSEIF ##ToFmt = CONST_USA; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*ISO):*USA0)); ELSEIF ##ToFmt = CONST_YMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*ISO):*YMD0)); ENDIF; ENDSR; BEGSR $From_JIS; IF ##ToFmt = CONST_CDMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JIS):*CDMY0)); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JIS):*CMDY0)); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JIS):*CYMD0)); ELSEIF ##ToFmt = CONST_DMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JIS):*DMY0)); ELSEIF ##ToFmt = CONST_EUR; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JIS):*EUR0)); ELSEIF ##ToFmt = CONST_ISO; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JIS):*ISO0)); ELSEIF ##ToFmt = CONST_JUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JIS):*JUL0)); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JIS):*LONGJUL0)); ELSEIF ##ToFmt = CONST_MDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JIS):*MDY0)); ELSEIF ##ToFmt = CONST_USA; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JIS):*USA0)); ELSEIF ##ToFmt = CONST_YMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JIS):*YMD0)); ENDIF; ENDSR; BEGSR $From_JUL; IF ##ToFmt = CONST_CDMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JUL):*CDMY0)); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JUL):*CMDY0)); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JUL):*CYMD0)); ELSEIF ##ToFmt = CONST_DMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JUL):*DMY0)); ELSEIF ##ToFmt = CONST_EUR; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JUL):*EUR0)); ELSEIF ##ToFmt = CONST_ISO; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JUL):*ISO0)); ELSEIF ##ToFmt = CONST_JIS; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JUL):*JIS0)); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JUL):*LONGJUL0)); ELSEIF ##ToFmt = CONST_MDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JUL):*MDY0)); ELSEIF ##ToFmt = CONST_USA; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JUL):*USA0)); ELSEIF ##ToFmt = CONST_YMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*JUL):*YMD0)); ENDIF; ENDSR; BEGSR $From_LONGJUL; IF ##ToFmt = CONST_CDMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*LONGJUL):*CDMY0)); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*LONGJUL):*CMDY0)); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*LONGJUL):*CYMD0)); ELSEIF ##ToFmt = CONST_DMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*LONGJUL):*DMY0)); ELSEIF ##ToFmt = CONST_EUR; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*LONGJUL):*EUR0)); ELSEIF ##ToFmt = CONST_ISO; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*LONGJUL):*ISO0)); ELSEIF ##ToFmt = CONST_JIS; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*LONGJUL):*JIS0)); ELSEIF ##ToFmt = CONST_JUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*LONGJUL):*JUL0)); ELSEIF ##ToFmt = CONST_MDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*LONGJUL):*MDY0)); ELSEIF ##ToFmt = CONST_USA; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*LONGJUL):*USA0)); ELSEIF ##ToFmt = CONST_YMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*LONGJUL):*YMD0)); ENDIF; ENDSR; BEGSR $From_MDY; IF ##ToFmt = CONST_CDMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*MDY):*CDMY0)); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*MDY):*CMDY0)); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*MDY):*CYMD0)); ELSEIF ##ToFmt = CONST_DMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*MDY):*DMY0)); ELSEIF ##ToFmt = CONST_EUR; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*MDY):*EUR0)); ELSEIF ##ToFmt = CONST_ISO; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*MDY):*ISO0)); ELSEIF ##ToFmt = CONST_JIS; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*MDY):*JIS0)); ELSEIF ##ToFmt = CONST_JUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*MDY):*JUL0)); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*MDY):*LONGJUL0)); ELSEIF ##ToFmt = CONST_USA; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*MDY):*USA0)); ELSEIF ##ToFmt = CONST_YMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*MDY):*YMD0)); ENDIF; ENDSR; BEGSR $From_USA; IF ##ToFmt = CONST_CDMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*USA):*CDMY0)); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*USA):*CMDY0)); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*USA):*CYMD0)); ELSEIF ##ToFmt = CONST_DMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*USA):*DMY0)); ELSEIF ##ToFmt = CONST_EUR; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*USA):*EUR0)); ELSEIF ##ToFmt = CONST_ISO; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*USA):*ISO0)); ELSEIF ##ToFmt = CONST_JIS; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*USA):*JIS0)); ELSEIF ##ToFmt = CONST_JUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*USA):*JUL0)); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*USA):*LONGJUL0)); ELSEIF ##ToFmt = CONST_MDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*USA):*MDY0)); ELSEIF ##ToFmt = CONST_YMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*USA):*YMD0)); ENDIF; ENDSR; BEGSR $From_YMD; IF ##ToFmt = CONST_CDMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*YMD):*CDMY0)); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*YMD):*CMDY0)); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*YMD):*CYMD0)); ELSEIF ##ToFmt = CONST_DMY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*YMD):*DMY0)); ELSEIF ##ToFmt = CONST_EUR; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*YMD):*EUR0)); ELSEIF ##ToFmt = CONST_ISO; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*YMD):*ISO0)); ELSEIF ##ToFmt = CONST_JIS; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*YMD):*JIS0)); ELSEIF ##ToFmt = CONST_JUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*YMD):*JUL0)); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*YMD):*LONGJUL0)); ELSEIF ##ToFmt = CONST_MDY; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*YMD):*MDY0)); ELSEIF ##ToFmt = CONST_USA; dsReturn.Date# = %UNS(%CHAR(%DATE(##D#:*YMD):*USA0)); ENDIF; ENDSR; END-PROC; //************************************************************************************************** // convert numeric date to character date // input: // (1) numeric date // (2) from date format // (3) to date format // return data structure: // (1) character date (initialized to blanks) // (2) success indicator (initialized to *off) //************************************************************************************************** DCL-PROC $Duratn_CvtDate#ToDateChr EXPORT; DCL-PI *N LIKEDS(dsDuratn_RetDateChr); ##D# LIKE(Duratn_FldRef.Date#8) VALUE; ##FromFmt LIKE(Duratn_FldRef.DurationFmt) VALUE; ##ToFmt LIKE(Duratn_FldRef.DurationFmt) VALUE; END-PI; DCL-DS dsReturn LIKEDS(dsDuratn_RetDateChr) INZ(*LIKEDS); IF NOT $this_VldDate#Fmt(##FromFmt) OR NOT $this_VldDateChrFmt(##ToFmt) OR NOT $Duratn_VldDate#(##D#:##FromFmt); RETURN dsReturn; // invalid ENDIF; IF ##FromFmt = CONST_CDMY; EXSR $From_CDMY; ELSEIF ##FromFmt = CONST_CMDY; EXSR $From_CMDY; ELSEIF ##FromFmt = CONST_CYMD; EXSR $From_CYMD; ELSEIF ##FromFmt = CONST_DMY; EXSR $From_DMY; ELSEIF ##FromFmt = CONST_EUR; EXSR $From_EUR; ELSEIF ##FromFmt = CONST_ISO; EXSR $From_ISO; ELSEIF ##FromFmt = CONST_JIS; EXSR $From_JIS; ELSEIF ##FromFmt = CONST_JUL; EXSR $From_JUL; ELSEIF ##FromFmt = CONST_LONGJUL; EXSR $From_LONGJUL; ELSEIF ##FromFmt = CONST_MDY; EXSR $From_MDY; ELSEIF ##FromFmt = CONST_USA; EXSR $From_USA; ELSEIF ##FromFmt = CONST_YMD; EXSR $From_YMD; ENDIF; IF dsReturn.DateChr <> *BLANKS; dsReturn.Success = *ON; ENDIF; RETURN dsReturn; BEGSR $From_CDMY; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CDMY):*YMD/); ENDIF; ENDSR; BEGSR $From_CMDY; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CMDY):*YMD/); ENDIF; ENDSR; BEGSR $From_CYMD; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*CYMD):*YMD/); ENDIF; ENDSR; BEGSR $From_DMY; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*DMY):*YMD/); ENDIF; ENDSR; BEGSR $From_EUR; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*EUR):*YMD/); ENDIF; ENDSR; BEGSR $From_ISO; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*ISO):*YMD/); ENDIF; ENDSR; BEGSR $From_JIS; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JIS):*YMD/); ENDIF; ENDSR; BEGSR $From_JUL; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*JUL):*YMD/); ENDIF; ENDSR; BEGSR $From_LONGJUL; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*LONGJUL):*YMD/); ENDIF; ENDSR; BEGSR $From_MDY; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*MDY):*YMD/); ENDIF; ENDSR; BEGSR $From_USA; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*USA):*YMD/); ENDIF; ENDSR; BEGSR $From_YMD; IF ##ToFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CDMY); ELSEIF ##ToFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CDMY0); ELSEIF ##ToFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CDMY&); ELSEIF ##ToFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CDMY,); ELSEIF ##ToFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CDMY-); ELSEIF ##ToFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CDMY.); ELSEIF ##ToFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CDMY/); ELSEIF ##ToFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CMDY); ELSEIF ##ToFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CMDY0); ELSEIF ##ToFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CMDY&); ELSEIF ##ToFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CMDY,); ELSEIF ##ToFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CMDY-); ELSEIF ##ToFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CMDY.); ELSEIF ##ToFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CMDY/); ELSEIF ##ToFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CYMD); ELSEIF ##ToFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CYMD0); ELSEIF ##ToFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CYMD&); ELSEIF ##ToFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CYMD,); ELSEIF ##ToFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CYMD-); ELSEIF ##ToFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CYMD.); ELSEIF ##ToFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*CYMD/); ELSEIF ##ToFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*DMY); ELSEIF ##ToFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*DMY0); ELSEIF ##ToFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*DMY&); ELSEIF ##ToFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*DMY,); ELSEIF ##ToFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*DMY-); ELSEIF ##ToFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*DMY.); ELSEIF ##ToFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*DMY/); ELSEIF ##ToFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*EUR); ELSEIF ##ToFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*EUR0); ELSEIF ##ToFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*EUR.); ELSEIF ##ToFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*ISO); ELSEIF ##ToFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*ISO0); ELSEIF ##ToFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*ISO-); ELSEIF ##ToFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*JIS); ELSEIF ##ToFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*JIS0); ELSEIF ##ToFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*JIS-); ELSEIF ##ToFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*JUL); ELSEIF ##ToFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*JUL0); ELSEIF ##ToFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*JUL&); ELSEIF ##ToFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*JUL,); ELSEIF ##ToFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*JUL-); ELSEIF ##ToFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*JUL.); ELSEIF ##ToFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*JUL/); ELSEIF ##ToFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*LONGJUL); ELSEIF ##ToFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*LONGJUL0); ELSEIF ##ToFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*LONGJUL&); ELSEIF ##ToFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*LONGJUL,); ELSEIF ##ToFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*LONGJUL-); ELSEIF ##ToFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*LONGJUL.); ELSEIF ##ToFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*LONGJUL/); ELSEIF ##ToFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*MDY); ELSEIF ##ToFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*MDY0); ELSEIF ##ToFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*MDY&); ELSEIF ##ToFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*MDY,); ELSEIF ##ToFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*MDY-); ELSEIF ##ToFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*MDY.); ELSEIF ##ToFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*MDY/); ELSEIF ##ToFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*USA); ELSEIF ##ToFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*USA0); ELSEIF ##ToFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*USA/); ELSEIF ##ToFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*YMD); ELSEIF ##ToFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*YMD0); ELSEIF ##ToFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*YMD&); ELSEIF ##ToFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*YMD,); ELSEIF ##ToFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*YMD-); ELSEIF ##ToFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*YMD.); ELSEIF ##ToFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##D#:*YMD):*YMD/); ENDIF; ENDSR; END-PROC; //************************************************************************************************** // convert character date to date // input: // (1) character date // (2) date format // return data structure: // (1) date data type (initialized to lowest date) // (2) success indicator (initialized to *off) //************************************************************************************************** DCL-PROC $Duratn_CvtDateChrToDate EXPORT; DCL-PI *N LIKEDS(dsDuratn_RetDate); ##DChr LIKE(Duratn_FldRef.DateChr) VALUE; ##Fmt LIKE(Duratn_FldRef.DurationFmt) VALUE OPTIONS(*NOPASS); END-PI; DCL-DS dsReturn LIKEDS(dsDuratn_RetDate) INZ(*LIKEDS); IF %PARMS = 2; IF NOT $this_VldDateChrFmt(##Fmt) OR NOT $Duratn_VldDateChr(##DChr:##Fmt); RETURN dsReturn; // invalid ENDIF; ELSEIF NOT $Duratn_VldDateChr(##DChr); RETURN dsReturn; // invalid ENDIF; IF %PARMS = 1; dsReturn.Date = %DATE(##DChr:*ISO); ELSEIF ##Fmt = CONST_CDMY; dsReturn.Date = %DATE(##DChr:*CDMY); ELSEIF ##Fmt = CONST_CDMY0; dsReturn.Date = %DATE(##DChr:*CDMY0); ELSEIF ##Fmt = CONST_CDMYAmpersand; dsReturn.Date = %DATE(##DChr:*CDMY&); ELSEIF ##Fmt = CONST_CDMYComma; dsReturn.Date = %DATE(##DChr:*CDMY,); ELSEIF ##Fmt = CONST_CDMYDash; dsReturn.Date = %DATE(##DChr:*CDMY-); ELSEIF ##Fmt = CONST_CDMYPeriod; dsReturn.Date = %DATE(##DChr:*CDMY.); ELSEIF ##Fmt = CONST_CDMYSlash; dsReturn.Date = %DATE(##DChr:*CDMY/); ELSEIF ##Fmt = CONST_CMDY; dsReturn.Date = %DATE(##DChr:*CMDY); ELSEIF ##Fmt = CONST_CMDY0; dsReturn.Date = %DATE(##DChr:*CMDY0); ELSEIF ##Fmt = CONST_CMDYAmpersand; dsReturn.Date = %DATE(##DChr:*CMDY&); ELSEIF ##Fmt = CONST_CMDYComma; dsReturn.Date = %DATE(##DChr:*CMDY,); ELSEIF ##Fmt = CONST_CMDYDash; dsReturn.Date = %DATE(##DChr:*CMDY-); ELSEIF ##Fmt = CONST_CMDYPeriod; dsReturn.Date = %DATE(##DChr:*CMDY.); ELSEIF ##Fmt = CONST_CMDYSlash; dsReturn.Date = %DATE(##DChr:*CMDY/); ELSEIF ##Fmt = CONST_CYMD; dsReturn.Date = %DATE(##DChr:*CYMD); ELSEIF ##Fmt = CONST_CYMD0; dsReturn.Date = %DATE(##DChr:*CYMD0); ELSEIF ##Fmt = CONST_CYMDAmpersand; dsReturn.Date = %DATE(##DChr:*CYMD&); ELSEIF ##Fmt = CONST_CYMDComma; dsReturn.Date = %DATE(##DChr:*CYMD,); ELSEIF ##Fmt = CONST_CYMDDash; dsReturn.Date = %DATE(##DChr:*CYMD-); ELSEIF ##Fmt = CONST_CYMDPeriod; dsReturn.Date = %DATE(##DChr:*CYMD.); ELSEIF ##Fmt = CONST_CYMDSlash; dsReturn.Date = %DATE(##DChr:*CYMD/); ELSEIF ##Fmt = CONST_DMY; dsReturn.Date = %DATE(##DChr:*DMY); ELSEIF ##Fmt = CONST_DMY0; dsReturn.Date = %DATE(##DChr:*DMY0); ELSEIF ##Fmt = CONST_DMYAmpersand; dsReturn.Date = %DATE(##DChr:*DMY&); ELSEIF ##Fmt = CONST_DMYComma; dsReturn.Date = %DATE(##DChr:*DMY,); ELSEIF ##Fmt = CONST_DMYDash; dsReturn.Date = %DATE(##DChr:*DMY-); ELSEIF ##Fmt = CONST_DMYPeriod; dsReturn.Date = %DATE(##DChr:*DMY.); ELSEIF ##Fmt = CONST_DMYSlash; dsReturn.Date = %DATE(##DChr:*DMY/); ELSEIF ##Fmt = CONST_EUR; dsReturn.Date = %DATE(##DChr:*EUR); ELSEIF ##Fmt = CONST_EUR0; dsReturn.Date = %DATE(##DChr:*EUR0); ELSEIF ##Fmt = CONST_EURPeriod; dsReturn.Date = %DATE(##DChr:*EUR.); ELSEIF ##Fmt = CONST_ISO; dsReturn.Date = %DATE(##DChr:*ISO); ELSEIF ##Fmt = CONST_ISO0; dsReturn.Date = %DATE(##DChr:*ISO0); ELSEIF ##Fmt = CONST_ISODash; dsReturn.Date = %DATE(##DChr:*ISO-); ELSEIF ##Fmt = CONST_JIS; dsReturn.Date = %DATE(##DChr:*JIS); ELSEIF ##Fmt = CONST_JIS0; dsReturn.Date = %DATE(##DChr:*JIS0); ELSEIF ##Fmt = CONST_JISDash; dsReturn.Date = %DATE(##DChr:*JIS-); ELSEIF ##Fmt = CONST_JUL; dsReturn.Date = %DATE(##DChr:*JUL); ELSEIF ##Fmt = CONST_JUL0; dsReturn.Date = %DATE(##DChr:*JUL0); ELSEIF ##Fmt = CONST_JULAmpersand; dsReturn.Date = %DATE(##DChr:*JUL&); ELSEIF ##Fmt = CONST_JULComma; dsReturn.Date = %DATE(##DChr:*JUL,); ELSEIF ##Fmt = CONST_JULDash; dsReturn.Date = %DATE(##DChr:*JUL-); ELSEIF ##Fmt = CONST_JULPeriod; dsReturn.Date = %DATE(##DChr:*JUL.); ELSEIF ##Fmt = CONST_JULSlash; dsReturn.Date = %DATE(##DChr:*JUL/); ELSEIF ##Fmt = CONST_LONGJUL; dsReturn.Date = %DATE(##DChr:*LONGJUL); ELSEIF ##Fmt = CONST_LONGJUL0; dsReturn.Date = %DATE(##DChr:*LONGJUL0); ELSEIF ##Fmt = CONST_LONGJULAmpersand; dsReturn.Date = %DATE(##DChr:*LONGJUL&); ELSEIF ##Fmt = CONST_LONGJULComma; dsReturn.Date = %DATE(##DChr:*LONGJUL,); ELSEIF ##Fmt = CONST_LONGJULDash; dsReturn.Date = %DATE(##DChr:*LONGJUL-); ELSEIF ##Fmt = CONST_LONGJULPeriod; dsReturn.Date = %DATE(##DChr:*LONGJUL.); ELSEIF ##Fmt = CONST_LONGJULSlash; dsReturn.Date = %DATE(##DChr:*LONGJUL/); ELSEIF ##Fmt = CONST_MDY; dsReturn.Date = %DATE(##DChr:*MDY); ELSEIF ##Fmt = CONST_MDY0; dsReturn.Date = %DATE(##DChr:*MDY0); ELSEIF ##Fmt = CONST_MDYAmpersand; dsReturn.Date = %DATE(##DChr:*MDY&); ELSEIF ##Fmt = CONST_MDYComma; dsReturn.Date = %DATE(##DChr:*MDY,); ELSEIF ##Fmt = CONST_MDYDash; dsReturn.Date = %DATE(##DChr:*MDY-); ELSEIF ##Fmt = CONST_MDYPeriod; dsReturn.Date = %DATE(##DChr:*MDY.); ELSEIF ##Fmt = CONST_MDYSlash; dsReturn.Date = %DATE(##DChr:*MDY/); ELSEIF ##Fmt = CONST_USA; dsReturn.Date = %DATE(##DChr:*USA); ELSEIF ##Fmt = CONST_USA0; dsReturn.Date = %DATE(##DChr:*USA0); ELSEIF ##Fmt = CONST_USASlash; dsReturn.Date = %DATE(##DChr:*USA/); ELSEIF ##Fmt = CONST_YMD; dsReturn.Date = %DATE(##DChr:*YMD); ELSEIF ##Fmt = CONST_YMD0; dsReturn.Date = %DATE(##DChr:*YMD0); ELSEIF ##Fmt = CONST_YMDAmpersand; dsReturn.Date = %DATE(##DChr:*YMD&); ELSEIF ##Fmt = CONST_YMDComma; dsReturn.Date = %DATE(##DChr:*YMD,); ELSEIF ##Fmt = CONST_YMDDash; dsReturn.Date = %DATE(##DChr:*YMD-); ELSEIF ##Fmt = CONST_YMDPeriod; dsReturn.Date = %DATE(##DChr:*YMD.); ELSEIF ##Fmt = CONST_YMDSlash; dsReturn.Date = %DATE(##DChr:*YMD/); ENDIF; IF dsReturn.Date <> *LOVAL; dsReturn.Success = *ON; ENDIF; RETURN dsReturn; END-PROC; //************************************************************************************************** // convert character date to numeric date //************************************************************************************************** DCL-PROC $Duratn_CvtDateChrToDate# EXPORT; DCL-PI *N LIKEDS(dsDuratn_RetDate#); ##DChr LIKE(Duratn_FldRef.DateChr) VALUE; ##FromFmt LIKE(Duratn_FldRef.DurationFmt) VALUE; ##ToFmt LIKE(Duratn_FldRef.DurationFmt) VALUE; END-PI; DCL-DS dsReturn LIKEDS(dsDuratn_RetDate#) INZ(*LIKEDS); IF NOT $this_VldDateChrFmt(##FromFmt) OR NOT $this_VldDate#Fmt(##ToFmt) OR NOT $Duratn_VldDateChr(##DChr:##FromFmt); RETURN dsReturn; // invalid ENDIF; IF ##ToFmt = CONST_CDMY; EXSR $To_CDMY; ELSEIF ##ToFmt = CONST_CMDY; EXSR $To_CMDY; ELSEIF ##ToFmt = CONST_CYMD; EXSR $To_CYMD; ELSEIF ##ToFmt = CONST_DMY; EXSR $To_DMY; ELSEIF ##ToFmt = CONST_EUR; EXSR $To_EUR; ELSEIF ##ToFmt = CONST_ISO; EXSR $To_ISO; ELSEIF ##ToFmt = CONST_JIS; EXSR $To_JIS; ELSEIF ##ToFmt = CONST_JUL; EXSR $To_JUL; ELSEIF ##ToFmt = CONST_LONGJUL; EXSR $To_LONGJUL; ELSEIF ##ToFmt = CONST_MDY; EXSR $To_MDY; ELSEIF ##ToFmt = CONST_USA; EXSR $To_USA; ELSEIF ##ToFmt = CONST_YMD; EXSR $To_YMD; ENDIF; IF dsReturn.Date# <> 0; dsReturn.Success = *ON; ENDIF; RETURN dsReturn; BEGSR $To_CDMY; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*CDMY0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*CDMY0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*CDMY0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*CDMY0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*CDMY0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*CDMY0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*CDMY0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*CDMY0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*CDMY0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*CDMY0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*CDMY0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*CDMY0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*CDMY0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*CDMY0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*CDMY0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*CDMY0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*CDMY0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*CDMY0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*CDMY0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*CDMY0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*CDMY0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*CDMY0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*CDMY0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*CDMY0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*CDMY0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*CDMY0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*CDMY0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*CDMY0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*CDMY0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*CDMY0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*CDMY0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*CDMY0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*CDMY0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*CDMY0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*CDMY0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*CDMY0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*CDMY0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*CDMY0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*CDMY0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*CDMY0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*CDMY0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*CDMY0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*CDMY0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*CDMY0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*CDMY0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*CDMY0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*CDMY0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*CDMY0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*CDMY0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*CDMY0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*CDMY0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*CDMY0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*CDMY0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*CDMY0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*CDMY0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*CDMY0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*CDMY0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*CDMY0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*CDMY0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*CDMY0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*CDMY0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*CDMY0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*CDMY0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*CDMY0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*CDMY0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*CDMY0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*CDMY0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*CDMY0)); ENDIF; ENDSR; BEGSR $To_CMDY; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*CMDY0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*CMDY0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*CMDY0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*CMDY0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*CMDY0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*CMDY0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*CMDY0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*CMDY0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*CMDY0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*CMDY0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*CMDY0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*CMDY0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*CMDY0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*CMDY0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*CMDY0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*CMDY0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*CMDY0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*CMDY0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*CMDY0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*CMDY0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*CMDY0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*CMDY0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*CMDY0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*CMDY0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*CMDY0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*CMDY0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*CMDY0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*CMDY0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*CMDY0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*CMDY0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*CMDY0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*CMDY0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*CMDY0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*CMDY0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*CMDY0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*CMDY0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*CMDY0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*CMDY0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*CMDY0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*CMDY0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*CMDY0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*CMDY0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*CMDY0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*CMDY0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*CMDY0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*CMDY0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*CMDY0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*CMDY0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*CMDY0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*CMDY0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*CMDY0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*CMDY0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*CMDY0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*CMDY0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*CMDY0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*CMDY0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*CMDY0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*CMDY0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*CMDY0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*CMDY0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*CMDY0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*CMDY0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*CMDY0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*CMDY0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*CMDY0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*CMDY0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*CMDY0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*CMDY0)); ENDIF; ENDSR; BEGSR $To_CYMD; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*CYMD0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*CYMD0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*CYMD0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*CYMD0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*CYMD0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*CYMD0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*CYMD0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*CYMD0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*CYMD0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*CYMD0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*CYMD0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*CYMD0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*CYMD0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*CYMD0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*CYMD0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*CYMD0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*CYMD0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*CYMD0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*CYMD0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*CYMD0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*CYMD0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*CYMD0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*CYMD0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*CYMD0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*CYMD0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*CYMD0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*CYMD0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*CYMD0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*CYMD0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*CYMD0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*CYMD0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*CYMD0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*CYMD0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*CYMD0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*CYMD0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*CYMD0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*CYMD0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*CYMD0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*CYMD0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*CYMD0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*CYMD0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*CYMD0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*CYMD0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*CYMD0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*CYMD0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*CYMD0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*CYMD0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*CYMD0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*CYMD0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*CYMD0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*CYMD0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*CYMD0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*CYMD0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*CYMD0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*CYMD0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*CYMD0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*CYMD0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*CYMD0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*CYMD0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*CYMD0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*CYMD0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*CYMD0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*CYMD0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*CYMD0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*CYMD0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*CYMD0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*CYMD0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*CYMD0)); ENDIF; ENDSR; BEGSR $To_DMY; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*DMY0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*DMY0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*DMY0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*DMY0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*DMY0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*DMY0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*DMY0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*DMY0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*DMY0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*DMY0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*DMY0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*DMY0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*DMY0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*DMY0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*DMY0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*DMY0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*DMY0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*DMY0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*DMY0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*DMY0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*DMY0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*DMY0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*DMY0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*DMY0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*DMY0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*DMY0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*DMY0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*DMY0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*DMY0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*DMY0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*DMY0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*DMY0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*DMY0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*DMY0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*DMY0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*DMY0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*DMY0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*DMY0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*DMY0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*DMY0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*DMY0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*DMY0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*DMY0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*DMY0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*DMY0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*DMY0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*DMY0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*DMY0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*DMY0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*DMY0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*DMY0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*DMY0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*DMY0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*DMY0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*DMY0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*DMY0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*DMY0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*DMY0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*DMY0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*DMY0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*DMY0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*DMY0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*DMY0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*DMY0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*DMY0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*DMY0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*DMY0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*DMY0)); ENDIF; ENDSR; BEGSR $To_EUR; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*EUR0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*EUR0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*EUR0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*EUR0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*EUR0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*EUR0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*EUR0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*EUR0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*EUR0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*EUR0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*EUR0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*EUR0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*EUR0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*EUR0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*EUR0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*EUR0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*EUR0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*EUR0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*EUR0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*EUR0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*EUR0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*EUR0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*EUR0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*EUR0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*EUR0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*EUR0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*EUR0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*EUR0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*EUR0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*EUR0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*EUR0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*EUR0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*EUR0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*EUR0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*EUR0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*EUR0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*EUR0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*EUR0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*EUR0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*EUR0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*EUR0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*EUR0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*EUR0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*EUR0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*EUR0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*EUR0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*EUR0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*EUR0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*EUR0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*EUR0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*EUR0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*EUR0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*EUR0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*EUR0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*EUR0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*EUR0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*EUR0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*EUR0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*EUR0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*EUR0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*EUR0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*EUR0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*EUR0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*EUR0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*EUR0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*EUR0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*EUR0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*EUR0)); ENDIF; ENDSR; BEGSR $To_ISO; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*ISO0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*ISO0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*ISO0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*ISO0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*ISO0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*ISO0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*ISO0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*ISO0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*ISO0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*ISO0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*ISO0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*ISO0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*ISO0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*ISO0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*ISO0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*ISO0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*ISO0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*ISO0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*ISO0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*ISO0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*ISO0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*ISO0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*ISO0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*ISO0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*ISO0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*ISO0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*ISO0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*ISO0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*ISO0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*ISO0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*ISO0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*ISO0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*ISO0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*ISO0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*ISO0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*ISO0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*ISO0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*ISO0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*ISO0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*ISO0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*ISO0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*ISO0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*ISO0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*ISO0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*ISO0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*ISO0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*ISO0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*ISO0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*ISO0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*ISO0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*ISO0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*ISO0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*ISO0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*ISO0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*ISO0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*ISO0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*ISO0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*ISO0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*ISO0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*ISO0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*ISO0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*ISO0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*ISO0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*ISO0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*ISO0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*ISO0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*ISO0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*ISO0)); ENDIF; ENDSR; BEGSR $To_JIS; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*JIS0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*JIS0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*JIS0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*JIS0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*JIS0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*JIS0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*JIS0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*JIS0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*JIS0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*JIS0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*JIS0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*JIS0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*JIS0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*JIS0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*JIS0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*JIS0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*JIS0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*JIS0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*JIS0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*JIS0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*JIS0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*JIS0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*JIS0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*JIS0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*JIS0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*JIS0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*JIS0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*JIS0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*JIS0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*JIS0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*JIS0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*JIS0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*JIS0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*JIS0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*JIS0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*JIS0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*JIS0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*JIS0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*JIS0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*JIS0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*JIS0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*JIS0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*JIS0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*JIS0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*JIS0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*JIS0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*JIS0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*JIS0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*JIS0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*JIS0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*JIS0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*JIS0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*JIS0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*JIS0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*JIS0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*JIS0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*JIS0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*JIS0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*JIS0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*JIS0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*JIS0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*JIS0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*JIS0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*JIS0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*JIS0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*JIS0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*JIS0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*JIS0)); ENDIF; ENDSR; BEGSR $To_JUL; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*JUL0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*JUL0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*JUL0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*JUL0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*JUL0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*JUL0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*JUL0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*JUL0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*JUL0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*JUL0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*JUL0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*JUL0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*JUL0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*JUL0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*JUL0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*JUL0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*JUL0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*JUL0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*JUL0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*JUL0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*JUL0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*JUL0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*JUL0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*JUL0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*JUL0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*JUL0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*JUL0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*JUL0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*JUL0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*JUL0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*JUL0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*JUL0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*JUL0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*JUL0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*JUL0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*JUL0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*JUL0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*JUL0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*JUL0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*JUL0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*JUL0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*JUL0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*JUL0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*JUL0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*JUL0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*JUL0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*JUL0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*JUL0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*JUL0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*JUL0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*JUL0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*JUL0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*JUL0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*JUL0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*JUL0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*JUL0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*JUL0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*JUL0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*JUL0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*JUL0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*JUL0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*JUL0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*JUL0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*JUL0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*JUL0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*JUL0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*JUL0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*JUL0)); ENDIF; ENDSR; BEGSR $To_LONGJUL; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*LONGJUL0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*LONGJUL0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*LONGJUL0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*LONGJUL0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*LONGJUL0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*LONGJUL0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*LONGJUL0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*LONGJUL0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*LONGJUL0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*LONGJUL0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*LONGJUL0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*LONGJUL0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*LONGJUL0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*LONGJUL0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*LONGJUL0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*LONGJUL0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*LONGJUL0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*LONGJUL0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*LONGJUL0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*LONGJUL0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*LONGJUL0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*LONGJUL0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*LONGJUL0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*LONGJUL0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*LONGJUL0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*LONGJUL0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*LONGJUL0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*LONGJUL0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*LONGJUL0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*LONGJUL0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*LONGJUL0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*LONGJUL0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*LONGJUL0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*LONGJUL0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*LONGJUL0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*LONGJUL0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*LONGJUL0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*LONGJUL0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*LONGJUL0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*LONGJUL0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*LONGJUL0)); ENDIF; ENDSR; BEGSR $To_MDY; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*MDY0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*MDY0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*MDY0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*MDY0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*MDY0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*MDY0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*MDY0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*MDY0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*MDY0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*MDY0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*MDY0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*MDY0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*MDY0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*MDY0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*MDY0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*MDY0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*MDY0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*MDY0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*MDY0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*MDY0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*MDY0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*MDY0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*MDY0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*MDY0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*MDY0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*MDY0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*MDY0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*MDY0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*MDY0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*MDY0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*MDY0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*MDY0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*MDY0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*MDY0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*MDY0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*MDY0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*MDY0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*MDY0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*MDY0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*MDY0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*MDY0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*MDY0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*MDY0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*MDY0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*MDY0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*MDY0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*MDY0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*MDY0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*MDY0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*MDY0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*MDY0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*MDY0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*MDY0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*MDY0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*MDY0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*MDY0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*MDY0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*MDY0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*MDY0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*MDY0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*MDY0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*MDY0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*MDY0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*MDY0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*MDY0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*MDY0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*MDY0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*MDY0)); ENDIF; ENDSR; BEGSR $To_USA; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*USA0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*USA0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*USA0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*USA0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*USA0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*USA0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*USA0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*USA0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*USA0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*USA0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*USA0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*USA0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*USA0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*USA0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*USA0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*USA0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*USA0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*USA0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*USA0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*USA0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*USA0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*USA0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*USA0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*USA0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*USA0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*USA0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*USA0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*USA0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*USA0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*USA0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*USA0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*USA0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*USA0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*USA0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*USA0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*USA0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*USA0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*USA0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*USA0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*USA0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*USA0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*USA0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*USA0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*USA0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*USA0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*USA0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*USA0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*USA0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*USA0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*USA0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*USA0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*USA0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*USA0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*USA0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*USA0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*USA0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*USA0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*USA0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*USA0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*USA0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*USA0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*USA0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*USA0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*USA0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*USA0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*USA0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*USA0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*USA0)); ENDIF; ENDSR; BEGSR $To_YMD; IF ##FromFmt = CONST_CDMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY):*YMD0)); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY0):*YMD0)); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY&):*YMD0)); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY,):*YMD0)); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY-):*YMD0)); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY.):*YMD0)); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CDMY/):*YMD0)); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY):*YMD0)); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY0):*YMD0)); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY&):*YMD0)); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY,):*YMD0)); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY-):*YMD0)); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY.):*YMD0)); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CMDY/):*YMD0)); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD):*YMD0)); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD0):*YMD0)); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD&):*YMD0)); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD,):*YMD0)); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD-):*YMD0)); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD.):*YMD0)); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*CYMD/):*YMD0)); ELSEIF ##FromFmt = CONST_DMY; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY):*YMD0)); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY0):*YMD0)); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY&):*YMD0)); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY,):*YMD0)); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY-):*YMD0)); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY.):*YMD0)); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*DMY/):*YMD0)); ELSEIF ##FromFmt = CONST_EUR; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR):*YMD0)); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR0):*YMD0)); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*EUR.):*YMD0)); ELSEIF ##FromFmt = CONST_ISO; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO):*YMD0)); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO0):*YMD0)); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.Date# = %UNS(%char(%date(##DChr:*ISO-):*YMD0)); ELSEIF ##FromFmt = CONST_JIS; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS):*YMD0)); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS0):*YMD0)); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JIS-):*YMD0)); ELSEIF ##FromFmt = CONST_JUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL):*YMD0)); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL0):*YMD0)); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL&):*YMD0)); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL,):*YMD0)); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL-):*YMD0)); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL.):*YMD0)); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*JUL/):*YMD0)); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL):*YMD0)); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL0):*YMD0)); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL&):*YMD0)); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL,):*YMD0)); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL-):*YMD0)); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL.):*YMD0)); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*LONGJUL/):*YMD0)); ELSEIF ##FromFmt = CONST_MDY; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY):*YMD0)); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY0):*YMD0)); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY&):*YMD0)); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY,):*YMD0)); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY-):*YMD0)); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY.):*YMD0)); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*MDY/):*YMD0)); ELSEIF ##FromFmt = CONST_USA; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA):*YMD0)); ELSEIF ##FromFmt = CONST_USA0; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA0):*YMD0)); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*USA/):*YMD0)); ELSEIF ##FromFmt = CONST_YMD; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD):*YMD0)); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD0):*YMD0)); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD&):*YMD0)); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD,):*YMD0)); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD-):*YMD0)); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD.):*YMD0)); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.Date# = %UNS(%char(%date(##DChr:*YMD/):*YMD0)); ENDIF; ENDSR; END-PROC; //************************************************************************************************** // convert character date to character date //************************************************************************************************** DCL-PROC $Duratn_CvtDateChrToDateChr EXPORT; DCL-PI *N LIKEDS(dsDuratn_RetDateChr); ##DChr LIKE(Duratn_FldRef.DateChr) VALUE; ##FromFmt LIKE(Duratn_FldRef.DurationFmt) VALUE; ##ToFmt LIKE(Duratn_FldRef.DurationFmt) VALUE; END-PI; DCL-DS dsReturn LIKEDS(dsDuratn_RetDateChr) INZ(*LIKEDS); IF NOT $this_VldDateChrFmt(##FromFmt) OR NOT $this_VldDateChrFmt(##ToFmt) OR NOT $Duratn_VldDateChr(##DChr:##FromFmt); RETURN dsReturn; // invalid ENDIF; IF ##FromFmt = ##ToFmt; dsReturn.DateChr = ##DChr; ELSEIF ##ToFmt = CONST_CDMY; EXSR $To_CDMY; ELSEIF ##ToFmt = CONST_CDMY0; EXSR $To_CDMY0; ELSEIF ##ToFmt = CONST_CDMYAMPERSAND; EXSR $To_CDMYAMPERSAND; ELSEIF ##ToFmt = CONST_CDMYCOMMA; EXSR $To_CDMYCOMMA; ELSEIF ##ToFmt = CONST_CDMYDASH; EXSR $To_CDMYDASH; ELSEIF ##ToFmt = CONST_CDMYPERIOD; EXSR $To_CDMYPERIOD; ELSEIF ##ToFmt = CONST_CDMYSLASH; EXSR $To_CDMYSLASH; ELSEIF ##ToFmt = CONST_CMDY; EXSR $To_CMDY; ELSEIF ##ToFmt = CONST_CMDY0; EXSR $To_CMDY0; ELSEIF ##ToFmt = CONST_CMDYAMPERSAND; EXSR $To_CMDYAMPERSAND; ELSEIF ##ToFmt = CONST_CMDYCOMMA; EXSR $To_CMDYCOMMA; ELSEIF ##ToFmt = CONST_CMDYDASH; EXSR $To_CMDYDASH; ELSEIF ##ToFmt = CONST_CMDYPERIOD; EXSR $To_CMDYPERIOD; ELSEIF ##ToFmt = CONST_CMDYSLASH; EXSR $To_CMDYSLASH; ELSEIF ##ToFmt = CONST_CYMD; EXSR $To_CYMD; ELSEIF ##ToFmt = CONST_CYMD0; EXSR $To_CYMD0; ELSEIF ##ToFmt = CONST_CYMDAMPERSAND; EXSR $To_CYMDAMPERSAND; ELSEIF ##ToFmt = CONST_CYMDCOMMA; EXSR $To_CYMDCOMMA; ELSEIF ##ToFmt = CONST_CYMDDASH; EXSR $To_CYMDDASH; ELSEIF ##ToFmt = CONST_CYMDPERIOD; EXSR $To_CYMDPERIOD; ELSEIF ##ToFmt = CONST_CYMDSLASH; EXSR $To_CYMDSLASH; ELSEIF ##ToFmt = CONST_DMY; EXSR $To_DMY; ELSEIF ##ToFmt = CONST_DMY0; EXSR $To_DMY0; ELSEIF ##ToFmt = CONST_DMYAMPERSAND; EXSR $To_DMYAMPERSAND; ELSEIF ##ToFmt = CONST_DMYCOMMA; EXSR $To_DMYCOMMA; ELSEIF ##ToFmt = CONST_DMYDASH; EXSR $To_DMYDASH; ELSEIF ##ToFmt = CONST_DMYPERIOD; EXSR $To_DMYPERIOD; ELSEIF ##ToFmt = CONST_DMYSLASH; EXSR $To_DMYSLASH; ELSEIF ##ToFmt = CONST_EUR; EXSR $To_EUR; ELSEIF ##ToFmt = CONST_EUR0; EXSR $To_EUR0; ELSEIF ##ToFmt = CONST_EURPERIOD; EXSR $To_EURPERIOD; ELSEIF ##ToFmt = CONST_ISO; EXSR $To_ISO; ELSEIF ##ToFmt = CONST_ISO0; EXSR $To_ISO0; ELSEIF ##ToFmt = CONST_ISODASH; EXSR $To_ISODASH; ELSEIF ##ToFmt = CONST_JIS; EXSR $To_JIS; ELSEIF ##ToFmt = CONST_JIS0; EXSR $To_JIS0; ELSEIF ##ToFmt = CONST_JISDASH; EXSR $To_JISDASH; ELSEIF ##ToFmt = CONST_JUL; EXSR $To_JUL; ELSEIF ##ToFmt = CONST_JUL0; EXSR $To_JUL0; ELSEIF ##ToFmt = CONST_JULAMPERSAND; EXSR $To_JULAMPERSAND; ELSEIF ##ToFmt = CONST_JULCOMMA; EXSR $To_JULCOMMA; ELSEIF ##ToFmt = CONST_JULDASH; EXSR $To_JULDASH; ELSEIF ##ToFmt = CONST_JULPERIOD; EXSR $To_JULPERIOD; ELSEIF ##ToFmt = CONST_JULSLASH; EXSR $To_JULSLASH; ELSEIF ##ToFmt = CONST_LONGJUL; EXSR $To_LONGJUL; ELSEIF ##ToFmt = CONST_LONGJUL0; EXSR $To_LONGJUL0; ELSEIF ##ToFmt = CONST_LONGJULAMPERSAND; EXSR $To_LONGJULAMPERSAND; ELSEIF ##ToFmt = CONST_LONGJULCOMMA; EXSR $To_LONGJULCOMMA; ELSEIF ##ToFmt = CONST_LONGJULDASH; EXSR $To_LONGJULDASH; ELSEIF ##ToFmt = CONST_LONGJULPERIOD; EXSR $To_LONGJULPERIOD; ELSEIF ##ToFmt = CONST_LONGJULSLASH; EXSR $To_LONGJULSLASH; ELSEIF ##ToFmt = CONST_MDY; EXSR $To_MDY; ELSEIF ##ToFmt = CONST_MDY0; EXSR $To_MDY0; ELSEIF ##ToFmt = CONST_MDYAMPERSAND; EXSR $To_MDYAMPERSAND; ELSEIF ##ToFmt = CONST_MDYCOMMA; EXSR $To_MDYCOMMA; ELSEIF ##ToFmt = CONST_MDYDASH; EXSR $To_MDYDASH; ELSEIF ##ToFmt = CONST_MDYPERIOD; EXSR $To_MDYPERIOD; ELSEIF ##ToFmt = CONST_MDYSLASH; EXSR $To_MDYSLASH; ELSEIF ##ToFmt = CONST_USA; EXSR $To_USA; ELSEIF ##ToFmt = CONST_USA0; EXSR $To_USA0; ELSEIF ##ToFmt = CONST_USASLASH; EXSR $To_USASLASH; ELSEIF ##ToFmt = CONST_YMD; EXSR $To_YMD; ELSEIF ##ToFmt = CONST_YMD0; EXSR $To_YMD0; ELSEIF ##ToFmt = CONST_YMDAMPERSAND; EXSR $To_YMDAMPERSAND; ELSEIF ##ToFmt = CONST_YMDCOMMA; EXSR $To_YMDCOMMA; ELSEIF ##ToFmt = CONST_YMDDASH; EXSR $To_YMDDASH; ELSEIF ##ToFmt = CONST_YMDPERIOD; EXSR $To_YMDPERIOD; ELSEIF ##ToFmt = CONST_YMDSLASH; EXSR $To_YMDSLASH; ENDIF; IF dsReturn.DateChr <> *BLANKS; dsReturn.Success = *ON; ENDIF; RETURN dsReturn; BEGSR $To_CDMY; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CDMY); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CDMY); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CDMY); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CDMY); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CDMY); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CDMY); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CDMY); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CDMY); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CDMY); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CDMY); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CDMY); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CDMY); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CDMY); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CDMY); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CDMY); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CDMY); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CDMY); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CDMY); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CDMY); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CDMY); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CDMY); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CDMY); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CDMY); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CDMY); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CDMY); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CDMY); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CDMY); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CDMY); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CDMY); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CDMY); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CDMY); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CDMY); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CDMY); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CDMY); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CDMY); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CDMY); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CDMY); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CDMY); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CDMY); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CDMY); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CDMY); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CDMY); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CDMY); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CDMY); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CDMY); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CDMY); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CDMY); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CDMY); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CDMY); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CDMY); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CDMY); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CDMY); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CDMY); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CDMY); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CDMY); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CDMY); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CDMY); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CDMY); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CDMY); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CDMY); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CDMY); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CDMY); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CDMY); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CDMY); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CDMY); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CDMY); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CDMY); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CDMY); ENDIF; ENDSR; BEGSR $To_CDMY0; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CDMY0); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CDMY0); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CDMY0); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CDMY0); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CDMY0); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CDMY0); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CDMY0); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CDMY0); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CDMY0); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CDMY0); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CDMY0); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CDMY0); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CDMY0); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CDMY0); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CDMY0); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CDMY0); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CDMY0); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CDMY0); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CDMY0); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CDMY0); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CDMY0); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CDMY0); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CDMY0); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CDMY0); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CDMY0); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CDMY0); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CDMY0); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CDMY0); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CDMY0); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CDMY0); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CDMY0); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CDMY0); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CDMY0); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CDMY0); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CDMY0); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CDMY0); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CDMY0); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CDMY0); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CDMY0); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CDMY0); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CDMY0); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CDMY0); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CDMY0); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CDMY0); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CDMY0); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CDMY0); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CDMY0); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CDMY0); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CDMY0); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CDMY0); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CDMY0); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CDMY0); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CDMY0); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CDMY0); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CDMY0); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CDMY0); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CDMY0); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CDMY0); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CDMY0); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CDMY0); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CDMY0); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CDMY0); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CDMY0); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CDMY0); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CDMY0); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CDMY0); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CDMY0); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CDMY0); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CDMY0); ENDIF; ENDSR; BEGSR $To_CDMYAmpersand; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CDMY&); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CDMY&); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CDMY&); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CDMY&); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CDMY&); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CDMY&); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CDMY&); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CDMY&); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CDMY&); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CDMY&); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CDMY&); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CDMY&); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CDMY&); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CDMY&); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CDMY&); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CDMY&); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CDMY&); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CDMY&); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CDMY&); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CDMY&); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CDMY&); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CDMY&); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CDMY&); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CDMY&); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CDMY&); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CDMY&); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CDMY&); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CDMY&); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CDMY&); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CDMY&); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CDMY&); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CDMY&); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CDMY&); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CDMY&); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CDMY&); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CDMY&); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CDMY&); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CDMY&); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CDMY&); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CDMY&); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CDMY&); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CDMY&); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CDMY&); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CDMY&); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CDMY&); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CDMY&); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CDMY&); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CDMY&); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CDMY&); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CDMY&); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CDMY&); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CDMY&); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CDMY&); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CDMY&); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CDMY&); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CDMY&); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CDMY&); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CDMY&); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CDMY&); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CDMY&); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CDMY&); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CDMY&); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CDMY&); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CDMY&); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CDMY&); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CDMY&); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CDMY&); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CDMY&); ENDIF; ENDSR; BEGSR $To_CDMYComma; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CDMY,); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CDMY,); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CDMY,); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CDMY,); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CDMY,); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CDMY,); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CDMY,); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CDMY,); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CDMY,); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CDMY,); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CDMY,); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CDMY,); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CDMY,); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CDMY,); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CDMY,); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CDMY,); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CDMY,); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CDMY,); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CDMY,); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CDMY,); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CDMY,); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CDMY,); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CDMY,); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CDMY,); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CDMY,); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CDMY,); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CDMY,); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CDMY,); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CDMY,); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CDMY,); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CDMY,); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CDMY,); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CDMY,); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CDMY,); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CDMY,); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CDMY,); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CDMY,); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CDMY,); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CDMY,); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CDMY,); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CDMY,); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CDMY,); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CDMY,); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CDMY,); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CDMY,); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CDMY,); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CDMY,); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CDMY,); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CDMY,); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CDMY,); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CDMY,); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CDMY,); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CDMY,); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CDMY,); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CDMY,); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CDMY,); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CDMY,); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CDMY,); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CDMY,); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CDMY,); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CDMY,); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CDMY,); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CDMY,); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CDMY,); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CDMY,); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CDMY,); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CDMY,); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CDMY,); ENDIF; ENDSR; BEGSR $To_CDMYDash; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CDMY-); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CDMY-); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CDMY-); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CDMY-); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CDMY-); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CDMY-); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CDMY-); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CDMY-); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CDMY-); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CDMY-); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CDMY-); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CDMY-); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CDMY-); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CDMY-); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CDMY-); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CDMY-); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CDMY-); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CDMY-); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CDMY-); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CDMY-); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CDMY-); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CDMY-); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CDMY-); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CDMY-); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CDMY-); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CDMY-); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CDMY-); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CDMY-); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CDMY-); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CDMY-); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CDMY-); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CDMY-); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CDMY-); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CDMY-); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CDMY-); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CDMY-); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CDMY-); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CDMY-); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CDMY-); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CDMY-); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CDMY-); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CDMY-); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CDMY-); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CDMY-); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CDMY-); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CDMY-); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CDMY-); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CDMY-); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CDMY-); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CDMY-); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CDMY-); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CDMY-); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CDMY-); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CDMY-); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CDMY-); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CDMY-); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CDMY-); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CDMY-); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CDMY-); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CDMY-); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CDMY-); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CDMY-); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CDMY-); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CDMY-); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CDMY-); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CDMY-); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CDMY-); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CDMY-); ENDIF; ENDSR; BEGSR $To_CDMYPeriod; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CDMY.); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CDMY.); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CDMY.); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CDMY.); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CDMY.); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CDMY.); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CDMY.); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CDMY.); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CDMY.); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CDMY.); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CDMY.); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CDMY.); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CDMY.); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CDMY.); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CDMY.); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CDMY.); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CDMY.); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CDMY.); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CDMY.); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CDMY.); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CDMY.); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CDMY.); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CDMY.); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CDMY.); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CDMY.); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CDMY.); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CDMY.); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CDMY.); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CDMY.); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CDMY.); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CDMY.); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CDMY.); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CDMY.); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CDMY.); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CDMY.); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CDMY.); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CDMY.); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CDMY.); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CDMY.); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CDMY.); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CDMY.); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CDMY.); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CDMY.); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CDMY.); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CDMY.); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CDMY.); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CDMY.); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CDMY.); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CDMY.); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CDMY.); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CDMY.); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CDMY.); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CDMY.); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CDMY.); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CDMY.); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CDMY.); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CDMY.); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CDMY.); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CDMY.); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CDMY.); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CDMY.); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CDMY.); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CDMY.); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CDMY.); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CDMY.); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CDMY.); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CDMY.); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CDMY.); ENDIF; ENDSR; BEGSR $To_CDMYSlash; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CDMY/); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CDMY/); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CDMY/); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CDMY/); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CDMY/); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CDMY/); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CDMY/); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CDMY/); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CDMY/); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CDMY/); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CDMY/); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CDMY/); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CDMY/); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CDMY/); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CDMY/); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CDMY/); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CDMY/); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CDMY/); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CDMY/); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CDMY/); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CDMY/); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CDMY/); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CDMY/); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CDMY/); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CDMY/); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CDMY/); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CDMY/); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CDMY/); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CDMY/); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CDMY/); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CDMY/); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CDMY/); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CDMY/); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CDMY/); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CDMY/); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CDMY/); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CDMY/); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CDMY/); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CDMY/); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CDMY/); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CDMY/); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CDMY/); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CDMY/); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CDMY/); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CDMY/); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CDMY/); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CDMY/); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CDMY/); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CDMY/); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CDMY/); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CDMY/); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CDMY/); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CDMY/); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CDMY/); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CDMY/); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CDMY/); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CDMY/); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CDMY/); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CDMY/); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CDMY/); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CDMY/); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CDMY/); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CDMY/); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CDMY/); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CDMY/); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CDMY/); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CDMY/); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CDMY/); ENDIF; ENDSR; BEGSR $To_CMDY; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CMDY); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CMDY); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CMDY); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CMDY); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CMDY); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CMDY); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CMDY); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CMDY); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CMDY); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CMDY); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CMDY); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CMDY); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CMDY); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CMDY); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CMDY); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CMDY); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CMDY); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CMDY); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CMDY); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CMDY); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CMDY); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CMDY); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CMDY); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CMDY); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CMDY); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CMDY); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CMDY); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CMDY); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CMDY); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CMDY); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CMDY); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CMDY); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CMDY); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CMDY); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CMDY); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CMDY); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CMDY); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CMDY); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CMDY); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CMDY); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CMDY); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CMDY); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CMDY); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CMDY); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CMDY); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CMDY); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CMDY); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CMDY); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CMDY); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CMDY); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CMDY); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CMDY); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CMDY); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CMDY); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CMDY); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CMDY); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CMDY); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CMDY); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CMDY); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CMDY); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CMDY); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CMDY); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CMDY); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CMDY); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CMDY); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CMDY); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CMDY); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CMDY); ENDIF; ENDSR; BEGSR $To_CMDY0; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CMDY0); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CMDY0); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CMDY0); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CMDY0); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CMDY0); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CMDY0); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CMDY0); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CMDY0); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CMDY0); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CMDY0); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CMDY0); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CMDY0); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CMDY0); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CMDY0); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CMDY0); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CMDY0); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CMDY0); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CMDY0); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CMDY0); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CMDY0); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CMDY0); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CMDY0); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CMDY0); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CMDY0); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CMDY0); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CMDY0); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CMDY0); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CMDY0); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CMDY0); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CMDY0); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CMDY0); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CMDY0); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CMDY0); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CMDY0); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CMDY0); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CMDY0); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CMDY0); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CMDY0); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CMDY0); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CMDY0); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CMDY0); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CMDY0); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CMDY0); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CMDY0); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CMDY0); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CMDY0); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CMDY0); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CMDY0); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CMDY0); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CMDY0); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CMDY0); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CMDY0); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CMDY0); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CMDY0); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CMDY0); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CMDY0); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CMDY0); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CMDY0); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CMDY0); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CMDY0); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CMDY0); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CMDY0); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CMDY0); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CMDY0); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CMDY0); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CMDY0); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CMDY0); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CMDY0); ENDIF; ENDSR; BEGSR $To_CMDYAmpersand; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CMDY&); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CMDY&); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CMDY&); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CMDY&); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CMDY&); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CMDY&); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CMDY&); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CMDY&); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CMDY&); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CMDY&); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CMDY&); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CMDY&); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CMDY&); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CMDY&); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CMDY&); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CMDY&); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CMDY&); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CMDY&); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CMDY&); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CMDY&); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CMDY&); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CMDY&); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CMDY&); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CMDY&); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CMDY&); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CMDY&); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CMDY&); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CMDY&); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CMDY&); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CMDY&); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CMDY&); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CMDY&); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CMDY&); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CMDY&); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CMDY&); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CMDY&); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CMDY&); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CMDY&); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CMDY&); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CMDY&); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CMDY&); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CMDY&); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CMDY&); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CMDY&); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CMDY&); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CMDY&); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CMDY&); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CMDY&); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CMDY&); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CMDY&); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CMDY&); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CMDY&); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CMDY&); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CMDY&); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CMDY&); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CMDY&); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CMDY&); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CMDY&); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CMDY&); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CMDY&); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CMDY&); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CMDY&); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CMDY&); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CMDY&); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CMDY&); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CMDY&); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CMDY&); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CMDY&); ENDIF; ENDSR; BEGSR $To_CMDYComma; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CMDY,); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CMDY,); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CMDY,); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CMDY,); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CMDY,); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CMDY,); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CMDY,); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CMDY,); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CMDY,); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CMDY,); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CMDY,); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CMDY,); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CMDY,); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CMDY,); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CMDY,); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CMDY,); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CMDY,); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CMDY,); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CMDY,); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CMDY,); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CMDY,); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CMDY,); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CMDY,); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CMDY,); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CMDY,); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CMDY,); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CMDY,); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CMDY,); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CMDY,); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CMDY,); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CMDY,); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CMDY,); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CMDY,); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CMDY,); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CMDY,); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CMDY,); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CMDY,); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CMDY,); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CMDY,); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CMDY,); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CMDY,); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CMDY,); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CMDY,); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CMDY,); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CMDY,); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CMDY,); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CMDY,); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CMDY,); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CMDY,); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CMDY,); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CMDY,); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CMDY,); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CMDY,); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CMDY,); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CMDY,); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CMDY,); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CMDY,); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CMDY,); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CMDY,); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CMDY,); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CMDY,); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CMDY,); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CMDY,); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CMDY,); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CMDY,); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CMDY,); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CMDY,); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CMDY,); ENDIF; ENDSR; BEGSR $To_CMDYDash; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CMDY-); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CMDY-); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CMDY-); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CMDY-); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CMDY-); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CMDY-); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CMDY-); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CMDY-); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CMDY-); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CMDY-); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CMDY-); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CMDY-); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CMDY-); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CMDY-); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CMDY-); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CMDY-); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CMDY-); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CMDY-); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CMDY-); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CMDY-); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CMDY-); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CMDY-); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CMDY-); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CMDY-); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CMDY-); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CMDY-); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CMDY-); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CMDY-); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CMDY-); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CMDY-); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CMDY-); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CMDY-); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CMDY-); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CMDY-); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CMDY-); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CMDY-); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CMDY-); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CMDY-); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CMDY-); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CMDY-); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CMDY-); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CMDY-); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CMDY-); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CMDY-); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CMDY-); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CMDY-); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CMDY-); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CMDY-); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CMDY-); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CMDY-); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CMDY-); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CMDY-); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CMDY-); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CMDY-); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CMDY-); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CMDY-); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CMDY-); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CMDY-); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CMDY-); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CMDY-); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CMDY-); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CMDY-); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CMDY-); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CMDY-); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CMDY-); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CMDY-); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CMDY-); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CMDY-); ENDIF; ENDSR; BEGSR $To_CMDYPeriod; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CMDY.); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CMDY.); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CMDY.); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CMDY.); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CMDY.); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CMDY.); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CMDY.); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CMDY.); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CMDY.); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CMDY.); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CMDY.); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CMDY.); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CMDY.); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CMDY.); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CMDY.); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CMDY.); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CMDY.); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CMDY.); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CMDY.); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CMDY.); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CMDY.); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CMDY.); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CMDY.); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CMDY.); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CMDY.); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CMDY.); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CMDY.); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CMDY.); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CMDY.); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CMDY.); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CMDY.); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CMDY.); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CMDY.); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CMDY.); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CMDY.); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CMDY.); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CMDY.); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CMDY.); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CMDY.); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CMDY.); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CMDY.); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CMDY.); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CMDY.); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CMDY.); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CMDY.); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CMDY.); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CMDY.); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CMDY.); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CMDY.); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CMDY.); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CMDY.); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CMDY.); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CMDY.); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CMDY.); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CMDY.); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CMDY.); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CMDY.); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CMDY.); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CMDY.); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CMDY.); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CMDY.); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CMDY.); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CMDY.); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CMDY.); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CMDY.); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CMDY.); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CMDY.); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CMDY.); ENDIF; ENDSR; BEGSR $To_CMDYSlash; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CMDY/); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CMDY/); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CMDY/); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CMDY/); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CMDY/); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CMDY/); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CMDY/); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CMDY/); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CMDY/); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CMDY/); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CMDY/); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CMDY/); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CMDY/); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CMDY/); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CMDY/); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CMDY/); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CMDY/); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CMDY/); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CMDY/); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CMDY/); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CMDY/); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CMDY/); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CMDY/); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CMDY/); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CMDY/); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CMDY/); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CMDY/); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CMDY/); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CMDY/); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CMDY/); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CMDY/); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CMDY/); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CMDY/); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CMDY/); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CMDY/); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CMDY/); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CMDY/); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CMDY/); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CMDY/); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CMDY/); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CMDY/); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CMDY/); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CMDY/); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CMDY/); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CMDY/); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CMDY/); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CMDY/); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CMDY/); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CMDY/); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CMDY/); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CMDY/); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CMDY/); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CMDY/); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CMDY/); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CMDY/); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CMDY/); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CMDY/); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CMDY/); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CMDY/); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CMDY/); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CMDY/); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CMDY/); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CMDY/); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CMDY/); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CMDY/); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CMDY/); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CMDY/); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CMDY/); ENDIF; ENDSR; BEGSR $To_CYMD; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CYMD); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CYMD); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CYMD); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CYMD); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CYMD); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CYMD); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CYMD); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CYMD); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CYMD); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CYMD); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CYMD); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CYMD); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CYMD); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CYMD); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CYMD); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CYMD); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CYMD); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CYMD); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CYMD); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CYMD); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CYMD); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CYMD); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CYMD); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CYMD); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CYMD); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CYMD); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CYMD); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CYMD); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CYMD); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CYMD); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CYMD); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CYMD); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CYMD); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CYMD); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CYMD); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CYMD); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CYMD); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CYMD); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CYMD); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CYMD); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CYMD); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CYMD); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CYMD); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CYMD); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CYMD); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CYMD); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CYMD); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CYMD); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CYMD); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CYMD); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CYMD); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CYMD); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CYMD); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CYMD); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CYMD); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CYMD); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CYMD); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CYMD); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CYMD); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CYMD); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CYMD); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CYMD); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CYMD); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CYMD); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CYMD); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CYMD); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CYMD); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CYMD); ENDIF; ENDSR; BEGSR $To_CYMD0; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CYMD0); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CYMD0); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CYMD0); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CYMD0); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CYMD0); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CYMD0); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CYMD0); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CYMD0); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CYMD0); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CYMD0); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CYMD0); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CYMD0); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CYMD0); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CYMD0); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CYMD0); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CYMD0); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CYMD0); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CYMD0); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CYMD0); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CYMD0); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CYMD0); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CYMD0); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CYMD0); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CYMD0); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CYMD0); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CYMD0); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CYMD0); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CYMD0); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CYMD0); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CYMD0); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CYMD0); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CYMD0); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CYMD0); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CYMD0); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CYMD0); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CYMD0); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CYMD0); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CYMD0); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CYMD0); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CYMD0); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CYMD0); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CYMD0); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CYMD0); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CYMD0); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CYMD0); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CYMD0); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CYMD0); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CYMD0); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CYMD0); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CYMD0); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CYMD0); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CYMD0); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CYMD0); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CYMD0); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CYMD0); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CYMD0); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CYMD0); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CYMD0); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CYMD0); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CYMD0); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CYMD0); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CYMD0); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CYMD0); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CYMD0); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CYMD0); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CYMD0); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CYMD0); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CYMD0); ENDIF; ENDSR; BEGSR $To_CYMDAmpersand; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CYMD&); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CYMD&); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CYMD&); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CYMD&); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CYMD&); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CYMD&); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CYMD&); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CYMD&); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CYMD&); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CYMD&); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CYMD&); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CYMD&); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CYMD&); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CYMD&); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CYMD&); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CYMD&); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CYMD&); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CYMD&); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CYMD&); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CYMD&); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CYMD&); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CYMD&); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CYMD&); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CYMD&); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CYMD&); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CYMD&); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CYMD&); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CYMD&); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CYMD&); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CYMD&); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CYMD&); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CYMD&); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CYMD&); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CYMD&); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CYMD&); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CYMD&); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CYMD&); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CYMD&); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CYMD&); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CYMD&); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CYMD&); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CYMD&); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CYMD&); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CYMD&); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CYMD&); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CYMD&); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CYMD&); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CYMD&); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CYMD&); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CYMD&); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CYMD&); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CYMD&); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CYMD&); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CYMD&); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CYMD&); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CYMD&); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CYMD&); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CYMD&); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CYMD&); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CYMD&); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CYMD&); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CYMD&); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CYMD&); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CYMD&); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CYMD&); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CYMD&); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CYMD&); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CYMD&); ENDIF; ENDSR; BEGSR $To_CYMDComma; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CYMD,); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CYMD,); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CYMD,); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CYMD,); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CYMD,); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CYMD,); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CYMD,); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CYMD,); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CYMD,); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CYMD,); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CYMD,); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CYMD,); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CYMD,); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CYMD,); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CYMD,); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CYMD,); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CYMD,); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CYMD,); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CYMD,); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CYMD,); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CYMD,); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CYMD,); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CYMD,); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CYMD,); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CYMD,); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CYMD,); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CYMD,); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CYMD,); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CYMD,); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CYMD,); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CYMD,); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CYMD,); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CYMD,); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CYMD,); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CYMD,); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CYMD,); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CYMD,); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CYMD,); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CYMD,); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CYMD,); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CYMD,); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CYMD,); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CYMD,); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CYMD,); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CYMD,); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CYMD,); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CYMD,); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CYMD,); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CYMD,); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CYMD,); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CYMD,); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CYMD,); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CYMD,); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CYMD,); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CYMD,); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CYMD,); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CYMD,); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CYMD,); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CYMD,); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CYMD,); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CYMD,); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CYMD,); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CYMD,); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CYMD,); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CYMD,); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CYMD,); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CYMD,); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CYMD,); ENDIF; ENDSR; BEGSR $To_CYMDDash; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CYMD-); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CYMD-); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CYMD-); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CYMD-); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CYMD-); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CYMD-); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CYMD-); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CYMD-); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CYMD-); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CYMD-); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CYMD-); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CYMD-); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CYMD-); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CYMD-); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CYMD-); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CYMD-); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CYMD-); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CYMD-); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CYMD-); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CYMD-); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CYMD-); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CYMD-); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CYMD-); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CYMD-); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CYMD-); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CYMD-); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CYMD-); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CYMD-); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CYMD-); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CYMD-); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CYMD-); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CYMD-); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CYMD-); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CYMD-); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CYMD-); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CYMD-); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CYMD-); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CYMD-); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CYMD-); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CYMD-); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CYMD-); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CYMD-); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CYMD-); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CYMD-); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CYMD-); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CYMD-); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CYMD-); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CYMD-); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CYMD-); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CYMD-); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CYMD-); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CYMD-); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CYMD-); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CYMD-); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CYMD-); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CYMD-); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CYMD-); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CYMD-); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CYMD-); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CYMD-); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CYMD-); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CYMD-); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CYMD-); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CYMD-); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CYMD-); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CYMD-); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CYMD-); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CYMD-); ENDIF; ENDSR; BEGSR $To_CYMDPeriod; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CYMD.); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CYMD.); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CYMD.); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CYMD.); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CYMD.); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CYMD.); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CYMD.); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CYMD.); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CYMD.); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CYMD.); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CYMD.); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CYMD.); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CYMD.); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CYMD.); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CYMD.); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CYMD.); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CYMD.); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CYMD.); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CYMD.); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CYMD.); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CYMD.); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CYMD.); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CYMD.); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CYMD.); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CYMD.); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CYMD.); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CYMD.); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CYMD.); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CYMD.); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CYMD.); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CYMD.); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CYMD.); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CYMD.); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CYMD.); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CYMD.); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CYMD.); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CYMD.); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CYMD.); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CYMD.); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CYMD.); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CYMD.); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CYMD.); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CYMD.); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CYMD.); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CYMD.); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CYMD.); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CYMD.); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CYMD.); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CYMD.); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CYMD.); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CYMD.); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CYMD.); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CYMD.); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CYMD.); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CYMD.); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CYMD.); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CYMD.); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CYMD.); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CYMD.); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CYMD.); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CYMD.); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CYMD.); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CYMD.); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CYMD.); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CYMD.); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CYMD.); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CYMD.); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CYMD.); ENDIF; ENDSR; BEGSR $To_CYMDSlash; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*CYMD/); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*CYMD/); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*CYMD/); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*CYMD/); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*CYMD/); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*CYMD/); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*CYMD/); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*CYMD/); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*CYMD/); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*CYMD/); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*CYMD/); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*CYMD/); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*CYMD/); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*CYMD/); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*CYMD/); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*CYMD/); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*CYMD/); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*CYMD/); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*CYMD/); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*CYMD/); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*CYMD/); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*CYMD/); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*CYMD/); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*CYMD/); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*CYMD/); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*CYMD/); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*CYMD/); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*CYMD/); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*CYMD/); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*CYMD/); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*CYMD/); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*CYMD/); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*CYMD/); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*CYMD/); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*CYMD/); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*CYMD/); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*CYMD/); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*CYMD/); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*CYMD/); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*CYMD/); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*CYMD/); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*CYMD/); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*CYMD/); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*CYMD/); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*CYMD/); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*CYMD/); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*CYMD/); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*CYMD/); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*CYMD/); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*CYMD/); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*CYMD/); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*CYMD/); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*CYMD/); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*CYMD/); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*CYMD/); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*CYMD/); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*CYMD/); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*CYMD/); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*CYMD/); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*CYMD/); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*CYMD/); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*CYMD/); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*CYMD/); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*CYMD/); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*CYMD/); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*CYMD/); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*CYMD/); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*CYMD/); ENDIF; ENDSR; BEGSR $To_DMY; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*DMY); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*DMY); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*DMY); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*DMY); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*DMY); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*DMY); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*DMY); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*DMY); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*DMY); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*DMY); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*DMY); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*DMY); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*DMY); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*DMY); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*DMY); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*DMY); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*DMY); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*DMY); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*DMY); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*DMY); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*DMY); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*DMY); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*DMY); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*DMY); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*DMY); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*DMY); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*DMY); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*DMY); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*DMY); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*DMY); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*DMY); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*DMY); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*DMY); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*DMY); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*DMY); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*DMY); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*DMY); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*DMY); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*DMY); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*DMY); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*DMY); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*DMY); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*DMY); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*DMY); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*DMY); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*DMY); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*DMY); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*DMY); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*DMY); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*DMY); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*DMY); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*DMY); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*DMY); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*DMY); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*DMY); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*DMY); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*DMY); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*DMY); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*DMY); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*DMY); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*DMY); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*DMY); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*DMY); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*DMY); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*DMY); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*DMY); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*DMY); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*DMY); ENDIF; ENDSR; BEGSR $To_DMY0; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*DMY0); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*DMY0); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*DMY0); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*DMY0); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*DMY0); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*DMY0); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*DMY0); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*DMY0); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*DMY0); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*DMY0); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*DMY0); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*DMY0); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*DMY0); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*DMY0); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*DMY0); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*DMY0); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*DMY0); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*DMY0); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*DMY0); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*DMY0); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*DMY0); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*DMY0); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*DMY0); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*DMY0); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*DMY0); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*DMY0); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*DMY0); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*DMY0); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*DMY0); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*DMY0); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*DMY0); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*DMY0); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*DMY0); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*DMY0); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*DMY0); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*DMY0); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*DMY0); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*DMY0); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*DMY0); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*DMY0); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*DMY0); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*DMY0); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*DMY0); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*DMY0); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*DMY0); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*DMY0); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*DMY0); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*DMY0); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*DMY0); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*DMY0); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*DMY0); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*DMY0); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*DMY0); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*DMY0); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*DMY0); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*DMY0); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*DMY0); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*DMY0); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*DMY0); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*DMY0); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*DMY0); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*DMY0); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*DMY0); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*DMY0); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*DMY0); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*DMY0); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*DMY0); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*DMY0); ENDIF; ENDSR; BEGSR $To_DMYAmpersand; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*DMY&); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*DMY&); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*DMY&); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*DMY&); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*DMY&); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*DMY&); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*DMY&); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*DMY&); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*DMY&); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*DMY&); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*DMY&); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*DMY&); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*DMY&); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*DMY&); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*DMY&); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*DMY&); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*DMY&); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*DMY&); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*DMY&); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*DMY&); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*DMY&); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*DMY&); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*DMY&); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*DMY&); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*DMY&); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*DMY&); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*DMY&); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*DMY&); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*DMY&); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*DMY&); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*DMY&); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*DMY&); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*DMY&); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*DMY&); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*DMY&); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*DMY&); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*DMY&); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*DMY&); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*DMY&); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*DMY&); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*DMY&); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*DMY&); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*DMY&); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*DMY&); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*DMY&); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*DMY&); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*DMY&); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*DMY&); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*DMY&); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*DMY&); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*DMY&); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*DMY&); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*DMY&); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*DMY&); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*DMY&); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*DMY&); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*DMY&); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*DMY&); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*DMY&); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*DMY&); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*DMY&); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*DMY&); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*DMY&); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*DMY&); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*DMY&); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*DMY&); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*DMY&); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*DMY&); ENDIF; ENDSR; BEGSR $To_DMYComma; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*DMY,); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*DMY,); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*DMY,); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*DMY,); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*DMY,); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*DMY,); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*DMY,); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*DMY,); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*DMY,); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*DMY,); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*DMY,); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*DMY,); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*DMY,); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*DMY,); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*DMY,); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*DMY,); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*DMY,); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*DMY,); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*DMY,); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*DMY,); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*DMY,); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*DMY,); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*DMY,); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*DMY,); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*DMY,); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*DMY,); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*DMY,); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*DMY,); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*DMY,); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*DMY,); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*DMY,); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*DMY,); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*DMY,); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*DMY,); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*DMY,); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*DMY,); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*DMY,); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*DMY,); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*DMY,); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*DMY,); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*DMY,); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*DMY,); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*DMY,); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*DMY,); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*DMY,); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*DMY,); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*DMY,); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*DMY,); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*DMY,); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*DMY,); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*DMY,); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*DMY,); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*DMY,); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*DMY,); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*DMY,); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*DMY,); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*DMY,); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*DMY,); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*DMY,); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*DMY,); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*DMY,); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*DMY,); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*DMY,); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*DMY,); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*DMY,); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*DMY,); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*DMY,); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*DMY,); ENDIF; ENDSR; BEGSR $To_DMYDash; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*DMY-); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*DMY-); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*DMY-); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*DMY-); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*DMY-); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*DMY-); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*DMY-); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*DMY-); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*DMY-); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*DMY-); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*DMY-); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*DMY-); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*DMY-); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*DMY-); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*DMY-); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*DMY-); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*DMY-); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*DMY-); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*DMY-); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*DMY-); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*DMY-); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*DMY-); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*DMY-); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*DMY-); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*DMY-); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*DMY-); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*DMY-); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*DMY-); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*DMY-); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*DMY-); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*DMY-); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*DMY-); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*DMY-); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*DMY-); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*DMY-); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*DMY-); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*DMY-); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*DMY-); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*DMY-); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*DMY-); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*DMY-); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*DMY-); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*DMY-); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*DMY-); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*DMY-); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*DMY-); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*DMY-); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*DMY-); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*DMY-); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*DMY-); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*DMY-); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*DMY-); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*DMY-); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*DMY-); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*DMY-); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*DMY-); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*DMY-); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*DMY-); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*DMY-); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*DMY-); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*DMY-); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*DMY-); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*DMY-); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*DMY-); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*DMY-); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*DMY-); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*DMY-); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*DMY-); ENDIF; ENDSR; BEGSR $To_DMYPeriod; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*DMY.); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*DMY.); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*DMY.); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*DMY.); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*DMY.); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*DMY.); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*DMY.); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*DMY.); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*DMY.); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*DMY.); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*DMY.); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*DMY.); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*DMY.); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*DMY.); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*DMY.); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*DMY.); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*DMY.); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*DMY.); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*DMY.); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*DMY.); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*DMY.); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*DMY.); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*DMY.); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*DMY.); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*DMY.); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*DMY.); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*DMY.); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*DMY.); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*DMY.); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*DMY.); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*DMY.); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*DMY.); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*DMY.); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*DMY.); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*DMY.); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*DMY.); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*DMY.); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*DMY.); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*DMY.); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*DMY.); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*DMY.); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*DMY.); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*DMY.); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*DMY.); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*DMY.); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*DMY.); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*DMY.); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*DMY.); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*DMY.); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*DMY.); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*DMY.); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*DMY.); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*DMY.); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*DMY.); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*DMY.); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*DMY.); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*DMY.); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*DMY.); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*DMY.); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*DMY.); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*DMY.); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*DMY.); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*DMY.); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*DMY.); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*DMY.); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*DMY.); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*DMY.); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*DMY.); ENDIF; ENDSR; BEGSR $To_DMYSlash; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*DMY/); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*DMY/); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*DMY/); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*DMY/); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*DMY/); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*DMY/); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*DMY/); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*DMY/); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*DMY/); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*DMY/); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*DMY/); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*DMY/); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*DMY/); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*DMY/); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*DMY/); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*DMY/); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*DMY/); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*DMY/); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*DMY/); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*DMY/); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*DMY/); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*DMY/); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*DMY/); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*DMY/); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*DMY/); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*DMY/); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*DMY/); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*DMY/); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*DMY/); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*DMY/); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*DMY/); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*DMY/); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*DMY/); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*DMY/); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*DMY/); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*DMY/); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*DMY/); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*DMY/); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*DMY/); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*DMY/); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*DMY/); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*DMY/); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*DMY/); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*DMY/); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*DMY/); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*DMY/); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*DMY/); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*DMY/); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*DMY/); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*DMY/); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*DMY/); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*DMY/); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*DMY/); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*DMY/); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*DMY/); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*DMY/); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*DMY/); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*DMY/); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*DMY/); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*DMY/); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*DMY/); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*DMY/); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*DMY/); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*DMY/); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*DMY/); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*DMY/); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*DMY/); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*DMY/); ENDIF; ENDSR; BEGSR $To_EUR; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*EUR); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*EUR); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*EUR); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*EUR); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*EUR); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*EUR); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*EUR); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*EUR); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*EUR); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*EUR); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*EUR); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*EUR); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*EUR); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*EUR); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*EUR); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*EUR); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*EUR); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*EUR); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*EUR); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*EUR); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*EUR); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*EUR); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*EUR); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*EUR); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*EUR); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*EUR); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*EUR); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*EUR); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*EUR); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*EUR); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*EUR); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*EUR); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*EUR); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*EUR); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*EUR); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*EUR); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*EUR); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*EUR); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*EUR); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*EUR); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*EUR); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*EUR); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*EUR); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*EUR); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*EUR); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*EUR); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*EUR); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*EUR); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*EUR); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*EUR); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*EUR); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*EUR); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*EUR); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*EUR); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*EUR); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*EUR); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*EUR); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*EUR); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*EUR); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*EUR); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*EUR); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*EUR); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*EUR); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*EUR); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*EUR); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*EUR); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*EUR); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*EUR); ENDIF; ENDSR; BEGSR $To_EUR0; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*EUR0); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*EUR0); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*EUR0); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*EUR0); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*EUR0); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*EUR0); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*EUR0); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*EUR0); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*EUR0); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*EUR0); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*EUR0); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*EUR0); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*EUR0); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*EUR0); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*EUR0); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*EUR0); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*EUR0); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*EUR0); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*EUR0); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*EUR0); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*EUR0); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*EUR0); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*EUR0); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*EUR0); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*EUR0); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*EUR0); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*EUR0); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*EUR0); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*EUR0); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*EUR0); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*EUR0); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*EUR0); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*EUR0); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*EUR0); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*EUR0); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*EUR0); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*EUR0); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*EUR0); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*EUR0); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*EUR0); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*EUR0); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*EUR0); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*EUR0); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*EUR0); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*EUR0); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*EUR0); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*EUR0); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*EUR0); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*EUR0); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*EUR0); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*EUR0); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*EUR0); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*EUR0); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*EUR0); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*EUR0); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*EUR0); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*EUR0); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*EUR0); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*EUR0); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*EUR0); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*EUR0); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*EUR0); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*EUR0); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*EUR0); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*EUR0); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*EUR0); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*EUR0); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*EUR0); ENDIF; ENDSR; BEGSR $To_EURPeriod; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*EUR.); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*EUR.); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*EUR.); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*EUR.); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*EUR.); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*EUR.); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*EUR.); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*EUR.); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*EUR.); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*EUR.); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*EUR.); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*EUR.); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*EUR.); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*EUR.); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*EUR.); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*EUR.); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*EUR.); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*EUR.); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*EUR.); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*EUR.); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*EUR.); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*EUR.); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*EUR.); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*EUR.); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*EUR.); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*EUR.); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*EUR.); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*EUR.); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*EUR.); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*EUR.); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*EUR.); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*EUR.); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*EUR.); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*EUR.); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*EUR.); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*EUR.); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*EUR.); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*EUR.); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*EUR.); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*EUR.); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*EUR.); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*EUR.); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*EUR.); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*EUR.); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*EUR.); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*EUR.); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*EUR.); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*EUR.); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*EUR.); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*EUR.); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*EUR.); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*EUR.); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*EUR.); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*EUR.); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*EUR.); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*EUR.); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*EUR.); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*EUR.); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*EUR.); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*EUR.); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*EUR.); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*EUR.); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*EUR.); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*EUR.); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*EUR.); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*EUR.); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*EUR.); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*EUR.); ENDIF; ENDSR; BEGSR $To_ISO; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*ISO); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*ISO); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*ISO); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*ISO); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*ISO); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*ISO); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*ISO); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*ISO); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*ISO); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*ISO); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*ISO); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*ISO); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*ISO); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*ISO); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*ISO); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*ISO); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*ISO); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*ISO); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*ISO); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*ISO); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*ISO); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*ISO); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*ISO); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*ISO); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*ISO); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*ISO); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*ISO); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*ISO); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*ISO); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*ISO); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*ISO); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*ISO); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*ISO); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*ISO); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*ISO); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*ISO); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*ISO); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*ISO); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*ISO); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*ISO); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*ISO); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*ISO); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*ISO); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*ISO); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*ISO); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*ISO); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*ISO); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*ISO); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*ISO); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*ISO); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*ISO); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*ISO); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*ISO); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*ISO); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*ISO); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*ISO); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*ISO); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*ISO); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*ISO); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*ISO); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*ISO); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*ISO); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*ISO); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*ISO); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*ISO); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*ISO); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*ISO); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*ISO); ENDIF; ENDSR; BEGSR $To_ISO0; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*ISO0); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*ISO0); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*ISO0); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*ISO0); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*ISO0); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*ISO0); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*ISO0); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*ISO0); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*ISO0); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*ISO0); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*ISO0); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*ISO0); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*ISO0); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*ISO0); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*ISO0); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*ISO0); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*ISO0); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*ISO0); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*ISO0); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*ISO0); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*ISO0); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*ISO0); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*ISO0); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*ISO0); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*ISO0); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*ISO0); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*ISO0); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*ISO0); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*ISO0); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*ISO0); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*ISO0); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*ISO0); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*ISO0); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*ISO0); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*ISO0); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*ISO0); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*ISO0); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*ISO0); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*ISO0); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*ISO0); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*ISO0); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*ISO0); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*ISO0); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*ISO0); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*ISO0); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*ISO0); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*ISO0); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*ISO0); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*ISO0); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*ISO0); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*ISO0); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*ISO0); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*ISO0); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*ISO0); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*ISO0); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*ISO0); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*ISO0); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*ISO0); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*ISO0); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*ISO0); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*ISO0); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*ISO0); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*ISO0); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*ISO0); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*ISO0); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*ISO0); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*ISO0); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*ISO0); ENDIF; ENDSR; BEGSR $To_ISODash; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*ISO-); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*ISO-); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*ISO-); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*ISO-); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*ISO-); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*ISO-); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*ISO-); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*ISO-); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*ISO-); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*ISO-); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*ISO-); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*ISO-); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*ISO-); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*ISO-); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*ISO-); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*ISO-); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*ISO-); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*ISO-); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*ISO-); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*ISO-); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*ISO-); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*ISO-); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*ISO-); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*ISO-); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*ISO-); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*ISO-); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*ISO-); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*ISO-); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*ISO-); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*ISO-); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*ISO-); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*ISO-); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*ISO-); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*ISO-); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*ISO-); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*ISO-); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*ISO-); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*ISO-); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*ISO-); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*ISO-); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*ISO-); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*ISO-); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*ISO-); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*ISO-); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*ISO-); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*ISO-); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*ISO-); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*ISO-); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*ISO-); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*ISO-); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*ISO-); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*ISO-); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*ISO-); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*ISO-); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*ISO-); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*ISO-); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*ISO-); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*ISO-); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*ISO-); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*ISO-); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*ISO-); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*ISO-); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*ISO-); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*ISO-); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*ISO-); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*ISO-); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*ISO-); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*ISO-); ENDIF; ENDSR; BEGSR $To_JIS; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*JIS); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*JIS); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*JIS); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*JIS); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*JIS); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*JIS); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*JIS); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*JIS); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*JIS); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*JIS); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*JIS); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*JIS); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*JIS); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*JIS); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*JIS); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*JIS); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*JIS); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*JIS); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*JIS); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*JIS); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*JIS); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*JIS); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*JIS); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*JIS); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*JIS); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*JIS); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*JIS); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*JIS); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*JIS); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*JIS); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*JIS); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*JIS); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*JIS); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*JIS); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*JIS); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*JIS); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*JIS); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*JIS); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*JIS); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*JIS); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*JIS); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*JIS); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*JIS); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*JIS); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*JIS); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*JIS); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*JIS); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*JIS); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*JIS); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*JIS); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*JIS); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*JIS); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*JIS); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*JIS); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*JIS); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*JIS); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*JIS); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*JIS); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*JIS); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*JIS); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*JIS); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*JIS); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*JIS); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*JIS); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*JIS); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*JIS); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*JIS); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*JIS); ENDIF; ENDSR; BEGSR $To_JIS0; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*JIS0); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*JIS0); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*JIS0); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*JIS0); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*JIS0); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*JIS0); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*JIS0); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*JIS0); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*JIS0); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*JIS0); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*JIS0); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*JIS0); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*JIS0); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*JIS0); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*JIS0); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*JIS0); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*JIS0); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*JIS0); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*JIS0); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*JIS0); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*JIS0); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*JIS0); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*JIS0); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*JIS0); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*JIS0); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*JIS0); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*JIS0); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*JIS0); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*JIS0); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*JIS0); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*JIS0); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*JIS0); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*JIS0); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*JIS0); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*JIS0); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*JIS0); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*JIS0); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*JIS0); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*JIS0); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*JIS0); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*JIS0); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*JIS0); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*JIS0); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*JIS0); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*JIS0); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*JIS0); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*JIS0); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*JIS0); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*JIS0); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*JIS0); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*JIS0); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*JIS0); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*JIS0); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*JIS0); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*JIS0); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*JIS0); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*JIS0); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*JIS0); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*JIS0); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*JIS0); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*JIS0); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*JIS0); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*JIS0); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*JIS0); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*JIS0); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*JIS0); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*JIS0); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*JIS0); ENDIF; ENDSR; BEGSR $To_JISDash; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*JIS-); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*JIS-); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*JIS-); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*JIS-); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*JIS-); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*JIS-); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*JIS-); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*JIS-); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*JIS-); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*JIS-); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*JIS-); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*JIS-); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*JIS-); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*JIS-); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*JIS-); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*JIS-); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*JIS-); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*JIS-); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*JIS-); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*JIS-); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*JIS-); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*JIS-); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*JIS-); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*JIS-); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*JIS-); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*JIS-); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*JIS-); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*JIS-); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*JIS-); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*JIS-); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*JIS-); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*JIS-); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*JIS-); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*JIS-); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*JIS-); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*JIS-); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*JIS-); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*JIS-); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*JIS-); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*JIS-); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*JIS-); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*JIS-); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*JIS-); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*JIS-); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*JIS-); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*JIS-); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*JIS-); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*JIS-); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*JIS-); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*JIS-); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*JIS-); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*JIS-); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*JIS-); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*JIS-); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*JIS-); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*JIS-); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*JIS-); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*JIS-); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*JIS-); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*JIS-); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*JIS-); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*JIS-); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*JIS-); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*JIS-); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*JIS-); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*JIS-); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*JIS-); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*JIS-); ENDIF; ENDSR; BEGSR $To_JUL; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*JUL); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*JUL); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*JUL); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*JUL); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*JUL); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*JUL); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*JUL); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*JUL); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*JUL); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*JUL); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*JUL); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*JUL); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*JUL); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*JUL); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*JUL); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*JUL); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*JUL); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*JUL); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*JUL); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*JUL); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*JUL); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*JUL); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*JUL); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*JUL); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*JUL); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*JUL); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*JUL); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*JUL); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*JUL); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*JUL); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*JUL); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*JUL); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*JUL); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*JUL); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*JUL); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*JUL); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*JUL); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*JUL); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*JUL); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*JUL); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*JUL); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*JUL); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*JUL); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*JUL); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*JUL); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*JUL); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*JUL); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*JUL); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*JUL); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*JUL); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*JUL); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*JUL); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*JUL); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*JUL); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*JUL); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*JUL); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*JUL); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*JUL); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*JUL); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*JUL); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*JUL); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*JUL); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*JUL); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*JUL); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*JUL); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*JUL); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*JUL); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*JUL); ENDIF; ENDSR; BEGSR $To_JUL0; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*JUL0); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*JUL0); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*JUL0); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*JUL0); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*JUL0); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*JUL0); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*JUL0); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*JUL0); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*JUL0); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*JUL0); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*JUL0); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*JUL0); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*JUL0); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*JUL0); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*JUL0); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*JUL0); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*JUL0); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*JUL0); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*JUL0); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*JUL0); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*JUL0); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*JUL0); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*JUL0); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*JUL0); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*JUL0); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*JUL0); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*JUL0); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*JUL0); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*JUL0); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*JUL0); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*JUL0); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*JUL0); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*JUL0); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*JUL0); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*JUL0); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*JUL0); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*JUL0); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*JUL0); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*JUL0); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*JUL0); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*JUL0); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*JUL0); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*JUL0); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*JUL0); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*JUL0); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*JUL0); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*JUL0); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*JUL0); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*JUL0); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*JUL0); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*JUL0); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*JUL0); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*JUL0); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*JUL0); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*JUL0); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*JUL0); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*JUL0); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*JUL0); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*JUL0); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*JUL0); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*JUL0); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*JUL0); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*JUL0); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*JUL0); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*JUL0); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*JUL0); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*JUL0); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*JUL0); ENDIF; ENDSR; BEGSR $To_JULAmpersand; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*JUL&); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*JUL&); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*JUL&); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*JUL&); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*JUL&); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*JUL&); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*JUL&); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*JUL&); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*JUL&); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*JUL&); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*JUL&); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*JUL&); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*JUL&); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*JUL&); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*JUL&); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*JUL&); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*JUL&); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*JUL&); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*JUL&); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*JUL&); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*JUL&); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*JUL&); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*JUL&); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*JUL&); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*JUL&); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*JUL&); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*JUL&); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*JUL&); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*JUL&); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*JUL&); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*JUL&); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*JUL&); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*JUL&); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*JUL&); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*JUL&); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*JUL&); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*JUL&); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*JUL&); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*JUL&); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*JUL&); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*JUL&); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*JUL&); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*JUL&); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*JUL&); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*JUL&); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*JUL&); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*JUL&); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*JUL&); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*JUL&); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*JUL&); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*JUL&); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*JUL&); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*JUL&); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*JUL&); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*JUL&); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*JUL&); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*JUL&); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*JUL&); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*JUL&); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*JUL&); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*JUL&); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*JUL&); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*JUL&); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*JUL&); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*JUL&); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*JUL&); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*JUL&); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*JUL&); ENDIF; ENDSR; BEGSR $To_JULComma; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*JUL,); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*JUL,); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*JUL,); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*JUL,); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*JUL,); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*JUL,); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*JUL,); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*JUL,); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*JUL,); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*JUL,); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*JUL,); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*JUL,); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*JUL,); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*JUL,); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*JUL,); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*JUL,); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*JUL,); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*JUL,); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*JUL,); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*JUL,); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*JUL,); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*JUL,); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*JUL,); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*JUL,); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*JUL,); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*JUL,); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*JUL,); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*JUL,); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*JUL,); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*JUL,); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*JUL,); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*JUL,); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*JUL,); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*JUL,); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*JUL,); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*JUL,); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*JUL,); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*JUL,); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*JUL,); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*JUL,); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*JUL,); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*JUL,); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*JUL,); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*JUL,); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*JUL,); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*JUL,); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*JUL,); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*JUL,); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*JUL,); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*JUL,); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*JUL,); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*JUL,); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*JUL,); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*JUL,); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*JUL,); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*JUL,); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*JUL,); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*JUL,); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*JUL,); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*JUL,); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*JUL,); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*JUL,); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*JUL,); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*JUL,); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*JUL,); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*JUL,); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*JUL,); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*JUL,); ENDIF; ENDSR; BEGSR $To_JulDash; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*JUL-); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*JUL-); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*JUL-); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*JUL-); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*JUL-); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*JUL-); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*JUL-); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*JUL-); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*JUL-); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*JUL-); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*JUL-); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*JUL-); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*JUL-); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*JUL-); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*JUL-); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*JUL-); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*JUL-); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*JUL-); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*JUL-); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*JUL-); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*JUL-); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*JUL-); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*JUL-); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*JUL-); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*JUL-); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*JUL-); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*JUL-); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*JUL-); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*JUL-); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*JUL-); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*JUL-); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*JUL-); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*JUL-); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*JUL-); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*JUL-); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*JUL-); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*JUL-); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*JUL-); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*JUL-); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*JUL-); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*JUL-); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*JUL-); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*JUL-); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*JUL-); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*JUL-); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*JUL-); ELSEIF ##FromFmt = CONST_LONGJULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL&):*JUL-); ELSEIF ##FromFmt = CONST_LONGJULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL,):*JUL-); ELSEIF ##FromFmt = CONST_LONGJULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL-):*JUL-); ELSEIF ##FromFmt = CONST_LONGJULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL.):*JUL-); ELSEIF ##FromFmt = CONST_LONGJULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL/):*JUL-); ELSEIF ##FromFmt = CONST_MDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY):*JUL-); ELSEIF ##FromFmt = CONST_MDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY0):*JUL-); ELSEIF ##FromFmt = CONST_MDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY&):*JUL-); ELSEIF ##FromFmt = CONST_MDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY,):*JUL-); ELSEIF ##FromFmt = CONST_MDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY-):*JUL-); ELSEIF ##FromFmt = CONST_MDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY.):*JUL-); ELSEIF ##FromFmt = CONST_MDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*MDY/):*JUL-); ELSEIF ##FromFmt = CONST_USA; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA):*JUL-); ELSEIF ##FromFmt = CONST_USA0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA0):*JUL-); ELSEIF ##FromFmt = CONST_USASlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*USA/):*JUL-); ELSEIF ##FromFmt = CONST_YMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD):*JUL-); ELSEIF ##FromFmt = CONST_YMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD0):*JUL-); ELSEIF ##FromFmt = CONST_YMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD&):*JUL-); ELSEIF ##FromFmt = CONST_YMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD,):*JUL-); ELSEIF ##FromFmt = CONST_YMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD-):*JUL-); ELSEIF ##FromFmt = CONST_YMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD.):*JUL-); ELSEIF ##FromFmt = CONST_YMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*YMD/):*JUL-); ENDIF; ENDSR; BEGSR $To_JULPeriod; IF ##FromFmt = CONST_CDMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY):*JUL.); ELSEIF ##FromFmt = CONST_CDMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY0):*JUL.); ELSEIF ##FromFmt = CONST_CDMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY&):*JUL.); ELSEIF ##FromFmt = CONST_CDMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY,):*JUL.); ELSEIF ##FromFmt = CONST_CDMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY-):*JUL.); ELSEIF ##FromFmt = CONST_CDMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY.):*JUL.); ELSEIF ##FromFmt = CONST_CDMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CDMY/):*JUL.); ELSEIF ##FromFmt = CONST_CMDY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY):*JUL.); ELSEIF ##FromFmt = CONST_CMDY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY0):*JUL.); ELSEIF ##FromFmt = CONST_CMDYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY&):*JUL.); ELSEIF ##FromFmt = CONST_CMDYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY,):*JUL.); ELSEIF ##FromFmt = CONST_CMDYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY-):*JUL.); ELSEIF ##FromFmt = CONST_CMDYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY.):*JUL.); ELSEIF ##FromFmt = CONST_CMDYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CMDY/):*JUL.); ELSEIF ##FromFmt = CONST_CYMD; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD):*JUL.); ELSEIF ##FromFmt = CONST_CYMD0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD0):*JUL.); ELSEIF ##FromFmt = CONST_CYMDAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD&):*JUL.); ELSEIF ##FromFmt = CONST_CYMDComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD,):*JUL.); ELSEIF ##FromFmt = CONST_CYMDDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD-):*JUL.); ELSEIF ##FromFmt = CONST_CYMDPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD.):*JUL.); ELSEIF ##FromFmt = CONST_CYMDSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*CYMD/):*JUL.); ELSEIF ##FromFmt = CONST_DMY; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY):*JUL.); ELSEIF ##FromFmt = CONST_DMY0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY0):*JUL.); ELSEIF ##FromFmt = CONST_DMYAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY&):*JUL.); ELSEIF ##FromFmt = CONST_DMYComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY,):*JUL.); ELSEIF ##FromFmt = CONST_DMYDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY-):*JUL.); ELSEIF ##FromFmt = CONST_DMYPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY.):*JUL.); ELSEIF ##FromFmt = CONST_DMYSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*DMY/):*JUL.); ELSEIF ##FromFmt = CONST_EUR; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR):*JUL.); ELSEIF ##FromFmt = CONST_EUR0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR0):*JUL.); ELSEIF ##FromFmt = CONST_EURPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*EUR.):*JUL.); ELSEIF ##FromFmt = CONST_ISO; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO):*JUL.); ELSEIF ##FromFmt = CONST_ISO0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO0):*JUL.); ELSEIF ##FromFmt = CONST_ISODash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*ISO-):*JUL.); ELSEIF ##FromFmt = CONST_JIS; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS):*JUL.); ELSEIF ##FromFmt = CONST_JIS0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS0):*JUL.); ELSEIF ##FromFmt = CONST_JISDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JIS-):*JUL.); ELSEIF ##FromFmt = CONST_JUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL):*JUL.); ELSEIF ##FromFmt = CONST_JUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL0):*JUL.); ELSEIF ##FromFmt = CONST_JULAmpersand; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL&):*JUL.); ELSEIF ##FromFmt = CONST_JULComma; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL,):*JUL.); ELSEIF ##FromFmt = CONST_JULDash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL-):*JUL.); ELSEIF ##FromFmt = CONST_JULPeriod; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL.):*JUL.); ELSEIF ##FromFmt = CONST_JULSlash; dsReturn.DateChr = %CHAR(%DATE(##DChr:*JUL/):*JUL.); ELSEIF ##FromFmt = CONST_LONGJUL; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL):*JUL.); ELSEIF ##FromFmt = CONST_LONGJUL0; dsReturn.DateChr = %CHAR(%DATE(##DChr:*LONGJUL0):*JUL.);