SAS ® Global Forum 2014 March 23-26 Washington, DC.

Slides:



Advertisements
Similar presentations
SharePoint Forms All you ever wanted to know about forms but were afraid to ask.
Advertisements

Tutorial 12: Enhancing Excel with Visual Basic for Applications
The Web Warrior Guide to Web Design Technologies
CHAPTER 30 THE HTML 5 FORMS PROCESSING. LEARNING OBJECTIVES What the three form elements are How to use the HTML 5 tag to specify a list of words’ form.
Calendar Browser is a groupware used for booking all kinds of resources within an organization. Calendar Browser is installed on a file server and in a.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
Python and Web Programming
High Performance Faceted Interfaces Using S2S Eric Rozell, Tetherless World Constellation.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
Calendar Browser is a groupware used for booking all kinds of resources within an organization. The software is totally integrated in Outlook. Calendar.
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
® IBM Software Group © 2006 IBM Corporation JSF Tab Controls This Learning Module shows how to develop server-side EGL applications with dynamic content.
“SAS macros are just text substitution!” “ARRRRGGHHH!!!”
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Advance Database Management Systems Lab no. 5 PHP Web Pages.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Copyright © 2006, SAS Institute Inc. All rights reserved. Enterprise Guide 4.2 : A Primer SHRUG : Spring 2010 Presented by: Josée Ranger-Lacroix SAS Institute.
Getting started on informaworld™ How do I register my institution with informaworld™? How is my institution’s online access activated? What do I do if.
WorkPlace Pro Utilities.
CPSC 203 Introduction to Computers Lab 21, 22 By Jie Gao.
Data-Enabled Web Sites: Classibooks.com & Internet Database Technologies Colin Fukai April 4, 2000 Gonzaga University.
Microsoft Visual Basic 2005: Reloaded Second Edition
XHTML Introductory1 Forms Chapter 7. XHTML Introductory2 Objectives In this chapter, you will: Study elements Learn about input fields Use the element.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Introduction to Matlab & Data Analysis
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
CPSC 203 Introduction to Computers Lab 23 By Jie Gao.
Database-Driven Web Sites, Second Edition1 Chapter 5 WEB SERVERS.
Chapter 6 SAS ® OLAP Cube Studio. Section 6.1 SAS OLAP Cube Studio Architecture.
Copyright © 2011, SAS Institute Inc. All rights reserved. Using the SAS ® Clinical Standards Toolkit 1.4 to work with the CDISC ODM model Lex Jansen SAS.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Hélène kay Webdiva Consultants Dreamweaver Week 8 hélène kay hélène kay.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
JavaScript - A Web Script Language Fred Durao
Java Portals and Portlets Submitted By: Rashi Chopra CIS 764 Fall 2007 Rashi Chopra.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
About These Slides This slide set is designed to be used with the OMA sample application It is recommended you follow the steps outlined in the “Preparing.
1 HTML Forms
Client-side processing in JavaScript.... JavaScript history Motivations –lack of “dynamic content” on web pages animations etc user-customised displays.
Copyright © 2012 UNICOM Systems, Inc. Confidential Information z/Ware Product Overview illustro Systems International A Division of UNICOM Global.
Chapter 2: Variables, Functions, Objects, and Events JavaScript - Introductory.
BMTRY 789 Lecture 10: SAS MACRO Facility Annie N. Simpson, MSc.
Part 4 Processing and saving data with CGI/Perl Psychological Science on the Internet: Designing Web-Based Experiments From the Ground Up R. Chris Fraley.
Implementing and Using the SIRWEB Interface Setup of the CGI script and web procfile Connecting to your database using HTML Retrieving data using the CGI.
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
HTML Forms. A form is simply an area that can contain form fields. Form fields are objects that allow the visitor to enter information - for example text.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
EValid LoadTest, eV.manger and Validation. Agenda Load Test capability of eValid How to execute load test by using eValid Introduction to eV.manager Validation.
South Dakota Library Network SFX Management Basics A – Z List & Citation Linker South Dakota Library Network 1200 University, Unit 9672 Spearfish, SD
CHAPTER 7 LESSON C Creating Database Reports. Lesson C Objectives  Display image data in a report  Manually create queries and data links  Create summary.
Getting Your Content in the Penn State Student Portal Presented By James Leous, Program Manager James Vuccolo, Lead Research Programmer.
INTERNET APPLICATIONS CPIT405 Forms, Internal links, meta tags, search engine friendly websites.
An Introduction to Programming with C++1 Void Functions Tutorial 5.
Here are some things you can do while you wait 1.Open your omeka.net site in your browser (e.g. 2.Open.
Live. learn. work. play Superior Avenue Suite 310 Cleveland Ohio Tel: Fax:
SAS ® Global Forum 2014 March Washington, DC.
Web Programming Java Script-Introduction. What is Javascript? JavaScript is a scripting language using for the Web. JavaScript is a programming language.
University of Kansas Department of Electrical Engineering and Computer Science Dr. Susan Gauch April 21, 2005 I T T C Introduction to Web Technologies.
INF230 Basics in C# Programming
Section 17.1 Section 17.2 Add an audio file using HTML
CIS16 Application Development Programming with Visual Basic
WEB PROGRAMMING JavaScript.
Adobe Acrobat DC Accessibility - Metadata, Reading Order, Links
Presentation transcript:

SAS ® Global Forum 2014 March Washington, DC

2 Paper PROC STREAM and SAS® Server Pages: Generating Custom User Interfaces Don Henderson Henderson Consulting Services, LLC

3 Custom User Interfaces  Virtually every Stored Process (or SAS/IntrNet Application Dispatcher program) has parameters.  They need to be captured in a User Interface and passed to the Stored Process.  The SAS BI/EBI prompting model can be a useful tool.  SAS/IntrNet has no such facility.  For web-based applications, the default prompting model interface (in my experience) rarely satisfies the end-users look and feel and functionality needs.  An alternative approach I’ve used on a number of projects is presented here.

4 Chaining Stored Processes Together  Generating a custom user interface for a stored process (or a SAS/IntrNet Application Dispatcher program) can be accomplished by chaining two (or more) stored processes together.  The first stored process generates the user interface where the user selects the desired options and uses the STREAM procedure with an input SAS Server Page to display the user interface.  The second (or later) stored process in the chain generates the desired output.

5 An example – An Exploding Pie Chart

6 A Framework for Creating Custom Prompts  The Framework presented here includes the following re-usable components:  Two stored processes »The runMacro Stored Process. »The sasServerPage Stored Process.  Two utility SAS Server Pages: »The stpHeader SAS Server Page. »The stpTrailer SAS Server Page.  A library of utility macros – in a SAS autocall library.

7 The runMacro Stored Process  The runMacro stored process has one required parameter: macroToRun - the name of the macro to run.  See the sasCommunity.org article The runMacro Stored Process, for more details on this stored process.The runMacro Stored Process  The name of the macro to run is passed as a parameter.  Best Practice: register the sasServerPage and runMacro stored processes in the same metadata folder.  They can reference each other using the &_metafolder macro variable created by the stored process server.&_metafolder

8 The runMacro Stored Process  For the purposes of this paper, a very simple version of runMacro will be used: *ProcessBody; %stpbegin; %put NOTE: Execute macro &macroToRun..; %&macroToRun %stpend;  The name of the macro to run is passed as an input parameter. As a result, %&macroToRun resolves to a % sign followed by the macro name, thus invoking the specified macro.

9 The runMacro Stored Process  The use of such a runMacro stored process can be a very powerful approach in a number of ways, for example:  If you have lots of reports and want to make them available from the SAS Stored Process Server, you need not create a distinct stored process for each one – just save the macro source code in a autocall directory defined to your stored process server.  Alternatively, if you have existing reports packaged as macros (or SAS programmers who are familiar with the SAS macro language), you can invoke the reports by using the runMacro stored process.

10 The sasServerPage Stored Process  The sasServerPage stored process simply calls a macro called sasServerPage which invokes PROC STREAM using %include to define the input data stream (i.e., the SAS Server Page to be processed).  This allows the macro to be called from other stored processes or programs as needed.  For example, you might want to use the runMacro stored process so you can run a macro to set up the environments for the chained stored processes. That macro could then call the sasServerPage macro as its last step.

11 The sasServerPage Stored Process  For the purposes of this paper, the source code used for the sasServerPage stored process is: *ProcessBody; %sasServerPage(fileref = &srvrpgs,page = &page,quoting = &quoting,asis = &asis,noAbSSCmt = &noAbSSCmt )  The complete source code and description of the macro parameters is included in the paper for this presentation.

12 Utility SAS Server Pages  Provides for the following functionality:  Displays the output in the same window as the user interface.  Toggles the user interface in order to maximize the amount of screen real estate for the output.  Displays a processing image.  Structure of the driver/calling SAS Server Page  Assign parameter values  %include the header  The User Interface HTML  %include the trailer The Drill Down example (presented later) inverts this. The SAS Server Page for the User Interface is passed in as a parameter

13 The stpHeader SAS Server Page  The HTML and JavaScript necessary to implement:  Displaying the output in the same window as the user interface.  Toggling the user interface.  The standard FORM fields for the Stored Process Server.  Displaying the image to alert the user that the report is running.  Has the following (macro variable) parameters:  pageTitle – title for the generated HTML page.  stpToRun – runMacro or sasServerPage.  whatToRun – the macro or SAS Server page.  Complete (sample) source code included in the paper.

14 The stpTrailer SAS Server Page  Includes the HTML to:  Close the FORM tag.  Display any desired HTML at the bottom of the page.  Like the stpHeader SAS Server Page:  Complete (sample) source code included in the paper.  Can be customized to suit the needs of your environment and stored processes.  Could be repackaged as macros.

15 A library of utility macros  Utility macros play an important role in building custom user interfaces. For example, macros that:  Generate a pull down list (e.g., a select tag) of choices where the choices are populated from data in an input SAS data set.  Generate either a series of checkboxes or radio buttons, again from the information in a SAS data set.  Create a data set of distinct values that can be used to create a select tag or a series of checkboxes.

16 A library of utility macros  My SAS Press book SAS Server Pages: Generating Dynamic Contact and my blog Jurassic SAS® in the BI/EBI World contain numerous other examples of such macros, as well as more complete/robust versions of the macros used here.SAS Server Pages: Generating Dynamic ContactJurassic SAS® in the BI/EBI World  generateOptionTag  generateCheckBoxes  getDistinct  summaryAsTree Convention: I like bumpy/ Camel case for my macros Best Practice: file names are lower case

17 Selected Examples  Three examples will be presented:  Generating a select tag for the user to select which product to include in a report.  Generating a series of checkboxes for the user to select which products to include in a report.  Prompting the user to select a drill down hierarchy for a summary data set.  Thanks to the framework discussed here the html snippets for each of these examples is fairly simple. The complexities of the interface are built into the framework.

18 Generating a Select Tag

19 Generating a Select Tag  The SAS Server Page that generates the UI.  Use the framework header: %global pageTitle _debug stpToRun whatToRun; %let pageTitle=Products Select Tag; %let whatToRun=selectedProductsReport; &streamDelim;%include &srvrpgs(stpHeader.html);

20 Generating a Select Tag  Create the specifics of the User Interface: %let rc = %sysfunc(dosubl(%nrbquote( %getDistinct(data=sashelp.shoes,vars=product,out=productList) ))); %generateOptionTag(data=productList,var=product,otherOptions=multiple size=&sqlobs ) Leverages utility macros available in an autocall library

21 Generating a Select Tag  Define the standard footer html. &streamDelim;%include &srvrpgs(stpTrailer.html);  Can be used for any number of things:  Help/contact information.  Disclaimers.  Copyright statements.  And so on.

22 The URL _program=/sspebook/sasServerPage&page=stpProductSelectTag Generating a Select Tag  Lets run it!

23 Generating a Series of Checkboxes

24 Generating a Series of Checkboxes  The SAS Server Page that generates the UI.  Use the framework header (just like before): %global pageTitle _debug stpToRun whatToRun; %let pageTitle=Products Checkboxes; %let whatTorun=selectedProductsReport; &streamDelim;%include &srvrpgs(stpHeader.html);

25 Generating a Series of Checkboxes  Create the specifics of the User Interface: %let rc = %sysfunc(dosubl(%nrbquote( proc sql noprint; select distinct cats('&streamDelim newline;<input type="checkbox"’,’ name="product" value="',strip(product), '">‘,strip(product) ) into:checkBoxes separated by ' ‘ from sashelp.shoes; quit; ))); &checkboxes

26 Generating a Series of Checkboxes  Alternatively – use utility macros: %let rc = %sysfunc(dosubl(%nrbquote( %getDistinct(data=sashelp.shoes,vars=product,out=productList) ))); %generateCheckBoxes(data=productList,var=product )

27 Generating a Series of Checkboxes  Define the standard footer html (exactly as before). &streamDelim;%include &srvrpgs(stpTrailer.html);  Can be used for any number of things:  Help/contact information.  Disclaimers.  Copyright statements.  And so on.

28 Generating a Series of Checkboxes  Lets run it! The URL _program=/sspebook/sasServerPage&page=stpProductCheckboxes

29 Select a Drill Down Hierarchy for a Data Set

30 Select a Drill Down Hierarchy for a Data Set  The SAS Server Page that generates the UI.  Use the framework header (almost just like before): %global pageTitle _debug stpToRun whatToRun; %let pageTitle=Summary Drill Down - a Tree View; %let stpToRun=sasServerPage; %let whatTorun=jqueryTreetable; &streamDelim;%include &srvrpgs(stpHeader.html);

31 Select a Drill Down Hierarchy for a Data Set  Create the specifics of the User Interface: Select Hierarchy Region Subsidiary Product Region Product Subsidiary Product Region Subsidiary Product Region

32 Select a Drill Down Hierarchy for a Data Set This User Interface could be parameterized So the data set is not hard-coded To allow for the use of an already summarized data set Allowing the user to select and order the class variables Allowiing the user to select and order the analysis variables And so on....

33 Select a Drill Down Hierarchy for a Data Set  Define the standard footer html (exactly as before). &streamDelim;%include &srvrpgs(stpTrailer.html);  Can be used for any number of things:  Help/contact information.  Disclaimers.  Copyright statements.  And so on.

34 Select a Drill Down Hierarchy for a Data Set  Lets run it! URL for a similar framework: ?_program=/sspebook/sasServerPage &page=ajaxContainer &formui=shoesdrillform.html

35 In Summary  PROC STREAM is a very powerful new facility that extends the output that can be generated by SAS & facilitates for leveraging other web & HTML based facilities.  The examples here only scratch the surface of what can be done with PROC STREAM (and SAS Server Pages).  And check out the companion paper which provides an overview and addresses using PROC STREAM and SAS Server Pages in a batch environment: PROC STREAM and SAS Server Pages: Generating Custom HTML ReportsPROC STREAM and SAS Server Pages: Generating Custom HTML Reports

36 More on PROC STREAM  Also Check Out:  ebook SAS Server Pages: Generating Dynamic ContentSAS Server Pages: Generating Dynamic Content  blog: Jurassic SAS® in the BI/EBI WorldJurassic SAS® in the BI/EBI World  The full text for both of my papers can be found at My Papers and Presentations on sasCommunity.orgMy Papers and PresentationssasCommunity.org  Watch those pages (requires a sasCommunity.org userid – which is free) if you want to be notified of changes or updates, e.g.,  Downloading the code from this presentation

37 Papers and Presentations on sasCommunity.org