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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.