BookmarkSubscribeRSS Feed
shlomiohana
Obsidian | Level 7

Hello,
I want to create an xml file from a SAS table with a hierarchy. 
The table has the following 8 fields:
atmld, bankcode, bankbranchcode, schum, dt, monthreport, cuerrentdate, factorcode.
Example of how I would like the xml file to be displayed.

shlomiohana_1-1635100430320.jpeg


I will ask for your help on how to write the code.

1 REPLY 1
Cynthia_sas
Diamond | Level 26
Hi:
The ways I know about are:
1) using the XML Libname engine with an XML Map
2) using the XML Libname engine with an XSL Schema
3) using a DATA step program
4) writing a custom tagset template
You would need to read about how the XML Libname Engine works by default and then figure out which method works best for you. Seeing a copy of the final XML is useful, but without a sample of data, to see the structure of the current SAS data set, it is hard to make any constructive suggestions.
Documentation for the XML Libname engine is here: https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/engxml/titlepage.htm and an XML Map paper is here: https://support.sas.com/resources/papers/proceedings13/124-2013.pdf that shows the use of an XML Map for both import and export.

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
  • 534 views
  • 0 likes
  • 2 in conversation