@AshokD
When running your code on a recent SAS version under RHEL using EG8.2 the code executes without errors but the Excel file created is somehow corrupted and I can't open it with a recent Excel version.
May be your EG is configured to something which tries to open this Excel automatically and that's when things go wrong.
I still get the error when using .xlsx and when defining a fully valid output path.
If you're on SAS 9.4 then try using the more modern ODS EXCEL destination.
Below code sample should work for you. Just change %let out_path=~;
to a path valid in your environment. The currently used ~ is a shortcut for a Unix home directory.
ods _all_ close;
data class;
set sashelp.class;
format age z6.;
run;
%let out_path=~;
ods excel
file="&out_path/Batch.xlsx"
style=sansprinter
options(
start_at="1,1"
frozen_headers="1"
frozen_rowheaders="1"
autofilter="all"
sheet_name="Class"
formulas="off"
/*row_repeat="2"*/
/*embedded_titles="yes"*/
)
;
proc print data=class style(data)={TAGATTR='type:String'} noobs;
var name sex age Height;
run;
ods excel close;
ods listing;