XML Engine with DATA Step or PROC COPY |
Example: Using a DATA Step to Restore a Data Set from an XML Document |
This example uses the DATA step to restore a data set from an XML document.
libname xmlin xml 'XML-document'; libname target 'SAS-data-library'; data target.grades; set xmlin.grades; run;
In the preceding example, the libref XMLIN points to the location of an XML document. The XML engine specifies that a SAS data set is to be read. The libref TARGET points to the location to which the converted SAS data set will be copied. The SET statement reads the data set XMLIN.GRADES in XML format, translates it, and copies it to the location that is specified in the DATA statement.
Example: Using PROC COPY to Restore a Data Set from an XML Document |
This example uses the COPY procedure to restore a data set from an XML document.
libname xmlin xml 'XML-document'; libname target 'SAS-data-library'; proc copy in=xmlin out=target; run;
In the preceding example, the libref XMLIN points to the location of an XML document. The XML engine specifies that the XML document is to be read in XML format. The libref TARGET points to the location to which the contents of the XML document will be copied. The PROC COPY statement copies the contents of the library that is specified in the IN= option to the library that is specified in the OUT= option.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.