**FREE /COPY *LIBL/QDURATION,RPGPGMHDR // heading specification /COPY *LIBL/QDURATION,DURATNPR00 // duration prototypes /COPY *LIBL/QDURATION,DURATNCY00 // duration copybook /COPY *LIBL/QDURATION,DURATNCN00 // duration constants DCL-F Results DISK USAGE(*OUTPUT) EXTFILE('DURATNPF01') EXTDESC('DURATNPF01') RENAME(DURATNRC01:OutRec); DCL-DS dsout EXTNAME('DURATNPF01':*OUTPUT) QUALIFIED END-DS; DCL-S ErrDate# LIKE(Duratn_FldRef.Date#8) INZ(99999); DCL-S ErrDateChr LIKE(Duratn_FldRef.DateChr) INZ('99999'); DCL-S DateType DATE INZ(D'2024-06-13'); DCL-S Date#ISO LIKE(Duratn_FldRef.Date#8) INZ(20240613); DCL-S DateChrISO LIKE(Duratn_FldRef.DateChr) INZ('2024-06-13'); DCL-S Err_Fmt CHAR(4) INZ('XXX'); $Date#toDate(); $Date#toDate_Errors(); $Date#toDate#(); $Date#toDate#_Errors(); $Date#toDateChr(); $Date#toDateChr_Errors(); $DateChrToDate(); $DateChrToDate_Errors(); $DateChrToDate#(); $DateChrToDate#_Errors(); $DateChrToDateChr(); $DateChrToDateChr_Errors(); $DateToDate#(); $DateToDate#_Errors(); $DateToDateChr(); $DateToDateChr_Errors(); *INLR = *ON; //************************************************************************************************** // date # to date no errors //************************************************************************************************** DCL-PROC $Date#toDate; DCL-F NumTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec); DCL-DS ds EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; CLEAR dsOut; dsDuratn_RetDate = $Duratn_ConvertToDate(Date#ISO); dsOut.ParmDate# = Date#ISO; dsOut.ExpSuccss = *ON; dsOut.RetDate = dsDuratn_RetDate.Date; dsOut.ResSuccss = dsDuratn_RetDate.Success; dsOut.ProcName = 'Date # to Date'; WRITE OutRec dsOut; SETLL ('N') NumTestCases; READE ('N') NumTestCases ds; DOW NOT %EOF; dsDuratn_RetDate = $Duratn_ConvertToDate(ds.Date# : ds.DateFmt); dsOut.ParmDate# = ds.Date#; dsOut.ParmFmt1 = ds.DateFmt; dsOut.ExpSuccss = *ON; dsOut.RetDate = dsDuratn_RetDate.Date; dsOut.ResSuccss = dsDuratn_RetDate.Success; dsOut.ProcName = 'Date # to Date'; WRITE OutRec dsOut; READE ('N') NumTestCases ds; ENDDO; END-PROC; //************************************************************************************************** // date # to date errors //************************************************************************************************** DCL-PROC $Date#toDate_Errors; DCL-F NumTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec); DCL-DS ds EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; CLEAR dsOut; dsDuratn_RetDate = $Duratn_ConvertToDate(ErrDate#); SETLL ('N') NumTestCases; READE ('N') NumTestCases ds; DOW NOT %EOF; dsDuratn_RetDate = $Duratn_ConvertToDate(ds.Date# : Err_Fmt); dsOut.ParmDate# = ds.Date#; dsOut.ParmFmt1 = Err_Fmt; dsOut.ExpSuccss = *OFF; dsOut.RetDate = dsDuratn_RetDate.Date; dsOut.ResSuccss = dsDuratn_RetDate.Success; dsOut.ProcName = 'Date # to Date'; WRITE OutRec dsOut; READE ('N') NumTestCases ds; ENDDO; SETLL ('N') NumTestCases; READE ('N') NumTestCases ds; DOW NOT %EOF; dsDuratn_RetDate = $Duratn_ConvertToDate(ErrDate# : ds.DateFmt); dsOut.ParmDate# = ErrDate#; dsOut.ParmFmt1 = ds.DateFmt; dsOut.ExpSuccss = *OFF; dsOut.RetDate = dsDuratn_RetDate.Date; dsOut.ResSuccss = dsDuratn_RetDate.Success; dsOut.ProcName = 'Date # to Date'; WRITE OutRec dsOut; READE ('N') NumTestCases ds; ENDDO; END-PROC; //************************************************************************************************** // date # to date # //************************************************************************************************** DCL-PROC $Date#toDate#; DCL-F NumTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec); DCL-F NumTestCases2 DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec2); DCL-DS dsNum EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; DCL-DS dsNum2 EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; CLEAR dsOut; SETLL ('N') NumTestCases; READE ('N') NumTestCases dsNum; DOW NOT %EOF; SETLL ('N') NumTestCases2; READE ('N') NumTestCases2 dsNum2; DOW NOT %EOF; dsDuratn_RetDate# = $Duratn_ConvertToDate#(dsNum.Date# : dsNum.DateFmt : dsNum2.DateFmt); dsOut.ParmDate# = dsNum.Date#; dsOut.ParmFmt1 = dsNum.DateFmt; dsOut.ParmFmt2 = dsNum2.DateFmt; dsOut.ExpSuccss = *ON; dsOut.RetDate# = dsDuratn_RetDate#.Date#; dsOut.ResSuccss = dsDuratn_RetDate#.Success; dsOut.ProcName = 'Date # to Date #'; WRITE OutRec dsOut; READE ('N') NumTestCases2 dsNum2; ENDDO; READE ('N') NumTestCases dsNum; ENDDO; END-PROC; //************************************************************************************************** // date # to date # errors //************************************************************************************************** DCL-PROC $Date#toDate#_Errors; DCL-F NumTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec); DCL-F NumTestCases2 DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec2); DCL-DS dsNum EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; DCL-DS dsNum2 EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; CLEAR dsOut; // date # to date#: valid date but bad format SETLL ('N') NumTestCases; READE ('N') NumTestCases dsNum; DOW NOT %EOF; SETLL ('N') NumTestCases2; READE ('N') NumTestCases2 dsNum2; DOW NOT %EOF; dsDuratn_RetDate# = $Duratn_ConvertToDate#(dsNum.Date# : Err_Fmt : dsNum.DateFmt); dsOut.ParmDate# = dsNum.Date#; dsOut.ParmFmt1 = Err_Fmt; dsOut.ParmFmt2 = dsNum.DateFmt; dsOut.ExpSuccss = *OFF; dsOut.RetDate# = dsDuratn_RetDate#.Date#; dsOut.ResSuccss = dsDuratn_RetDate#.Success; dsOut.ProcName = 'Date # to Date #'; WRITE OutRec dsOut; READE ('N') NumTestCases2 dsNum2; ENDDO; READE ('N') NumTestCases dsNum; ENDDO; SETLL ('N') NumTestCases; READE ('N') NumTestCases dsNum; DOW NOT %EOF; dsDuratn_RetDate# = $Duratn_ConvertToDate#(dsNum.Date# : dsNum.DateFmt : Err_Fmt); READE ('N') NumTestCases dsNum; ENDDO; SETLL ('N') NumTestCases; READE ('N') NumTestCases dsNum; DOW NOT %EOF; SETLL ('N') NumTestCases2; READE ('N') NumTestCases2 dsNum2; DOW NOT %EOF; dsDuratn_RetDate# = $Duratn_ConvertToDate#(ErrDate# : dsNum.DateFmt : dsNum2.DateFmt); dsOut.ParmDate# = dsNum.Date#; dsOut.ParmFmt1 = Err_Fmt; dsOut.ParmFmt2 = dsNum2.DateFmt; dsOut.ExpSuccss = *OFF; dsOut.RetDate# = dsDuratn_RetDate#.Date#; dsOut.ResSuccss = dsDuratn_RetDate#.Success; dsOut.ProcName = 'Date # to Date #'; WRITE OutRec dsOut; READE ('N') NumTestCases2 dsNum2; ENDDO; READE ('N') NumTestCases dsNum; ENDDO; END-PROC; //************************************************************************************************** // date # to date char //************************************************************************************************** DCL-PROC $Date#toDateChr; DCL-F ChrTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0A') EXTDESC('DURATNLF0A') RENAME(DURATNRC00:ChrRec); DCL-F NumTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec); DCL-DS dsChr EXTNAME('DURATNLF0A':*ALL) QUALIFIED END-DS; DCL-DS dsNum EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; CLEAR dsOut; SETLL ('N') NumTestCases; READE ('N') NumTestCases dsNum; DOW NOT %EOF; SETLL ('C') ChrTestCases; READE ('C') ChrTestCases dsChr; DOW NOT %EOF; dsDuratn_RetDateChr = $Duratn_ConvertToDateChr(dsNum.Date# : dsNum.DateFmt : dsChr.DateFmt); dsOut.ParmDate# = dsNum.Date#; dsOut.ParmFmt1 = dsNum.DateFmt; dsOut.ParmFmt2 = dsChr.DateFmt; dsOut.ExpSuccss = *ON; dsOut.RetDateChr = dsDuratn_RetDateChr.DateChr; dsOut.ResSuccss = dsDuratn_RetDateChr.Success; dsOut.ProcName = 'Date # to Date Chr'; WRITE OutRec dsOut; READE ('C') ChrTestCases dsChr; ENDDO; READE ('N') NumTestCases dsNum; ENDDO; END-PROC; //************************************************************************************************** // date # to date char errors //************************************************************************************************** DCL-PROC $Date#toDateChr_Errors; DCL-F ChrTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0A') EXTDESC('DURATNLF0A') RENAME(DURATNRC00:ChrRec); DCL-F NumTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec); DCL-DS dsChr EXTNAME('DURATNLF0A':*ALL) QUALIFIED END-DS; DCL-DS dsNum EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; CLEAR dsOut; SETLL ('N') NumTestCases; READE ('N') NumTestCases dsNum; DOW NOT %EOF; dsDuratn_RetDateChr = $Duratn_ConvertToDateChr(dsNum.Date# : dsNum.DateFmt : Err_Fmt); dsOut.ParmDate# = dsNum.Date#; dsOut.ParmFmt1 = dsNum.DateFmt; dsOut.ParmFmt2 = Err_Fmt; dsOut.ExpSuccss = *OFF; dsOut.RetDateChr = dsDuratn_RetDateChr.DateChr; dsOut.ResSuccss = dsDuratn_RetDateChr.Success; dsOut.ProcName = 'Date # to Date Chr'; WRITE OutRec dsOut; READE ('N') NumTestCases dsNum; ENDDO; SETLL ('N') NumTestCases; READE ('N') NumTestCases dsNum; DOW NOT %EOF; SETLL ('C') ChrTestCases; READE ('C') ChrTestCases dsChr; DOW NOT %EOF; dsDuratn_RetDateChr = $Duratn_ConvertToDateChr(dsNum.Date#:Err_Fmt:dsChr.DateFmt); dsOut.ParmDate# = dsNum.Date#; dsOut.ParmFmt1 = Err_Fmt; dsOut.ParmFmt2 = dsChr.DateFmt; dsOut.ExpSuccss = *OFF; dsOut.RetDateChr = dsDuratn_RetDateChr.DateChr; dsOut.ResSuccss = dsDuratn_RetDateChr.Success; dsOut.ProcName = 'Date # to Date Chr'; WRITE OutRec dsOut; READE ('C') ChrTestCases dsChr; ENDDO; READE ('N') NumTestCases dsNum; ENDDO; END-PROC; //************************************************************************************************** // date char to date //************************************************************************************************** DCL-PROC $DateChrToDate; DCL-F ChrTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0A') EXTDESC('DURATNLF0A') RENAME(DURATNRC00:ChrRec); DCL-DS ds EXTNAME('DURATNLF0A':*ALL) QUALIFIED END-DS; CLEAR dsOut; dsDuratn_RetDate = $Duratn_ConvertToDate(DateChrISO); SETLL ('C') ChrTestCases; READE ('C') ChrTestCases ds; DOW NOT %EOF; dsDuratn_RetDate = $Duratn_ConvertToDate(ds.DateChr : ds.DateFmt); dsOut.ParmDateCh = ds.DateChr; dsOut.ParmFmt1 = ds.DateFmt; dsOut.ExpSuccss = *ON; dsOut.RetDate = dsDuratn_RetDate.Date; dsOut.ResSuccss = dsDuratn_RetDate.Success; dsOut.ProcName = 'Date Chr to Date'; WRITE OutRec dsOut; READE ('C') ChrTestCases ds; ENDDO; END-PROC; //************************************************************************************************** // date char to date errors //************************************************************************************************** DCL-PROC $DateChrToDate_Errors; DCL-F ChrTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0A') EXTDESC('DURATNLF0A') RENAME(DURATNRC00:ChrRec); DCL-DS ds EXTNAME('DURATNLF0A':*ALL) QUALIFIED END-DS; CLEAR dsOut; dsDuratn_RetDate = $Duratn_ConvertToDate(ErrDateChr); SETLL ('C') ChrTestCases; READE ('C') ChrTestCases ds; DOW NOT %EOF; dsDuratn_RetDate = $Duratn_ConvertToDate(ds.DateChr : Err_Fmt); dsOut.ParmDateCh = ds.DateChr; dsOut.ParmFmt1 = Err_Fmt; dsOut.ExpSuccss = *OFF; dsOut.RetDate = dsDuratn_RetDate.Date; dsOut.ResSuccss = dsDuratn_RetDate.Success; dsOut.ProcName = 'Date Chr to Date'; WRITE OutRec dsOut; READE ('C') ChrTestCases ds; ENDDO; SETLL ('C') ChrTestCases; READE ('C') ChrTestCases ds; DOW NOT %EOF; dsDuratn_RetDate = $Duratn_ConvertToDate(ErrDateChr : ds.DateFmt); dsOut.ParmDateCh = ErrDateChr; dsOut.ParmFmt1 = ds.DateFmt; dsOut.ExpSuccss = *OFF; dsOut.RetDate = dsDuratn_RetDate.Date; dsOut.ResSuccss = dsDuratn_RetDate.Success; dsOut.ProcName = 'Date Chr to Date'; WRITE OutRec dsOut; READE ('C') ChrTestCases ds; ENDDO; END-PROC; //************************************************************************************************** // date char to date # //************************************************************************************************** DCL-PROC $DateChrToDate#; DCL-F ChrTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0A') EXTDESC('DURATNLF0A') RENAME(DURATNRC00:ChrRec); DCL-F NumTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec); DCL-DS dsChr EXTNAME('DURATNLF0A':*ALL) QUALIFIED END-DS; DCL-DS dsNum EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; CLEAR dsOut; SETLL ('C') ChrTestCases; READE ('C') ChrTestCases dsChr; DOW NOT %EOF; SETLL ('N') NumTestCases; READE ('N') NumTestCases dsNum; DOW NOT %EOF; dsDuratn_RetDate# = $Duratn_ConvertToDate#(dsChr.DateChr : dsChr.DateFmt : dsNum.DateFmt); dsOut.ParmDateCh = dsChr.DateChr; dsOut.ParmFmt1 = dsChr.DateFmt; dsOut.ParmFmt2 = dsNum.DateFmt; dsOut.ExpSuccss = *ON; dsOut.RetDate# = dsDuratn_RetDate#.Date#; dsOut.ResSuccss = dsDuratn_RetDate#.Success; dsOut.ProcName = 'Date Chr to Date #'; WRITE OutRec dsOut; READE ('N') NumTestCases dsNum; ENDDO; READE ('C') ChrTestCases dsChr; ENDDO; END-PROC; //************************************************************************************************** // date char to date # errors //************************************************************************************************** DCL-PROC $DateChrToDate#_Errors; DCL-F ChrTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0A') EXTDESC('DURATNLF0A') RENAME(DURATNRC00:ChrRec); DCL-F NumTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec); DCL-DS dsChr EXTNAME('DURATNLF0A':*ALL) QUALIFIED END-DS; DCL-DS dsNum EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; CLEAR dsOut; SETLL ('C') ChrTestCases; READE ('C') ChrTestCases dsChr; DOW NOT %EOF; dsDuratn_RetDate# = $Duratn_ConvertToDate#(dsChr.DateChr : dsChr.DateFmt : Err_Fmt); dsOut.ParmDateCh = dsChr.DateChr; dsOut.ParmFmt1 = dsChr.DateFmt; dsOut.ParmFmt2 = Err_Fmt; dsOut.ExpSuccss = *OFF; dsOut.RetDate# = dsDuratn_RetDate#.Date#; dsOut.ResSuccss = dsDuratn_RetDate#.Success; dsOut.ProcName = 'Date Chr to Date #'; WRITE OutRec dsOut; READ ChrTestCases dsChr; ENDDO; SETLL ('C') ChrTestCases; READE ('C') ChrTestCases dsChr; DOW NOT %EOF; SETLL ('N') NumTestCases; READE ('N') NumTestCases dsNum; DOW NOT %EOF; dsDuratn_RetDate# = $Duratn_ConvertToDate#(dsChr.DateChr : Err_Fmt : dsNum.DateFmt); dsOut.ParmDateCh = dsChr.DateChr; dsOut.ParmFmt1 = Err_Fmt; dsOut.ParmFmt2 = dsNum.DateFmt; dsOut.ExpSuccss = *OFF; dsOut.RetDate# = dsDuratn_RetDate#.Date#; dsOut.ResSuccss = dsDuratn_RetDate#.Success; dsOut.ProcName = 'Date Chr to Date #'; WRITE OutRec dsOut; READE ('N') NumTestCases dsNum; ENDDO; READE ('C') ChrTestCases dsChr; ENDDO; END-PROC; //************************************************************************************************** // date char to date char //************************************************************************************************** DCL-PROC $DateChrToDateChr; DCL-F ChrTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0A') EXTDESC('DURATNLF0A') RENAME(DURATNRC00:ChrRec); DCL-F ChrTestCases2 DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0A') EXTDESC('DURATNLF0A') RENAME(DURATNRC00:ChrRec2); DCL-DS dsChr EXTNAME('DURATNLF0A':*ALL) QUALIFIED END-DS; DCL-DS dsChr2 EXTNAME('DURATNLF0A':*ALL) QUALIFIED END-DS; CLEAR dsOut; SETLL ('C') ChrTestCases; READE ('C') ChrTestCases dsChr; DOW NOT %EOF; SETLL ('C') ChrTestCases2; READE ('C') ChrTestCases2 dsChr2; DOW NOT %EOF; dsDuratn_RetDateChr = $Duratn_ConvertToDateChr(dsChr.DateChr : dsChr.DateFmt : dsChr2.DateFmt); dsOut.ParmDateCh = dsChr.DateChr; dsOut.ParmFmt1 = dsChr.DateFmt; dsOut.ParmFmt2 = dsChr2.DateFmt; dsOut.ExpSuccss = *ON; dsOut.RetDateChr = dsDuratn_RetDateChr.DateChr; dsOut.ResSuccss = dsDuratn_RetDateChr.Success; dsOut.ProcName = 'Date Chr to Date Chr'; WRITE OutRec dsOut; READE ('C') ChrTestCases2 dsChr2; ENDDO; READE ('C') ChrTestCases dsChr; ENDDO; END-PROC; //************************************************************************************************** // date char to date char //************************************************************************************************** DCL-PROC $DateChrtoDateChr_Errors; DCL-F ChrTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0A') EXTDESC('DURATNLF0A') RENAME(DURATNRC00:ChrRec); DCL-F ChrTestCases2 DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0A') EXTDESC('DURATNLF0A') RENAME(DURATNRC00:ChrRec2); DCL-DS dsChr EXTNAME('DURATNLF0A':*ALL) QUALIFIED END-DS; DCL-DS dsChr2 EXTNAME('DURATNLF0A':*ALL) QUALIFIED END-DS; CLEAR dsOut; // date Chr to dateChr: valid date but bad format SETLL ('C') ChrTestCases; READE ('C') ChrTestCases dsChr; DOW NOT %EOF; SETLL ('C') ChrTestCases2; READE ('C') ChrTestCases2 dsChr2; DOW NOT %EOF; dsDuratn_RetDateChr = $Duratn_ConvertToDateChr(dsChr.DateChr : Err_Fmt : dsChr2.DateFmt); dsOut.ParmDateCh = dsChr.DateChr; dsOut.ParmFmt1 = Err_Fmt; dsOut.ParmFmt2 = dsChr2.DateFmt; dsOut.ExpSuccss = *OFF; dsOut.RetDateChr = dsDuratn_RetDateChr.DateChr; dsOut.ResSuccss = dsDuratn_RetDateChr.Success; dsOut.ProcName = 'Date Chr to Date Chr'; WRITE OutRec dsOut; READE ('C') ChrTestCases2 dsChr2; ENDDO; READE ('C') ChrTestCases dsChr; ENDDO; SETLL ('C') ChrTestCases; READE ('C') ChrTestCases dsChr; DOW NOT %EOF; dsDuratn_RetDateChr = $Duratn_ConvertToDateChr(dsChr.DateChr : dsChr.DateFmt : Err_Fmt); dsOut.ParmDateCh = dsChr.DateChr; dsOut.ParmFmt1 = dsChr.DateFmt; dsOut.ParmFmt2 = Err_Fmt; dsOut.ExpSuccss = *OFF; dsOut.RetDateChr = dsDuratn_RetDateChr.DateChr; dsOut.ResSuccss = dsDuratn_RetDateChr.Success; dsOut.ProcName = 'Date Chr to Date Chr'; WRITE OutRec dsOut; READE ('C') ChrTestCases dsChr; ENDDO; SETLL ('C') ChrTestCases; READE ('C') ChrTestCases dsChr; DOW NOT %EOF; SETLL ('C') ChrTestCases2; READE ('C') ChrTestCases2 dsChr2; DOW NOT %EOF; dsDuratn_RetDateChr = $Duratn_ConvertToDateChr(ErrDateChr : dsChr.DateFmt : dsChr2.DateFmt); dsOut.ParmDateCh = ErrDateChr; dsOut.ParmFmt1 = dsChr.DateFmt; dsOut.ParmFmt2 = dsChr2.DateFmt; dsOut.ExpSuccss = *OFF; dsOut.RetDateChr = dsDuratn_RetDateChr.DateChr; dsOut.ResSuccss = dsDuratn_RetDateChr.Success; dsOut.ProcName = 'Date Chr to Date Chr'; WRITE OutRec dsOut; READE ('C') ChrTestCases2 dsChr2; ENDDO; READE ('C') ChrTestCases dsChr; ENDDO; END-PROC; //************************************************************************************************** // date to date # //************************************************************************************************** DCL-PROC $DatetoDate#; DCL-F NumTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec); DCL-DS ds EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; CLEAR dsOut; dsDuratn_RetDate# = $Duratn_ConvertToDate#(DateType); SETLL ('N') NumTestCases; READE ('N') NumTestCases ds; DOW NOT %EOF; dsDuratn_RetDate# = $Duratn_ConvertToDate#(DateType : ds.DateFmt); dsOut.ParmDate = DateType; dsOut.ParmFmt1 = ds.DateFmt; dsOut.ExpSuccss = *ON; dsOut.RetDate# = dsDuratn_RetDate#.Date#; dsOut.ResSuccss = dsDuratn_RetDate#.Success; dsOut.ProcName = 'Date to Date #'; WRITE OutRec dsOut; READE ('N') NumTestCases ds; ENDDO; END-PROC; //************************************************************************************************** // date to date # errors //************************************************************************************************** DCL-PROC $DatetoDate#_Errors; DCL-F NumTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0B') EXTDESC('DURATNLF0B') RENAME(DURATNRC00:NumRec); DCL-DS ds EXTNAME('DURATNLF0B':*ALL) QUALIFIED END-DS; CLEAR dsOut; dsDuratn_RetDate# = $Duratn_ConvertToDate#(DateType : Err_Fmt); dsOut.ParmDate = DateType; dsOut.ParmFmt1 = Err_Fmt; dsOut.ExpSuccss = *OFF; dsOut.RetDate# = dsDuratn_RetDate#.Date#; dsOut.ResSuccss = dsDuratn_RetDate#.Success; dsOut.ProcName = 'Date to Date #'; WRITE OutRec dsOut; END-PROC; //************************************************************************************************** // date to date chr //************************************************************************************************** DCL-PROC $DatetoDateChr; DCL-F ChrTestCases DISK USAGE(*INPUT) KEYED EXTFILE('DURATNLF0A') EXTDESC('DURATNLF0A') RENAME(DURATNRC00:ChrRec); DCL-DS dsChr EXTNAME('DURATNLF0A':*ALL) QUALIFIED END-DS; CLEAR dsOut; dsDuratn_RetDateChr = $Duratn_ConvertToDateChr(DateType); SETLL ('C') ChrTestCases; READE ('C') ChrTestCases dsChr; DOW NOT %EOF; dsDuratn_RetDateChr = $Duratn_ConvertToDateChr(DateType : dsChr.DateFmt); dsOut.ParmDate = DateType; dsOut.ParmFmt1 = dsChr.DateFmt; dsOut.ExpSuccss = *ON; dsOut.RetDateChr = dsDuratn_RetDateChr.DateChr; dsOut.ResSuccss = dsDuratn_RetDateChr.Success; dsOut.ProcName = 'Date to Date Chr'; WRITE OutRec dsOut; READE ('C') ChrTestCases dsChr; ENDDO; END-PROC; //************************************************************************************************** // date to date chr error //************************************************************************************************** DCL-PROC $DatetoDateChr_Errors; CLEAR dsOut; dsDuratn_RetDateChr = $Duratn_ConvertToDateChr(DateType : Err_Fmt); dsOut.ParmDate = DateType; dsOut.ParmFmt1 = Err_Fmt; dsOut.ExpSuccss = *OFF; dsOut.RetDateChr = dsDuratn_RetDateChr.DateChr; dsOut.ResSuccss = dsDuratn_RetDateChr.Success; dsOut.ProcName = 'Date to Date Chr'; WRITE OutRec dsOut; END-PROC;