Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
YESTERDAY:PGM
/* DO NOT EXECUTE ON JANUARY, 1 */
DCL VAR(&DATE) TYPE(*CHAR) LEN(6)
DCL VAR(&YYYYDDD) TYPE(*CHAR) LEN(7)
DCL VAR(&JULIAN) TYPE(*DEC) LEN(7)
/* RETRIEVE CURRENT DATE */
RTVSYSVAL SYSVAL(QDATE) RTNVAR(&DATE)
/* CONVERT TO JULIAN DATE FORMAT */
CVTDAT DATE(&DATE) TOVAR(&YYYYDDD) FROMFMT(*SYSVAL) +
TOFMT(*LONGJUL) TOSEP(*NONE)
CHGVAR VAR(&JULIAN) VALUE(&YYYYDDD)
/* SUBTRACT 1 DAY */
CHGVAR VAR(&JULIAN) VALUE(&JULIAN - 1)
CHGVAR VAR(&YYYYDDD) VALUE(&JULIAN)
CVTDAT DATE(&YYYYDDD) TOVAR(&DATE) +
FROMFMT(*LONGJUL) TOFMT(*SYSVAL) TOSEP(*NONE)
SNDPGMMSG MSG('Yesterday = ' *CAT &DATE)
END: ENDPGM