BookmarkSubscribeRSS Feed
neilxu
Calcite | Level 5
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.
1 REPLY 1
Cynthia_sas
Diamond | Level 26
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

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
  • 1 reply
  • 1578 views
  • 0 likes
  • 2 in conversation