Return to the RPG Tips
Retrieve Date String (submitted by Petre Drula)
*? Arrays Description D DayArray S 9 Dim(7) CtData PerRcd(1) Days Array D MonthArray S 9 Dim(12) CtData PerRcd(1) Months Array *? Retrieve current system date D DS DWorkDate D DatFmt(*ISO) Inz(*sys) Current System Date D Year# 4 0 Overlay(WorkDate) Current Year D Month# 2 0 Overlay(WorkDate:6) Current Month D Day# 2 0 Overlay(WorkDate:9) Current Day *? Program work fields D DateWrkFld S 5 0 Date Work Field D WeekDay# S 1 0 Day # within week D DateString S 31 Date String *+Get the current day of the week C WorkDate Subdur D'1900-01-01' DateWrkFld:*D C Eval WeekDay# = %REM(DateWrkFld:7) + 1 *+Set the date string C Eval DateString = %Trim(DayArray(WeekDay#)) + C ', ' + %Trim(MonthArray(Month#)) + ' ' + C %Char(Day#) + ', ' +%Char(Year#) * *** C Seton LrRt ** Monday Tuesday Wednesday Thursday Friday Saturday Sunday ** January February March April May June July August September October November December
[report a broken link by clicking here]