Exporting sas dataset to xml file

Reply
Contributor
Posts: 26

Exporting sas dataset to xml file

Hi community,

 

I have a problem in converting my sas dataset to xml.

I have a sas dataset of 24 observations and 242 variables out of which 100 variables have labels while exporting them into xml i am unable to get labels in my xml doc i.e., it is showing the original names but i want the labels to be displayed in my xml.

PLEASE HELP ME.

by the way i am using sas 9.4 and xml engine along with libname statement for converting from sas dataset to xml.

 

Thanks in advance

Grand Advisor
Posts: 10,210

Re: Exporting sas dataset to xml file

Please post the code used for your export. It may be that you are only missing an option but without a starting point there may be some confusion interpretting suggestions.

 

Contributor
Posts: 26

exporting SAS dataset to Xml

Hi community,

 

I have a problem in converting my sas dataset to xml.

I have a sas dataset of 24 observations and 242 variables out of which 100 variables have labels while exporting them into xml i am unable to get labels in my xml doc i.e., it is showing the original names but i want the labels to be displayed in my xml.

PLEASE HELP ME.

by the way i am using sas 9.4 and xml engine along with libname statement for converting from sas dataset to xml.

 

Thanks in advance

 

Grand Advisor
Posts: 10,210

Re: exporting SAS dataset to Xml

Please post topic questions in one of the other forum areas. Community matters is intended for how the forum operates.

 

Also please only post a topic in one location. If it should be in another area it may be moved as needed. Multiple posts have issues with dealing with the same questions in each thread because not every responder follows all areas.

Contributor
Posts: 26

Re: exporting SAS dataset to Xml

Thanks for the suggestion ballardw

But thats not what i am looking for

Grand Advisor
Posts: 10,210

Re: exporting SAS dataset to Xml

You said in part:

., it is showing the original names but i want the labels to be displayed in my xml.

 

How did you generate that output? Yes it did not do what you requested. BUT you may have been very close. Instead of starting from scratch for an approach that is completely guessing what you may have attempted.

Grand Advisor
Posts: 9,571

Re: Exporting sas dataset to xml file

You can rename it into its label, but it has 32 character limited.

 

options validvarname=any;
data class;
 set sashelp.class;
 rename name='xxxx  yyyy'n;
run;
libname xx xml '/folders/myfolders/have.xml';
proc copy in=work out=xx ;
 select class;
run;
Ask a Question
Discussion stats
  • 6 replies
  • 356 views
  • 0 likes
  • 3 in conversation