Building Windows Front Ends to SAS Software. Katie Essam Amadeus Software Limited 20 th May 2003

Similar documents
Integrating With.NET. Patterns for Leveraging SAS in Microsoft's Strategic Architecture. Dan Jahn SAS

Create a Windows Application that Reads- Writes PI Data via PI OLEDB. Page 1

SAS 9.2 Integration Technologies. Overview

A201 Object Oriented Programming with Visual Basic.Net

Database Systems: Design, Implementation, and Management Tenth Edition. Chapter 14 Database Connectivity and Web Technologies

AppDev Studio A Roadmap

Expanding Open Access to Your OLAP Data

ADO.NET for Beginners

ASP.NET Web Forms Programming Using Visual Basic.NET

iseries Access in the.net World

B Nagaraju

BUILDING APPLICATIONS USING C# AND.NET FRAMEWORK (OBJECT-ORIENTED PROGRAMMING, X428.6)

JDBC SHORT NOTES. Abstract This document contains short notes on JDBC, their types with diagrams. Rohit Deshbhratar [ address]

NAVIGATING TECHNOLOGY CHOICES FOR SAS DATA ACCESS FROM MULTI-TIERED WEB APPLICATIONS

SAS Solutions for the Web: Static and Dynamic Alternatives Matthew Grover, S-Street Consulting, Inc.

Client/Server-Architecture

Let SAS Power Your.NET GUI

Connection Example. Document ID : Connection_Example.PDF Author : Michele Harris Version : 1.1 Date :

.Net Interview Questions

Form Adapter Example. DRAFT Document ID : Form_Adapter.PDF Author : Michele Harris Version : 1.1 Date :

Saikat Banerjee Page 1

M4.1-R4: APPLICATION OF.NET TECHNOLOGY

AUTHENTICATED WEB MANAGEMENT SYSTEM

Contents. Chapter 1 Introducing ADO.NET...1. Acknowledgments...xiii. About the Authors...xv. Introduction...xix

Microsoft Official Courseware Course Introduction to Web Development with Microsoft Visual Studio

ABSTRACT WORKSPACE INTRODUCTION

ADO.NET.NET Data Access and Manipulation Mechanism. Nikita Gandotra Assistant Professor, Department of Computer Science & IT

CMPT 354 Database Systems I

SAS Integration Technologies Server Administrator s Guide

SDD ++: Extending SDD Capabilities

Mobile MOUSe ADO.NET FOR DEVELOPERS PART 1 ONLINE COURSE OUTLINE

.NET and DB2 united with IBM DB2.NET Data Provider Objectives :.NET ADO.NET DB2 and ADO.NET DB2 - ADO.NET applications

Windows Database Applications

UNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net

Component models. Page 1

ADO.NET Overview. Connected Architecture. SqlConnection, SqlCommand, DataReader class. Disconnected Architecture

Introduction to AppDev Studio Software

Design Considerations When Developing Applications Using SAS. Vijay Rajandram Amadeus Software Ltd

Program Contents: DOTNET TRAINING IN CHENNAI

All India Council For Technical Skill Development (AICTSD) In Association with IITians Embedded Technosolution

C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies. Objectives (1 of 2)

Introduction to MySQL. Database Systems

Looping through a collection of SQL tables using the SSIS Foreach Loop Container

My Enterprise Guide David Shannon, Amadeus Software Limited, UK

An Introduction to ADO.Net

Developing Web Applications Using Microsoft Visual Studio 2008 SP1

How to use data sources with databases (part 1)

Lecture 10: Database. Lisa (Ling) Liu

New programming language introduced by Microsoft contained in its.net technology Uses many of the best features of C++, Java, Visual Basic, and other

1. We insert elements inside (CompoBox) tool through Items property ( ) 2. ComboBox tool use to choose just one item from the list ( )

SECURED PROGRAMMING IN.NET DETAILED TRAINING CONTENT INDUSTRIAL TRAINING PROGRAM ( )

ADO.NET 2.0. database programming with

What we need. Agenda. What s J2EE. Challenges of Enterprise Application Development

EG 4.1. PC-SAS users. for. I C T EG 4.1 for PC-SAS Users. Thursday - May 7 th, 2009

Appendix A - Glossary(of OO software term s)

SAP Automation (BC-FES-AIT)

SAS/IntrNet 9.3. Overview. SAS Documentation

Microsoft ASP.NET Whole Course Syllabus upto Developer Module (Including all three module Primary.NET + Advance Course Techniques+ Developer Tricks)

AppDev StudioTM 3.2 SAS. Migration Guide

Lesson 6: Using XML Queries

Definition of DATABASE : a usually large collection of data organized especially for rapid search and retrieval (as by a computer)

Using SAS Enterprise Guide with the WIK

Databases and the Internet

PLATFORM TECHNOLOGY UNIT-4

2017/ st Sec Final revision Final revision

VB. Microsoft. MS.NET Framework 3.5 ADO.NET Application Development

ADO.NET from 3,048 meters

SAS ODBC Driver. Overview: SAS ODBC Driver. What Is ODBC? CHAPTER 1

TRAINING GUIDE FOR OPC SYSTEMS.NET. Simple steps to successful development and deployment. Step by Step Guide

Notes. Submit homework on Blackboard The first homework deadline is the end of Sunday, Feb 11 th. Final slides have 'Spring 2018' in chapter title

Visual Basic.NET Complete Sybex, Inc.

Darshan Institute of Engineering & Technology for Diploma Studies

Oracle Rdb Technical Forums

BIS4430 Web-based Information Systems Management. Unit 11 [BIS4430, LU11 version1.0, E.M, 09/07)]

Introduction to Web Development with Microsoft Visual Studio 2010

Model Question Paper. Credits: 4 Marks: 140. Part A (One mark questions)

Copyri g h t 2013 OSIso f t, LLC. 1

ComponentOne. DataObjects for.net

System Requirements. SAS Profitability Management 2.3. Deployment Options. Supported Operating Systems and Versions. Windows Server Operating Systems

Accessing Databases 7/6/2017 EC512 1

Visual Studio.NET for AutoCAD Programmers

The integration of the database with Microsoft. NET Framework

The Efficient Search Technique for Mechanical Component Selection

B. V. Patel Institute of Business Management, Computer & Information Technology, UTU

Introduction to.net Framework

Team Developer. There are no good reasons to stay in legacy mode.

SAS Data Integration Studio 3.3. User s Guide

(D)COM Microsoft s response to CORBA. Alessandro RISSO - PS/CO

SAS 9.2 Intelligence Platform. Web Application Administration Guide, Third Edition

DE-2310 Developing Web Applications Using Microsoft Visual Studio 2008 SP1

2. A GUI A. uses buttons, menus, and icons B. should be easy for a user to manipulate C. both (a) and (b) D. stands for Graphic Use Interaction

What s New in Cognos. Cognos Analytics Participant s Guide

describe the functions of Windows Communication Foundation describe the features of the Windows Workflow Foundation solution

Building Datacentric Applications

Tools to Develop New Linux Applications

Data Access Standards. ODBC, OLE DB, and ADO Introduction. History of ODBC. History of ODBC 4/24/2016

"Charting the Course... MOC A Introduction to Web Development with Microsoft Visual Studio Course Summary

Multimedia Database Architecture!

Active Server Pages Architecture

MOM MESSAGE ORIENTED MIDDLEWARE OVERVIEW OF MESSAGE ORIENTED MIDDLEWARE TECHNOLOGIES AND CONCEPTS. MOM Message Oriented Middleware

Transcription:

Building Windows Front Ends to SAS Software Katie Essam Amadeus Software Limited 20 th May 2003

Topics Introduction What is.net? SAS Software s Interoperability Communicating with SAS from VB.NET Conclusions Slide 2 Copyright 2003 Amadeus Software Limited

Introduction Prior to Version 8 of SAS SAS/AF Software Rich Client Interfaces SAS/IntrNet Software Browser based Interfaces Since Version 8 SAS Integration Technologies Enables communication with many Industry Standard languages including Java, C#, C++ and Visual Basic This paper aims to introduce some of the techniques that can be used to access SAS Software from Visual Basic.NET Slide 3 Copyright 2003 Amadeus Software Limited

What is Microsoft s.net Framework? New view of the Windows operating system Hundreds of classes that provide the functionality of Windows Provides single approach to building Rich client applications Web client applications Incorporates CLR (Common Language Runtime) so that all.net programming languages are equal Slide 4 Copyright 2003 Amadeus Software Limited

What is Visual Basic.NET? VB.NET is the latest version of the Visual Basic Language Fully Object Orientated Programming Directly comparable to other Visual Studio Languages From the developer s point of view Provides Rapid Application Development(RAD) tool Highly reusable code Large pool of resources From the user s point of view Familiar look and feel Windows applications with rich functionality Slide 5 Copyright 2003 Amadeus Software Limited

What is Microsoft s.net Framework? Slide 6 Copyright 2003 Amadeus Software Limited

SAS Software s Interoperability Prior to Version 8 SAS/AF Software Proprietary software to build Rich Client Interfaces using SCL Version 8 introduced dot notation SAS Integration Technologies Foundation to enable seamless integration between SAS and industry standard tools Provides middleware to allow programmers working in a number of different languages to quickly create applications that harness the functionality of SAS Slide 7 Copyright 2003 Amadeus Software Limited

SAS Software s Interoperability Industry Standards supported Directory Technology LDAP (Lightweight Directory Access Protocol) Used for accessing a distributed store of information Message orientated middleware IBM s MQSeries and Microsoft s MSMQ Provides standard for allowing requests and response to be sent and received as messages Slide 8 Copyright 2003 Amadeus Software Limited

SAS Software s Interoperability Distributed object models Microsoft s COM/DCOM The Component Object Model (COM) allows objects in different object spaces to talk to each other by calling each other s methods. DCOM (Distributed COM) allows components to communicate with each other over networks CORBA (Common Object Request Broker Architecture) CORBA is a vendor independent infrastructure to provide communication between applications over networks Slide 9 Copyright 2003 Amadeus Software Limited

Integrated Object Model IOM is an object model in SAS Integration Technologies Provides a set of objects that interface to Base SAS Software Client applications can connect to an IOM server through a variety of industry standard communication protocols IOM objects mainly handle two tasks Submit SAS Language programs to SAS Retrieve information and data from SAS Slide 10 Copyright 2003 Amadeus Software Limited

Integrated Object Model IOM Workspace Access through different IOM Providers Data Service File Service Language Service Utilities Libraries. OLE DB or JDBC access Filerefs Submit Code. Retrieve Log and Output. Execute Stored Process Host Information. SAS Options and Formats. Results Package The full object hierarchy can be found at http://support.sas.com/rnd/itech/doc/dist-obj/iom.html Slide 11 Copyright 2003 Amadeus Software Limited

Integrated Object Model - The Workspace The root object of the IOM Hierarchy is the Workspace Can be created via the Workspace Manager Can be thought of as a SAS Session The Workspace Manger is not necessarily required but makes scaling the application to use multiple Workspaces easy Slide 12 Copyright 2003 Amadeus Software Limited

IOM Data Providers Three SAS Data Providers that allow direct connections to SAS Data Sources SAS Local Data Provider Allows manipulation of data sets in your windows environment Does not support SQL command processing Single User update SAS/SHARE Data Provider Allows manipulation of data sets and views in a SAS/SHARE server. Multi User update Supports SQL processing Slide 13 Copyright 2003 Amadeus Software Limited

IOM Data Providers SAS IOM Data Provider Allows manipulation of data sets and views in an Integration Technologies object server Supports SQL processing Multi user support Can be used on any platform that the IOM supports All of the providers: Have basic OLE DB schema rowsets, which enable consumers to obtain metadata about the data source they are using. Have integrated SAS Formatting services (NOTE the Local provider cannot use user defined formats) The examples in this paper use the Local Provider Slide 14 Copyright 2003 Amadeus Software Limited

Getting SAS to communicate with VB.NET.NET can communicate with SAS by making use of any of COM (or DCOM), OLE/DB, ADO.NET or ODBC COM/DCOM are used indirectly when using the SAS IOM The other Industry Standard can be used to access SAS data directly Slide 15 Copyright 2003 Amadeus Software Limited

Running SAS Programs There are a number of ways of running SAS programs via the IOM Stored Processes Simple file includes Submitting code created within an application First, need to setup Visual Basic.NET Install the SAS Integration Technologies Client Side components, executable downloadable from SAS Institute s Web Site Add references to the components to the VB.NET project SAS Integrated Object Model (IOM) (SAS System Version 8.2) Type Library Type Lib Version 1.1 SASWorkspaceManager Type Library 1.1 NOTE: This paper assumes Version 8.2 is being used Slide 16 Copyright 2003 Amadeus Software Limited

Running SAS Programs Starting SAS Creating a SAS Session Optionally, use the Workspace Manager to manage SAS Workspaces Create an instance of the SAS Workspace Public obwsmgr As New SASWorkspaceManager.WorkspaceManager() Public obws As SAS.Workspace Public Function StartSAS() Dim errstring As String obws = obwsmgr.workspaces.createworkspacebyserver( _ "My workspace", _ SASWorkspaceManager.Visibility.VisibilityNone, _ Nothing, "", "", errstring) End Function Slide 17 Copyright 2003 Amadeus Software Limited

Running SAS Programs Stopping SAS To stop a SAS Workspace Close the Workspace which ends the session Release the object for garbage collection in.net Public Function EndSAS() obws.close() obws = Nothing End Function In Visual Basic objects persist, or stay in existence, until they are removed. By setting the Workspace to Nothing we remove it from use Slide 18 Copyright 2003 Amadeus Software Limited

Running SAS Programs %Include To run a SAS Program Start SAS Session (Workspace) Create SAS code and Submit it End SAS Session (Workspace) Using %Include is a simple way to run a SAS Program Assumes have a button called Submit and a text box called FileName A String is created which contains the %include statement and the SAS Program name Private Sub Submit_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles _ Submit.Click Dim SASCode As String SASCode = "%include '" & filename.text & "';" StartSAS() SubmitCode(SASCode) EndSAS() End Sub Slide 19 Copyright 2003 Amadeus Software Limited

Running SAS Programs %Include To submit the code an instance of the SAS Language Service is created. the SAS code String is passed to the SAS Workspace for processing, using the Submit method. Once the obls object is no longer required, release it by setting it to Nothing Private Function SubmitCode(ByVal SASCode As String) As _ Boolean Dim obls As SAS.LanguageService = obws.languageservice obls.submit(sascode) obls = Nothing End Function SASCode is a String so we could extend this to provide the User s with an application containing an Editor, from which we could capture the text, for them to write and submit their code Slide 20 Copyright 2003 Amadeus Software Limited

Running SAS Programs Stored Process A Stored Process in SAS terms is a.sas file with a comment in the header of *ProcessBody; Business Logic is separate from Application Logic Can be thought of as SAS Macro definitions Macro variables should be defined as Variable=Value Slide 21 Copyright 2003 Amadeus Software Limited

Running SAS Programs Stored Process To use Stored Process need to specify the directory (or Repository), program name and any macro variables (not included below) Create the LanguageService and the StoredProcessService Use the StoredProcessService to execute the program Release the LanguageService and StoredProcessService objects for garbage collection Private Function SubmitCode(ByVal dir As String, _ ByVal program As String) As Boolean Dim obls As SAS.LanguageService = obws.languageservice Dim obsp As SAS.StoredProcessService = _ obls.storedprocessservice obsp.repository = "file:" & dir obsp.execute(program, "") obls = Nothing obsp = Nothing End Function Slide 22 Copyright 2003 Amadeus Software Limited

Running SAS Programs Stored Process If macro variables are required then they should be passed to the stored process using cmd = "title='this is the title'" obsp.execute(program, cmd) Any name/value pairs passed in this way replace the *ProcessBody; comment and are treated by the SAS Code as normal macro variables Slide 23 Copyright 2003 Amadeus Software Limited

Running SAS Programs Events The LanguageService also provides functionality to dynamically capture events as they happen in SAS Code that is executing Need to declare LanguageService as Dim WithEvents obls As SAS.LanguageService Can then access events, for example, can put messages on a StatusBar Private Sub obls_datastepcomplete() Handles _ obls.datastepcomplete StatusBar.Panels(0).Text = "DATA Step has finished" End Sub Slide 24 Copyright 2003 Amadeus Software Limited

Accessing Data VB.NET uses ADO.NET as it s primary data access and manipulation tool ADO.NET makes use of OleDB Interfaces to provide standard access methods to a variety of sources, including Microsoft Access Microsoft SQL Server SAS Connection method differs slightly for SAS but provides the ability to retrieve information from a SAS Data Set, including column names and descriptions, as well as the SAS Data Set itself Slide 25 Copyright 2003 Amadeus Software Limited

Accessing Data Two objects can be used to access SAS Data DataAdapter Read-write, multi-directional Can perform SQL queries (this is dependent on the IOM Provider being used) DataReader Sequential, read-only access For the following examples an OleDBConnection must be created Public cn As New OleDb.OleDbConnection() The OleDBConnection provides the interface that allows us to establish a connection via an IOM provider to a SAS Data Source. Slide 26 Copyright 2003 Amadeus Software Limited

Accessing Data VB.NET DataTable The DataTable is a key component of ADO.NET Represents one table of relational in-memory data To create a DataTable Public schema As DataTable Enables disconnected access Don t have continuous access to the data source Access can be very fast as working on local copy Slide 27 Copyright 2003 Amadeus Software Limited

Accessing Data OleDB Schema To access the header portion of a SAS Data Set we can use the GetOleDbSchemaTable method Specify which Data Provider to connect to SAS with and the directory containing the Data Set we want to access Open the connection Use the connection to get the schema table for a specific data set Public Function Make_Connection(ByVal SASLib As String, _ ByVal SASDataSet As String) As Boolean cn.connectionstring = _ "Provider=sas.LocalProvider;Data Source=" & SASLibrary cn.open() schema = cn.getoledbschematable(oledbschemaguid.columns, _ New String() {"", "", SASDataSet}) End Function Slide 28 Copyright 2003 Amadeus Software Limited

Accessing Data OleDB Schema Once the VB.NET DataTable contains the header information from a SAS Data Set we loop round the DataTable retrieving the information of interest In this example, we make a connection to a specific data set and then add the column names to a list box Make_Connection(SASLib,SASDataSet) Dim i As Integer For i = 0 To schema.rows.count - 1 ListBox.Items.Add(schema.Rows(i).Item("Column_Name")) Next Slide 29 Copyright 2003 Amadeus Software Limited

Accessing Data Using a DataAdaptor We may want to display the whole data set Can use either DataReader or DataAdapter depending on access required A DataAdapter can be thought of as a bridge between an ADO.NET DataSet and the external Data Source An ADO.NET DataSet is a collection of ADO.NET DataTables Slide 30 Copyright 2003 Amadeus Software Limited

Accessing Data Using a DataAdaptor To populate a DataGrid with a SAS Data Set Use connection to specify location of SAS Data Set Use an OleDbCommand on the open connection to specify the Data Set name and that we want to access a table (CommandType of TableDirect) Create a DataAdapter using the command specified Use the DataAdapter to Fill a VB.NET DataSet with the contents of a SAS Data Set Set the properties of the DataGrid so it s data source is the VB.NET DataSet and the table to display has the same name as the SAS Data Set Slide 31 Copyright 2003 Amadeus Software Limited

Accessing Data Using a DataAdaptor Private Sub GetData() cn.connectionstring = _ "Provider=sas.LocalProvider;Data Source" & SASLib cn.open() Dim cmd As OleDb.OleDbCommand = cn.createcommand() cmd.commandtype = CommandType.TableDirect cmd.commandtext = "demog" Dim oleda As OleDbDataAdapter = New _ OleDbDataAdapter(cmd) Dim ds As DataSet = New DataSet() oleda.fill(ds, "demog") DataGrid.DataSource = ds DataGrid.DataMember = "demog" End Sub Slide 32 Copyright 2003 Amadeus Software Limited

Conclusions With Integration Technologies SAS have provided us with the mechanism to create User Interfaces either on the Web or Desktop in a variety of languages which can utilise the functionality of SAS as either middle tier or as a back end This paper has introduced some of the key functions that a developer may wish to incorporate into their applications Slide 33 Copyright 2003 Amadeus Software Limited

Questions on Building Windows Front Ends to SAS Software? Katie Essam Senior Consultant Amadeus Software Limited Email: katie.essam@amadeus.co.uk Web: www.amadeus.co.uk