Dear all,
I am new to SAS have a question regarding the processing of date time in SAS. My data variable is formatted as follows:
1920/11/1 0:00
1920/11/21 0:00
1920/5/15 0:00
1920/8/27 0:00
1921/7/14 0:00
1921/7/26 0:00
1921/8/2 0:00
1922/2/12 0:00
1922/2/22 0:00
1923/11/1 0:00
1923/12/3 0:00
1923/2/13 0:00
So they are of irregular lengths and as I understand they do not fit any of the SAS built-in format. They do not have "0"s before or behind the single-digit months or dates.
The result I am expecting is to 1) get rid of the last 5 digits of the clock time; 2) transform the date variable into standard format and then SAS date values (days comparing with Jan/01/1960) and 3) generate 2 variables that display the month and day of the date variable in readable format (but still calculatable).
Example:
Original date variable: 1921/7/14 0:00
Converted into 1921/07/14 which is about negative sth SAS date value
monthvar: 1921/07
datevar: 1921/07/21
Not really sure how to achieve that, especially with the irregular format. Please help! Thanks a lot!
Ginny Han