01-17-2017 12:09 PM
I'm trying to manually create some rows in a table, with the insert to statement, coded looks like this:
insert into lib.table values(
My question is, how do I insert a date such as (01JAN2017) so that it is a valid SAS date?
Thanks in advance.
01-17-2017 02:14 PM
Thank you for your help, Shmuel, the answer you provided is correct.
However, it made me figure out that the column I'm trying to fill is actually datetime with a format of DATETIME22.3
I tried adjusting your solution to '01jan2017'dttm but it did not work.
01-17-2017 03:36 PM
Please don't be a lazy programmer and name datetime values as dates. When crossing the boundary to SAS the values are quite different and functions/actions that will work on DATES will either fail or create very unexpected results when used with DATETIMES (and vice versa).
01-17-2017 03:41 PM
@Datino - if you decide to convert datetime to date use next code to do it:
date_var = datepart(datetime_var);
format date_var date9.;
Need further help from the community? Please ask a new question.