Tuesday, November 10, 2009

Using Multiple Selection Prompts in SAS Stored Process Code

It is definitely easier to force single selections for prompts used in SAS Stored Processes, however it isn't very usable when the majority of users need to select multiple values. For example, let us say we create a prompt for region (called 'region_prompt') and then use that in the query of sashelp.shoes.

Forcing only 1 selection to write to the macro &region_prompt the resulting SQL query would look like:
     proc sql; create table test as select * from sashelp.shoes where shoes.region="&region_prompt";  
     quit;
Pretty simple really.

Now if we allow users to select 1 or more values for region, SAS creates a macro with the same name but adding the term _Count. Such as &region_prompt_count, this represents the amount of selections the user chose. Therefore the SQL query needs to take all of these selections into account. ALSO - if only 1 selection is chosen, there is no &region_prompt1 - so you must account for that as well.
Here is an example:
     proc sql; create table test as select * from sashelp.shoes
             where shoes.region in (
             %if &REGION_PROMPT_COUNT = 1 %then 
                            "&Region_Prompt";
             %else %do i=1 %to &REGION_PROMPT_COUNT;
                         "&&Region_Prompt&i"
             %end;
              );
    quit;

Reference: Overview of Input Parameters http://support.sas.com/documentation/cdl/en/stpug/61271/HTML/default/a003152642.htm

Monday, November 09, 2009

Mapping ESRI Style

The SAS Business Intelligence suite includes the ability to map data via the ESRI Map Service within various web clients (and even Enterprise Guide).



Steps:
  1. Create an ESRI Map via ArcMap
  2. Publish to ArcGIS Server via ArcCatalog
  3. Define a New Map Service in SAS Management Console
  4. Set a cube dimension as 'GEO' and link the source data for the cube to the source data for the ESRI Map
  5. View the Map via Web Report Studio or Web OLAP Viewer Reports
Tip:
Ensure that each level in the ArcMap includes a data element that matches up to a column in the cube's source data. Developing these two sources requires planning as these joins are critical in getting the map to display correctly.

Software Requirements:
  • ArcGIS Server
  • SAS Business Intelligence Suite with OLAP
References:

Friday, November 06, 2009

"There is a SAS App for that!" or "When will there be a SAS App for that?"

First, there were some joke tweets this past week about funny/off-the-wall iPhone apps ~ playing off the marketing: ‘There’s an App for That’. Then there were discussions on application development processes with co-workers. So these lead me to consider the current options for SAS shops to surface information to their iPhone carrying staff.

 
I recalled that SAS mentioned during the SAS Global Forum 2009 Conference that they were working on surfacing the BI Dashboard and other Business Intelligence components from an iPhone app. A SAS employee let me view the application on her iPhone in the demo room that week and it looked very interesting. Since then however, I haven’t heard when it is scheduled for release and no searches found information on the sas.com site.

 
After web searches, I reviewed the SAS application that Sy Truong presented this fall at WUSS09 and at BASAS09. His material is available here:
I had heard on NPR last week, there is a serious lack of application developer millionaires in the iPhone arena. There also doesn’t appear to be a significant number of organizations who have widely accepted data or reports available on mobile devices and then allow connections to their network via those devices (VPN). (Of course, aren’t laptops just larger mobile devices?)
Even with Sy’s development efforts, I still believe we are at the chicken/egg question – which will come first, customers/organizations clamoring for this functionality OR developers building something that will convince customers to allow for this ability.
What’s your take?

Thursday, November 05, 2009

Managing the Stored Process .sas Code Repository (SAS 9.1.3)

As you might have noticed, you are unable to select a brand new file location for SAS code when creating a SAS Stored Process via Enterprise Guide. The only options are previously defined 'source code repositories'.

The SAS Administrator (or anyone else with SAS Management Console & the associated access), can create a 'dummy' SAS Stored Process in the Bip Tree and get to the Manage Button to add/change/remove source code repositories.

1. From SAS Management Console -> Right Click within a Folder on the Bip Tree and choose 'New Stored Process'

2. On the 1st screen, you must type in some name to get to the next screen since it's a required field. No worries we will cancel out in a minute and this won't get stored in your metadata anywhere.


3. On the following page, the magic 'Manage' button is found next to the Source Code Repository. Note that a Server (Stored Process or Workspace) must be selected to get there.

4. After making changes to your source code repository, CANCEL out of the remaining screens so your 'dummy' SAS Stored Process isn't stored in the metadata.