Hi,
While I export I want the datetime to appear as it is in the dataset. But I get only the dates but the formulae bar shows the datatime..
How can I get it inside of the cells??
Thanks
I believe so, but you need to have something like this:
ods tagsets.excelxp options(sheet_label = "&sheet_Name" );
Hi.
You may want to try ods tagsets.excelxp instead of proc export.
So, you could do something like this:
ods tagsets.excelxp file = "....\my_file.xls";
proc print data = your_data;run;
ods tagsets.excelxp close;
Good luck.
Anca.
Hi ,
If I use tagsets can I also export different datasets to the same Excel sheet??
Thanks
I believe so, but you need to have something like this:
ods tagsets.excelxp options(sheet_label = "&sheet_Name" );
Could you provide your export code segment with an example of a cell/formulae cell/dataset record triplet?
Hi ,
Please find the code
%macro export(dsname,sheet_Name);
proc export data=&dsname
outfile="location\data.xls"
dbms=excel replace;
sheet=&sheet_Name;
run;
%mend;
Regards
Sorry, I had to figure out how to use the options(sheet_label...);
So here is something that could work:
%macro export();
ods tagsets.excelxp file = "&file_path.\my_file.xls" ;
%do i = 1 %to 4;
ods tagsets.excelxp options(sheet_label = "sheet_Name_&i" ); ;
proc print data = &dsname.;run;
%end;
ods _all_ close;
%mend;
%export();
So, you first initialize (or whatever the word is) the ODS TAGSETS.EXCELXP file=....
Then you use another ODS TAGSETS.EXCELXP OPTIONS(sheet_label...) for each of your export...
I hope this helps.
Anca.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.