Dates From Datetimes
Sunday, 28 October, 2012
⨳ 1 minute read ⨳ 64 words ⨳ date values ⨳ function ⨳ sas ⨳ technical debt ⨳Browsing online to find examples of creating a JSON file from a SAS data set I came across a monstrosity for extracting a date value from a date time value.
end_dt=input(substr(put(s_end_dt,datetime20.),3,9),date9.);
I cringed and made a sound befitting of a good Halloween costume. Here’s my typical approach for this:
end_dt=datepart(s_end_dt);
Either way, I guess.