With Dialog Manager variables, date manipulation isn't pleasent, here's a solution.
The DATECVT function is used to convert the Dialog Manager variable to Date Format. The # of days is subtracted and the Date Format is converted back to a Dialog Manager variable containing text.
The CHGDAT function converts the YYYYMMDD formatted date (YYMD in FOCUS parlance) to Month DD YYYY format (MXDYY). Then this uppercase Date is converted to Mixed Case.
-SET &ECHO = 'ALL';
-*-- Set up Default Date -----------------------------------
-SET &RUN_DATE = &YYMD;
-*-DEFAULT &RUN_DATE = '&YYMD.EVAL;';
-*-- Set up Date Range -------------------------------------
-SET &FR_DT =
- DATECVT((DATECVT(&RUN_DATE,'I8YYMD','YYMD') - 8), 'YYMD','I8YYMD');
-SET &TO_DT =
- DATECVT((DATECVT(&RUN_DATE,'I8YYMD','YYMD') - 3), 'YYMD','I8YYMD');
-*-- Convert to Friendly Date ------------------------------
-SET &FR_DTY = CHGDAT('YYMD', 'MXDYY', &FR_DT, 'A17');
-SET &TO_DTY = CHGDAT('YYMD', 'MXDYY', &TO_DT, 'A17');
-*-- Convert To Mixed Case ---------------------------------
-SET &FR_DTX = LCWORD(&FR_DTY.LENGTH, &FR_DTY, 'A17');
-SET &TO_DTX = LCWORD(&FR_DTY.LENGTH, &TO_DTY, 'A17');
-TYPE &RUN_DATE
-TYPE &FR_DT / &FR_DTY / &FR_DTX
-TYPE &TO_DT / &TO_DTY / &TO_DTX
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server