Tuesday, July 1, 2008

sas dates

Dealing with SAS dates can be tricky, particularly if you're migrating your data between different analysis platforms (SAS in UNIX, R, JMP, etc.

In order to convert a date into the sasdate, you can use one of 2 methods, depending on whether the variable was read in as a character or numeric variable.

method 1: newsasdate=input(olddate, date11.);

method 2:newsasdate=input(put(olddate, Z6.) ddmmyy6.