If you add the PRINTALL option in the FORECAST statement, then the one-step-ahead predicted values for your historical data will also be displayed by PROC ARIMA. Note that the predicted value for 2010 cannot be computed since differencing is specified, but all other predicted values are displayed by PRINTALL for years 2011-2016, in addition to the multistep forecasts beyond the end of the data. If you want to save the one-step-ahead predicted values and multistep forecasts to a data set, then you can also add the OUT= option to the FORECAST statement.
Following, please find a modified version of your code which reads in the YEAR and STOCK, creates a SAS date variable from YEAR via the MDY function, fits your model and forecasts 4 years into the future. The ID= and INTERVAL= options in the FORECAST statement are used to extrapolate the values of the DATE variable for your LEAD= forecast horizon.
data stock;
input year stock;
date=mdy(1,1,year); /* create SAS date variable from YEAR */
format date year4.;
datalines;
2010 582
2011 685
2012 562
2013 684
2014 721
2015 653
2016 586
;
proc arima data=stock;
identify var=stock(1);
estimate p=1;
forecast printall lead=4 id=date interval=year out=stock_fcst;
run;
quit;
proc print data=stock_fcst;
run;
I hope this helps!