Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

convert datetime to date in proc-sql sas [duplicate]

Tags:

sas

proc-sql

I'm trying to convert datetime22.3 variable to ddmmmyy10. in proc sql, this is giving me ****** in the output column.

How can I get the correct values in the output column?

like image 334
staq Avatar asked Dec 06 '22 00:12

staq


1 Answers

You need to convert original SAS DATETIME value (think of it as data type) to SAS DATE value using DATEPART() function and apply appropriate format:

proc sql; 
 create table work.abc 
 as select DISTINCT a.Account_Id,
  DATEPART(a.Billing_Dt) format ddmmyy10. as Bill_date
from abc table;
quit;
like image 128
vasja Avatar answered Dec 28 '22 20:12

vasja