Restoring an XML Document as a Data Set at a Target Machine


Using a DATA Step to Restore a Data Set From an XML Document

The following 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 where the converted SAS data set will be copied to. 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.

Using PROC COPY to Restore a Data Set From an XML Document

The following 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 where the contents of the XML document will be copied to. 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.




Moving and Accessing SAS 9.1 Files
Moving And Accessing SAS 9.1 Files
ISBN: 1590472306
EAN: 2147483647
Year: 2004
Pages: 109
Authors: SAS Institute

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net