Published on :
ETL CREATION_INTERNE

Data Generation and Export to XML

This code is also available in: Deutsch Español Français
Awaiting validation
The script assigns a library named 'test' using the XML engine. It then executes a DATA step to create a 'sample' table containing one observation with static data (name, age, sex, phone, country). Writing to the 'test' library generates or updates the target XML file. Finally, the library is released. Technical note: The path 'c:\test.xml' is specific to Windows and would require adaptation to run correctly on a SAS© Viya server (usually under Linux).
Data Analysis

Type : CREATION_INTERNE


Data is generated by direct assignment statements within the DATA step.

1 Code Block
LIBNAME
Explanation :
Definition of a SAS library 'test' associated with the XML engine pointing to a local file.
Copied!
1LIBNAME test xml 'c:\test.xml' ;
2 Code Block
DATA STEP Data
Explanation :
Creation of the 'sample' table in the XML library. The DATA step defines columns and inserts a data row.
Copied!
1DATA test.sample ;
2 name='Phil Mason' ;
3 age=40 ;
4 sex='M' ;
5 phone='01491 824905' ;
6 country='England' ;
7RUN ;
3 Code Block
LIBNAME
Explanation :
De-assignment of the 'test' library to release the XML file.
Copied!
1LIBNAME test ;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.