11-15-2012 05:39 PM
As far as I know you can't directly export to Excel but there is a way to do that using PROC EXPORT.
The SAS/IML code that you should use is:
d = 0.4;
call farmasim(yt, d) n=10 sigma=2 seed=123457;
* Creates the dataset yt in the work library;
create work.yt from yt;
append from yt;
* Execute the code defined in the main module;
Once the dataset is in the work directory you can use PROC EXPORT. If you have SAS Interface to Microsoft products you will be able to export directly to Excel (*.xls file), if not you will be still able to export a CSV (directly readable in Excel). This is possible because SAS foundation includes SAS Interface to PC FILES.
In order to see if SAS Interface to Microsoft Office is included in your licence you can try to run this procedure and check in the log if you can find the interface:
* This procedure is going to create a CSV file in C: directory. If you want to create an Excel file you can change the extension to .xls;
proc export outfile="C:\yt.csv"
data = work.yt
Hope it helps!