The SAS Output Delivery System and reporting techniques

export dataset to xml

Reply
Contributor
Posts: 33

export dataset to xml

Hey All,

I am trying to export a dataset to XML.

I am able to create XML like this:


xxx
xxx


But the layout is not quite what I want. How can I create XML like this:

xxx

xxx



I tried to use XMLMap but don't know how to generate map file.
SAS Super FREQ
Posts: 8,861

Re: export dataset to xml

Hi:
In SAS 9.1.3 and the SAS XML Libname Engine (SXLE), you can only use an XML Map for import (from XML to SAS). With SAS 9.2 and the SAS XML Libname Engine (SXLE) you can use an XML Map for both import (XML to SAS) and export (SAS to XML).

Documentation for SXLE can be found here:
http://support.sas.com/rnd/base/xmlengine/index.html (pick your version) and the "what's new" for SAS 9.2 outlines the new features in SAS 9.2:
http://support.sas.com/documentation/cdl/en/whatsnew/62580/HTML/default/engxmlwhatsnew902.htm

For specifics on which features are still "pre-production", refer to this Tech Support note:
http://support.sas.com/kb/33/793.html

If you are still running SAS 9.1.3, then your only method for creating custom (hierarchical) XML (such as what you show in your post with the inclusion of the <personal_info> tag) is to create a custom tagset template for use with SXLE, as described here:
http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/a002565723.htm
or in these user group papers:
http://www.lexjansen.com/pharmasug/2006/technicaltechniques/tt24.pdf
http://www2.sas.com/proceedings/sugi29/119-29.pdf

And, on using the XML Mapper to create an XML Map file for use with SXLE refer to these links:
http://www2.sas.com/proceedings/sugi30/099-30.pdf
http://analytics.ncsu.edu/sesug/2007/CC12.pdf
http://www.lexjansen.com/pharmasug/2004/handsonworkshops/hw03.pdf

cynthia
Ask a Question
Discussion stats
  • 1 reply
  • 363 views
  • 0 likes
  • 2 in conversation