Hello!
I am seeking some assistance with the best formatting for date/time in SAS University Edition and with code to calculate time intervals between 2 date/times.
I have data with initial enrolment dates for people in a study, and then dates for tests. These are currently in Excel in a variety of date formats, e.g.,
dd-mm-yyyy and separately 00:00
dd/mm/yyyy and separately 00:00
yyyy-mm-dd 00:00
Sep dd yyyy 00:00:00
yyyy-mm-dd and separately 00:00:00
I want to reformat all of the dates so they are consistent. On searching SAS help online, it seems as though reformatting to 17MAR00:00:00:00 is appropriate, and I have started to attempt to do this manually. I am wondering if anyone can confirm that this is the best way to reformat for SAS University Edition?
Also, I would like to then calculate the time in minutes between 2 dates. From what I have read it appears that the INTCK function is appropriate for this, but it did not seem to work in SAS UE. I am not sure if it was just the way I wrote the code.
I did the following:
data xxtest2;
set xxtest;
by SPCODE;
days=intck('dtminute', ADM_DT, COL_DT);
put minutes=;
run;
Many thanks in advance for any assistance with this.