<<< Click here to go back
Dissection of date into Day, Month and Year
Extraction of Day, Month and Year off the date :
Data Data_wid_dates;
input DOB : date9.;
format DOB date9.;
Month = Month(DOB);
Year = year(DOB);
cards;
23Jan2014
01Feb1961
01Jan1960
02Jan1960
31Dec1959
;
Proc Print;
Run;
Making a Date
How to write a Date in SAS
You write in like >>> 'DDMONYYYY'd
Data particular_date;
input dob : date9.;
format DOB date9.;
if DOB = '01Feb1961'd;
23Jan2014
01Feb1961
01Jan1960
02Jan1960
31Dec1959
;
proc Print;
Run;
That's all for this one, soon we will come up with more blogs on date functions for grown ups.
Enjoy reading our other articles and stay tuned with us.
Kindly do provide your feedback in the 'Comments' Section and share as much as possible.
No comments:
Post a Comment
Do provide us your feedback, it would help us serve your better.