02-24-2015 02:55 PM
I have a set of time series of date data (see below). But the type of data is 'Numerical', the Format is 'Best12.' and informat is 12.''. When I use the code 'year(date)', I get wrong outcome. How to manipulate these date data if I want to get '1960 for year and 01 for month of first obs' using codes 'year(date) and month(date)'? Thanks
02-25-2015 03:46 AM
We can also use the below approach .
data have ;
input date ;
year = input(substr(strip(date),1,4),6.);
Need further help from the community? Please ask a new question.