BookmarkSubscribeRSS Feed
HannaZhang
Obsidian | Level 7

Hi,all

  I have a dataset(PC3_sort) wihout observation,there are many variables with Chinese label in this dataset,

I want to export this datasets in XML format  like this

excel.png

I had trying with the fllowing code,but it is a Blank Excel;Please help me out. Thank you.

ods listing close;
title "Custom Excel Output";
ods tagsets.DEFAULT file="F:\offline listing\Documents\listing\LIS55_10周期以后PK采集给药周期的核查.xml";
proc print data=PC3_sort  label;
   var  _all_;
run;

 

 

5 REPLIES 5
ChrisNZ
Tourmaline | Level 20

I can't use Chinese characters in my code as my server is configured in latin1, but this works fine for me:

ods escapechar='^'; 
ods tagsets.default file="%sysfunc(pathname(WORK))\ods_default.xml";
ods tagsets.excelxp file="%sysfunc(pathname(WORK))\ods_excelxp.xls";
proc print data=sashelp.class  label;
  label age="^{unicode 4F02}";
run;
ods listing close;

Capture.PNG

Capture.PNG

HannaZhang
Obsidian | Level 7

11.png

I choose YES ,then opened this excel,it is empty.

I don't know where the problem is.

ChrisNZ
Tourmaline | Level 20

what does the file look like in a text editor?

HannaZhang
Obsidian | Level 7
text editor?
ChrisNZ
Tourmaline | Level 20

A text editor like notepad.

Have at least one observation in your table. Populate the variables with spaces if needed.

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1083 views
  • 0 likes
  • 2 in conversation