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
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1209 views
  • 0 likes
  • 2 in conversation