Share PowerPoint. Anywhere!

wuss2000 webclass

Uploaded from authorPOINT Lite
Download as Download Not Available PPT
Presentation Description

No description available

Like authorSTREAM?


You can vote once a day till December
10th, Vote Now!
Views: 21
Like it  ( Likes) Dislike it  ( Dislikes)
Added: February 05, 2008 This presentation is Public
Presentation Category :Education
Presentation StatisticsNew!
Views on authorSTREAM: 21
Presentation Transcript

Using Web Technologies Effectively with SAS® : Using Web Technologies Effectively with SAS® WUSS 2000 by Sy Truong


Introduction : Introduction Describe the purpose and scope of the course List the the tools and technologies included in the course Provide general guidelines on when to use which tools


Purpose and Scope of Course : Purpose and Scope of Course The purpose of this course is to give SAS programmers the essentials to do the following: Generate static reports and graphs via the Web Develop dynamic Web systems CGI-Based Java-Based Provide guidelines on the optimal use of these tools


Technologies Included : Technologies Included Report and Graph Generation ODS and HTML SAS Macros for HTML CGI-Based Application Dispatcher/Broker Java-Based JavaScript WebAF


Architectural System Design : Architectural System Design Basic Web Architecture


Intranet versus Internet : Intranet versus Internet Same TCI/IP protocol across different networks


Static Web Pages : Static Web Pages Static HTML Example


Dynamic Web Pages : Dynamic Web Pages Dynamic HTML Example


SAS Technologies for Static Web Page : SAS Technologies for Static Web Page SAS Macro for HTML ODS and HTML User Developed SAS Programs


SAS Macros : SAS Macros %ds2htm - Data Set Formatter %out2htm - Create HTML from SAS Proc Output %tab2htm - Present PROC TABULATE output in HTML %ds2graf - Present SAS/Graph output with GraphApplet %meta2htm - Generate metadata for SAS/Graph in Java Applet %ds2csf - Critical Success Factor


%ds2htm Example : %ds2htm Example title 'Formerly PROC SQL Output'; footnote '(Data generated by PROC MORTGAGE)'; %ds2htm(htmlfile=myfile.html, openmode=replace, pagepart=head, data=monthly, where=year eq 1996, caption=Information for 1996);


%ds2htm Output : %ds2htm Output


%out2htm Example : %out2htm Example %out2htm(capture=on, window=output, runmode=b); … %out2htm(htmlfile=myfile.html, capture=off, window=output, openmode=replace, runmode=b);


%out2htm Output : %out2htm Output


%tab2htm Example : %tab2htm Example %tab2htm(capture=on, runmode=b); *** PROC TABULATE CODE… ***; %tab2htm(capture=off, runmode=b, openmode=replace, htmlfile=ex2.html, brtitle=Tabulate Formatter Example, center=Y, tsize=+3);


%tab2htm Output : %tab2htm Output


%ds2graph Example : %ds2graph Example %ds2graf(htmlfile=drill_test.html, data=test, name=Graph, graphtyp=bar, archive=http://web_server/GraphApplet.jar, indepvar=symbol, depvar=price, drildown=y, drilurl=http://web_server/%nrstr({&g_indepv}).html, ttag=header 2, tcolor=purple, center=y);


%ds2graph Output : %ds2graph Output


ODS and HTML Example : ODS and HTML Example /* Create HTML files. */ ods html file='odshtml-body.htm' contents='odshtml-contents.htm' page='odshtml-page.htm' frame='odshtml-frame.htm'; proc univariate data=sashelp.adsmsg mu0=3.5; var msgid lineno; title; run; /* Close the HTML destination. */ ods html close;


ODS Output Example : ODS Output Example Outputs to both traditional text and HTML output Large HTML document with hyperlinks


ODS Text Output : ODS Text Output


ODS HTML Output : ODS HTML Output


User Developed SAS Programs : User Developed SAS Programs HTML is essentially a text file SAS has powerful tools for text manipulations and generation SAS String Function Examples: byte(), collate(), compbl(), compress(), dequote(), index(), indexc(), indexw(), left(), length(), lowcase(), quote(), rank(), repeat(), reverse(), right(), scan(), soundex(), substr(), translate(), tranwrd(), trim(), trimn(), upcase(), verify()


Simple Custom HTML Generator : Simple Custom HTML Generator


Custom HTML Output : Custom HTML Output Simple yet very powerful


Sophisticated Custom HTML : Sophisticated Custom HTML HTML tables & GIFs for diagrams


Publishing Tools Summary : Publishing Tools Summary Suitable for static publishing of HTML pages Requires little HTML knowledge Limited customization Limited Dynamic HTML capabilities


Advantages and Disadvantages : Advantages and Disadvantages Report Generation A: Quick Report Generation D: Lack customization Dynamic HTML Application A: Powerful tools for HTML applications D: Lack some GUI interactivity Dynamic Java Based Applications A: Create elaborate interfaces D: Performance and learning curve


Installation of a Web Server : Installation of a Web Server No fear for simple http demon Microsoft IIS, Apache Apache Server General at: http://www.apache.org/httpd.html


Installing Apache 1.3.12 : Installing Apache 1.3.12 Download at: http://www.apache.org/dist/


Installing Apache 1.3.12 : Installing Apache 1.3.12 Follow instructions on screen.


Installing Apache 1.3.12 : Installing Apache 1.3.12


Installing Apache 1.3.12 : Installing Apache 1.3.12


Installing Apache 1.3.12 : Installing Apache 1.3.12


Apache Serves Up HTML and CGI : Apache Serves Up HTML and CGI Files stored on Apache directories are delivered via http CGI software is stored in cgi-bin directory Instant Web Services


Dynamic Web Page Technologies : Dynamic Web Page Technologies SAS/IntrNet CGI SQL Java Script AppDev Studio


SAS/IntrNet CGI : SAS/IntrNet CGI Hello World Example Data Access Example


Java Script : Java Script Fits into Architecture Form Checking Example


AppDev Studio : AppDev Studio Hello World Example Data Access Example How it fits in


WebAF Hello World Applet Example : WebAF Hello World Applet Example Start a new project named HelloWorld Contrl+R or menu File > New > Project


WebAF Hello World Applet Example : WebAF Hello World Applet Example Recommended to have Name with no special characters. Leave Java package empty


WebAF Hello World : WebAF Hello World Leave the default Parent Class Leave the HTML blank for now. This can be added later


WebAF Hello World : WebAF Hello World Click on Finish to complete Wizard


WebAF Hello World : WebAF Hello World Add New Java Source Code with menu: File > New > Java Source import java.awt.Graphics; public class HelloWorld extends java.applet.Applet { public void paint( Graphics g ) { g.drawString( "Hello, World!", 60, 30 ); } }


WebAF Hello World : WebAF Hello World Save Java Source File with menu: File > Save Save file with extension (.java) For example: helloworld.java Compile the program with menu: Build > Compile File


WebAF Hello World : WebAF Hello World Add new HTML source with menu: File > New > HTML Source HelloWorld






WebAF Hello World : WebAF Hello World Save HTML file to helloworld.html with menu: File > Save Update Project Property for html with menu: File Project Property


WebAF Hello World : WebAF Hello World Execute the Applet with menu: Build > Execute or Build > Execute in Browser


WebAF Hello World : WebAF Hello World There are many components to webAf applets Learning curve for new development Nice visual development environment Performance of download to consider


Data Display Example : Data Display Example webAF delivers more interactivity Data display is a slightly more sophisticated example


Data Display Example : Data Display Example Create a new project named tabledisplay with menu File > New > Project Note that Java package has to be unique or left blank


Data Display Example : Data Display Example Use the default Parent class Leave the HTML blank for now


Data Display Example : Data Display Example Click on the Finish button to create the project


Data Display Example : Data Display Example Add two list boxes by dragging ListBox item from Selector tab onto new applet


Data Display Example : Data Display Example New applet has Visual and Source code tabs


Data Display Example : Data Display Example Add two text labels on top of the list boxes Text labels are found in the Text tab Add a data view from the Data View tab


Data Display Example : Data Display Example Use layout tools to arrange components as shown here


Data Display Example : Data Display Example Drag non-visual models and drop them onto specified components LibraryListInterface > Listbox1 DataSetListInterface > Listbox2


Data Display Example : Data Display Example When creating a connection for first time, select the options Default will run on local machine Further customizations are optional with webAF MiddleWare found under Services tools


Data Display Example : Data Display Example Set Properties label1 > Select a library: label2 > Select a data set:


Data Display Example : Data Display Example Establish Property Links listbox1 (selectedItem) > dataSetListInterface1 (library)


Data Display Example : Data Display Example Establish Property Links listbox2 (selectedItem) > dataSetInterface1 (library)


Data Display Example : Data Display Example Build Project with menu: Build > Build Project


Data Display Example : Data Display Example Start SAS Connect Spawner


Data Display Example : Data Display Example Execute the Applet with menu: Build > Execute


SAS/IntrNet Hello World Example : SAS/IntrNet Hello World Example Generate SAS program to produce HTML data _null_; file _webout; put 'Content-type: text/html'; put ; put ''; put 'Hello World!'; put ''; put '

Hello World!

'; put ''; put ''; run;


SAS/IntrNet Hello World Example : SAS/IntrNet Hello World Example Define libname to the SAS program in srvauto.sas /*** Location of sample programs ***/ libname sample 'd:\sas\IntrNet\sample' access=readonly;


SAS/IntrNet Hello World Example : SAS/IntrNet Hello World Example Run Program from Browser


SAS/IntrNet Hello World Example : SAS/IntrNet Hello World Example Simple yet powerful


SAS/IntrNet eData Example : SAS/IntrNet eData Example Accessing data via slow internet connection is a challenge eData uses SCL to optimize eData is a SAS data viewer via a browser


SAS/IntrNet eData Example : SAS/IntrNet eData Example


eData HTML Generation : eData HTML Generation Data: &datname &search &sort         View By:   


eData HTML Generation : eData HTML Generation *** Set background colors ***; if mod(i,2) = 0 then bgcolor = '#DCDCBA'; else bgcolor = '#ECECD9'; submit; &i &varname &vartype &varlen &varfmt &varinfmt &varlabel &varnum endsubmit;


SAS/IntrNet eData Example : SAS/IntrNet eData Example Navigate through pages of 20 observations at a time with previous… and next… hyperlinks Navigate to specific sections if the data is large Fast viewing of data through slow connection


eData Mouse Click Events : eData Mouse Click Events submit; previous... endsubmit; submit; Obs:


SAS/IntrNet eData Example : SAS/IntrNet eData Example HTML connected to broker CGI and SAS is a powerful combination Besides SAS, HTML is the only other challenge, no Java required Level of interactivity is different


Using HTML Table as Layout : Using HTML Table as Layout eData demonstrated effective use of table cell background colors HTML tables are effective layout for flow diagrams as shown in Trialex dependency diagram


HTML Table Layout Tool : HTML Table Layout Tool Nested HTML tables form self contained cells to layout diagrams Dynamic diagrams fit any browser


HTML Table Versatility : HTML Table Versatility Used inside Email messages Trialex Update uses email as information delivery


Sample HTML Nested Table : Sample HTML Nested Table
text in table 1
table 2 in table 1



Using Java Script : Using Java Script Quick form field selection and validation Add Interactive Navigation Add Pop up Menu Interactivity


Java Script Field Selection : Java Script Field Selection Select All button. Non-CGI with Java Script.


Java Script Select Button : Java Script Select Button function selAll() { toggle = toggle + 1; remainder = toggle % 2; if (remainder == 1) { document.myForm.selit[0].selected = true; . . . } if (remainder == 0) { document.myForm.selit[0].selected = false; . . . } return; }


Java Script Navigation : Java Script Navigation Java Script for button to navigate to another location in the same HTML page.


Java Script Navigation Code : Java Script Navigation Code function linkHandler(loc){ window.location.href = loc; if (loc=="#Page1") document.myForm.b_ok2.focus(); if (loc=="#Page2") document.myForm.b_back.focus(); return; }


Java Script Pop up Menu : Java Script Pop up Menu Clicking on GIF images can pop up a menu Much greater interactivity


Java Script Menu Source Sample : Java Script Menu Source Sample function doMenu(obj,parent,generat,objid) { document.myForm.object.value = obj; document.myForm.parent.value = parent; document.myForm.generat.value = generat; document.myForm.objid.value = objid; window.showMenu(window.jobMenu); return; }


Including Show Menu Java Script : Including Show Menu Java Script /** * Menu 0.8 990602 * by gary smith, July 1997 * Copyright (c) 1997-1999 Netscape * Communications Corp. */ function showMenu(menu, x, y, child) { if (!window.wroteMenu) return; if (document.layers) { ...


Java Script is the Glue : Java Script is the Glue Static HTML pages can become interactive with Java Script Java Script is fast and integrates closely with HTML pages It is efficient since no trips to server are required It can link and add communications and interactivity between HTML objects to form the GLUE of HTML pages


Using email with Internet Applications : Using email with Internet Applications Email used as information delivery Facilitating collaborative tools which enable groups to communicate effectively


Information Delivery : Information Delivery In this Trialex example, after a program has been submitted, an email in HTML format is sent with status of submitted SAS job.


Collaborative Group Ware : Collaborative Group Ware Adding an email interface to a system can communicate relevant content through email.


Email in SAS : Email in SAS Interactive SAS allows email facilities


Email with SAS/IntrNet : Email with SAS/IntrNet SAS Interactive dialog boxes are replaced with HTML forms Email facilities are executed with commands in batch SAS can access these through X system commands Many command line email tools are freely available on multiple platforms See more information on WUSS paper titled “SAS Information Delivery with Email and the Internet”


Performance and Tuning : Performance and Tuning Decrease the time for user response Users lose interest and are frustrated when it goes on for more than five seconds Some optimization strategies Server Side Client Side


Performance and Tuning : Performance and Tuning Splash Screen Establish browser/server connection Place server application onto memory Load Applets to clients


Splash Screen HTML Sample : Splash Screen HTML Sample


Optimize SAS Queries : Optimize SAS Queries Use the right tools for the job DATA STEP SCL PROC SQL


Spread out Application Load : Spread out Application Load Spread the load to multiple application servers for faster response


Multiple Application Server Configuration : Multiple Application Server Configuration Sample SAS Broker Configuration for multiple SAS application servers onto one machine SocketService default "Reuse existing session" ServiceDescription "Pages reference this generic server when they don't care which service is used." ServiceAdmin "Sy Truong" ServiceAdminMail "sy.truong@meta-x.com" Server myserver.meta-x.com Port 5001 5002


Use of JavaScript : Use of JavaScript Trips to Server adds 1 or 2 seconds depending on connection speeds JavaScript is delivered quickly as small text file and runs on the client Optimal use of both client processing and server


Create Smaller Applets : Create Smaller Applets Create Java Applets only when necessary Keep them small for faster download time


Batch versus Interactive : Batch versus Interactive For long jobs, send it to batch server For fast shorter jobs, use run interactively and return results right away


HTML Optimization : HTML Optimization Optimize HTML Tables Avoid unnecessary table cells or nested tables Optimize GIFs / JPEG


Session State Control : Session State Control Web knows no state of time Each session web page is cached on the browser (back button)


Adding Session Logic : Adding Session Logic Keep track of user location in a data base Every update of a web page is tracked


HTML Session Logic : HTML Session Logic Create a unique identifier for each HTML session Expire old HTML session and require re-login ...


Data Level Security : Data Level Security Lock up the data access OS level protection SAS password protects the specified data


SAS Code to Protect Data : SAS Code to Protect Data Sample SAS data step to password protect data Sample SQL code to password protect data data lockdata (pw=apple); set thedata; run; proc sql; create table lockdata (pw=apple) as select * from thedata; run;


Email Security : Email Security SSL Applied to POP Server Email Attachments PKZIP with password protection Password Protect SAS Data Email an HTML link and the HTML page is locked


Tools Dynamic Levels : Tools Dynamic Levels


Degree of Difficulty : Degree of Difficulty


Performance : Performance


Recommendations for Static Publishing : Recommendations for Static Publishing Quick with limited customization: SAS HTML Formatting Macros Elaborate HTML publications: DATA STEP SCL Code HTML Generation


Recommended for Applications : Recommended for Applications Quick Development with Limited Customization WebAF & EIS predefined objects htmSQL Elaborate Systems Customized webAF for Java applets SAS/IntrNet with JavaScript


Using Web Technologies Effectively with SAS® : Using Web Technologies Effectively with SAS® Questions? Sy Truong sy.truong@meta-x.com http://www.meta-x.com