“It’s the age of the search engine! I remember people ‘Yahoo!’ing during the late 90's and ‘Google’ing till the late 2k's and now ‘Bing’ing. I just wondered, ‘Why not SAS?’” wrote Pramod. R on his blog SASopedia. This was the beginning of a quest and a MidWest SAS Users Groups 2012 paper.
Pramod. R, from the Target Corporation in Minneapolis, began learning SAS six years ago and initially worked a lot on reporting data – “pulling up the report in Excel, PDF, RTF or things like that.” According to Pramod. R, his work was difficult and time consuming until he learned of stored process. Now he can create a stored process and send it out to users, so that they can change the parameters and variables. Pramod. R says this brings in a new way of reporting for him.
"There was another feature in SAS, which I discovered and have been using more often that came out in SAS 9.2,” he said. “With the two new procedures that were introduced in SAS 9.2 – PROC HTTP and PROC SOAP, we can really interact with the web with in a much more integrated way and with more parameters.”
Parmod. R used both of his new-found SAS features and the Google Custom Search API to create a Search Engine in SAS.
The Google Custom Search API enables you to search the web, retrieve the results of the custom search and embed them in the desired format.
You need to create a key to use the API in SAS, and of course Pramod. R includes all of the instructions for that in his paper. The code and instructions for creating the custom search engine are in Pramod. R’s paper, “Search Engine Using SAS®.”
The output is originally delivered in XML format, but it is read into a data set using the index function. “This step does a bit of data cleaning, and then constructs an HTML page using SAS,” says Pramod. R.
The HTML page is a beautiful presentation of hyperlinked titles from Google. Why use this since it is still using the Google search engine? “We have a lot of information on the Web, for instance the stock market data or the scores of the Twin Cities games. We may want to do an analysis on that, but there wouldn’t be an option to export that data directly from Google.”
Download Pramod. R’s paper and all of the MWSUG 2012 papers, now.