i'm trying to pull data from the web (via rss) directly into a dataset. i've got that so far:
but now i have to download the xml file and than parse it. in another script i've testet this:
which works okay, but the script puts every data in one column (xml). can someone help me to combine those scripts, so that i can pull the data directly from the web and have serveral columns for each information? additionally i would like to add an id (autoincrement-like) to each row.
thank u for every hint ;)
I think this best way to approach this is with the XML libname and an XML map.
You can assign your RSS feed to a library like this:
Where "bounce" and "xml_map" are filenames you've set up.
You an create XMl maps using the SAS XML Mapper tool, details of which can be found in the following paper: http://www2.sas.com/proceedings/sugi29/119-29.pdf
One thing you'll notice quite quickly if you try to map this RSS feed is that it doesn't have a unique top level element. This is a problem, as SAS expects one.
You can get around this by re-formatting the XML before reading it in throug the map, the simplest approach is just to delete all lines until you find a useful top level element.
A basic program to do all this would look a bit like this:
Oh yes, you can define a column with "class=ordinal" to count elements too!
Hope that helps, -- Will
answered 31 Jan '12, 06:43
thank u very much!!
answered 07 Feb '12, 05:14