Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SAS Specific Date format

Tags:

date

format

sas

I've found several questions regarding SAS dates in this forum, but i haven't been able to find the answer to this one. I think it is rather simple, but i can't get it right.

I have a data set with a date (DD-MM-YYYY) which for some reason has a Character format. I would like it to be translated into a date format (YYYY-MM-DD). I can get it to 'look' right by by separating and concatenating the parts, but, then i can't get the format right.

like image 888
E_T Avatar asked Mar 17 '26 17:03

E_T


1 Answers

Use the input() function with an appropriate informat:

datevariable=input(textvariable,ddmmyy10.);

like image 139
Vicky Avatar answered Mar 20 '26 22:03

Vicky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!