HOW TO DEVELOP A SAS/AF APPLICATION

Similar documents
SAS/AF FRAME Entries: A Hands-on Introduction

Prevent Pane - Moving from MENU & PROGRAM Entries to FRAME Entries Loretta Golby, ISM Alberta Serge Dupuis, BKD Software Consultants Edmonton, Alberta

CHAPTER 7 Using Other SAS Software Products

Feature PROGRAM Entries FRAME Entries. quickly prototype an'application using the interactive development environment

Getting Started With Frame Technology Christopher A. Roper, Qualex Consulting Services, Inc., Hillsville, Va.

AN INTRODUCTION TO DEVELOPING APPLICATIONS WITH SAS/AF FRAME ENTRIES. Advanced Tutorials. NESUG '96 Proceedings

Jennifer Clegg and Carol Rigsbee, SAS Institute Inc., Cary, NC

Journey to the center of the earth Deep understanding of SAS language processing mechanism Di Chen, SAS Beijing R&D, Beijing, China

Introduction to FRAME Entries in SAS/AF Software John C. Boling, SAS Institute Inc., Cary, NC

An Introduction to SAS/FSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

For example, let's say that we have the following functional specification:

Chapter 28 Saving and Printing Tables. Chapter Table of Contents SAVING AND PRINTING TABLES AS OUTPUT OBJECTS OUTPUT OBJECTS...

A Guided Tour Through the SAS Windowing Environment Casey Cantrell, Clarion Consulting, Los Angeles, CA

An Introduction to SAS/SHARE, By Example

An Example of Using SAS/AF DATA TABLE Class In Reviewing Clinical SAS Data Sets

Getting Up to Speed with PROC REPORT Kimberly LeBouton, K.J.L. Computing, Rossmoor, CA

Changes and Enhancements

Writing SAS/AF Applications that run in both an Interactive and Batch Environment

SAS Viya 3.3 Administration: External Credentials

Statistics, Data Analysis & Econometrics

No previous knowledge of Java is required for this workshop.

Dynamic Projects in SAS Enterprise Guide How to Create and Use Parameters

Introduction. Introduction to SCL. SCL Elements CHAPTER 1

Getting Started with SAS/A~ Software Steven A. Wilson, MAJARO lnfosystems, Inc., San Jose CA

SAS Macro. SAS Training Courses. Amadeus Software Ltd

Overview. CHAPTER 2 Using the SAS System and SAS/ ASSIST Software

ABSTRACT MORE THAN SYNTAX ORGANIZE YOUR WORK THE SAS ENTERPRISE GUIDE PROJECT. Paper 50-30

SAS/Warehouse Administrator Usage and Enhancements Terry Lewis, SAS Institute Inc., Cary, NC

SAS/FSP 9.2. Procedures Guide

Working with Macros. Creating a Macro

Be Your Own Task Master - Adding Custom Tasks to EG Peter Eberhardt, Fernwood Consulting Group Inc. Toronto, ON

SAS Catalogs. Definition. Catalog Names. Parts of a Catalog Name CHAPTER 32

SAS Clinical Data Integration Server 2.1

An Application Developer s Roadmap for Moving to Version 7 in SAS/AF Steven A. Wilson, MAJARO InfoSystems, Inc., Santa Clara CA

Version 6 and Version 7: A Peaceful Co-Existence Steve Beatrous and James Holman, SAS Institute Inc., Cary, NC

Macro Architecture in Pictures Mark Tabladillo PhD, marktab Consulting, Atlanta, GA Associate Faculty, University of Phoenix

Beginning Tutorials. PROC FSEDIT NEW=newfilename LIKE=oldfilename; Fig. 4 - Specifying a WHERE Clause in FSEDIT. Data Editing

Developing Clinical Data Management Systems using Version 8.1 of SAS/AF Steven A. Wilson, MAJARO InfoSystems, Inc., San Jose CA

SAS Clinical Data Integration 2.4

APPENDIX 2 Customizing SAS/ASSIST Software

David S. Septoff Fidia Pharmaceutical Corporation

Paper ###-YYYY. SAS Enterprise Guide: A Revolutionary Tool! Jennifer First, Systems Seminar Consultants, Madison, WI

Syntax Conventions for SAS Programming Languages

Both Data Form and Data Table share many features.

SAS Clinical Data Integration 2.6

Beginning Tutorials. Introduction to SAS/FSP in Version 8 Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

CATALOGER: An Application Development Tool to View, Compare, and Document SAS Catalogs and Data Files

A SAS/AF Application for Linking Demographic & Laboratory Data For Participants in Clinical & Epidemiologic Research Studies

Océ DS10. Operator s manual

SAS Factory Miner 14.2: User s Guide

Going Under the Hood: How Does the Macro Processor Really Work?

Macro Basics. Introduction. Defining and Using Macro Variables. Defining and Using Macros. Macro Parameters. Part 1. Chapter 1. Chapter 2.

CHAPTER 7 Examples of Combining Compute Services and Data Transfer Services

WHAT ARE SASHELP VIEWS?

Introduction. LOCK Statement. CHAPTER 11 The LOCK Statement and the LOCK Command

Data Manipulation with SQL Mara Werner, HHS/OIG, Chicago, IL

Introduction. CHAPTER 3 Working in the SAS Windowing Environment

ABSTRACT INTRODUCTION THE ODS TAGSET FACILITY

Files Arriving at an Inconvenient Time? Let SAS Process Your Files with FILEEXIST While You Sleep

SAS. Information Map Studio 3.1: Creating Your First Information Map

External Files. Definition CHAPTER 38

SAS. IT Service Level Management 2.1: Migration Documentation

Chapter 28 Command Reference. Chapter Table of Contents TSVIEW COMMAND FORECAST COMMAND

Using SAS/SHARE More Efficiently

The OLAPCONTENTS Procedure Shine the light onto your OLAP Cubes Jerry Copperthwaite, SAS Institute, Cary, NC

A Practical Introduction to SAS Data Integration Studio

Designing Web Applications: Lessons from SAS User Interface Analysts Todd Barlow, SAS Institute Inc., Cary, NC

A Simple SAS/AF Program To Manage SAS/CONNECT Sessions David D. Chapman, U.S. Bureau of the Census

Using OLE in SAS/AF Software

SAS/Warehouse Metadata API. Reference Second Edition

Chapter 3 Managing Results in Projects. Chapter Table of Contents

Photos with Text Reports on the Same SAS/AF Screen

ODS Meets SAS/IntrNet

SAS Infrastructure for Risk Management 3.4: User s Guide

Multi-Sponsor Environment. SAS Clinical Trial Data Transparency User Guide

SAS RDBMS! A GUI Approach to Data Entry Using SAS/AF Enforced With Relational Model Integrity Constraints from ORACLE

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently.

Xprint V8.0. Graphical User Interface

SAS Data Libraries. Definition CHAPTER 26

README. SAS Download Manager. Overview. Using the SAS Download Manager

Introduction to the SAS Macro Facility

Can I have the menu please?

Using Graph-N-Go With ODS to Easily Present Your Data and Web-Enable Your Graphs Curtis A. Smith, Defense Contract Audit Agency, La Mirada, CA

Chapter11 practice file folder. For more information, see Download the practice files in this book s Introduction.

Creating and Executing Stored Compiled DATA Step Programs

FSEDIT Procedure Windows

The GTESTIT Procedure

Storing and Reusing Macros

SAS/IntrNet 9.2. Xplore Sample Web Application. SAS Documentation

How Managers and Executives Can Leverage SAS Enterprise Guide

WPS Workbench. user guide. "To help guide you through using the WPS user interface (Workbench) to create, edit and run programs"

Security Systems. Security Technologies Database RUTGERS PUBLIC SAFETY. November 16, 2007 Volume 1, Issue 1. Procedures for Database Utilization

JDMS - A Java Based Alternative to Motif DMS Windows Susanna Wallenberger, Janice Replogle, SAS Institute Inc., Cary NC

\WSS95. Applications Development. Managing Longitudinal Panel Surveys Using Interactive Applications Created by SAS!Af and SASJFsp with SCL

Essential ODS Techniques for Creating Reports in PDF Patrick Thornton, SRI International, Menlo Park, CA

Reading and Writing Data from Microsoft Excel/Word Using DDE

Designing Accessible Help Systems

Improving Your Relationship with SAS Enterprise Guide Jennifer Bjurstrom, SAS Institute Inc.

The NESTED Procedure (Chapter)

SAS/ASSIST Software Setup

Transcription:

PS001 Creating Effective Graphical User Interfaces Using Version 8 SAS/AF Anders Longthorne, National Highway Traffic Safety Administration, Washington, DC ABSTRACT Improving access to an organization s database can often result in large gains in productivity and therefore lead to improved response time to customers. This paper will show how this goal can be achieved using applications developed with SAS/AF software. Applications implemented using SAS/AF can be used by all workers within an organization, including those who do not have SAS programming experience. INTRODUCTION SAS/AF software provides a set of tools that allows for the development of powerful interactive and intuitive applications. The ability to produce applications of this kind can quickly help an organization to improve its productivity and therefore its response time to customers. A developer must have SAS/AF software licensed on his computer in order to start developing the type of applications that will be discussed in this paper. To run SAS/AF applications only requires a licensed copy of Base SAS. There have been many books and papers written on the subject of SAS/AF and therefore this paper will not concentrate on the technical details of SAS/AF. Instead this paper will give details regarding the steps needed to create a basic application. By learning how to create and manipulate a basic application, the door to using SAS/AF will be opened; and with further reading and practice a new user should be able to develop sophisticated solutions to an organization s needs. This paper assumes that the reader has a good knowledge of Base SAS, the SAS Macro Language, the SAS Output Delivery System (ODS), and a basic understanding of object-oriented programming. SAS/AF OVERVIEW SAS/AF software is a type of software that is generally known as object-oriented. Visual Basic, C++ and Java are other types of object-oriented software. Creating applications using object-oriented software is known as object-oriented programming (OOP). The key concept behind OOP programming is that a program is viewed as a collection of independent objects, where the objects have two characteristics: state (data) and behavior (operations that can be performed on the data). SAS/AF objects store their state within their Attributes. Attributes are variables that can be of the following types: Numeric, Character, List, Array and Object. Methods are functions that are used to change an object s state. For a more detailed discussion, please refer to the SAS documentation referenced at the end of this paper. CATALOGS SAS/AF applications are built around a SAS catalog. SAS catalogs are storage locations that are only usable by the SAS system. Catalog entries are stored within a SAS catalog. While there are many types of Catalog entries, this paper is going to concentrate on only two types: Frame entries and their related Screen Component Language (SCL) entries. Applications can be easily developed using just one catalog, however it is also possible to use multiple catalogs. FRAME ENTRY Frame entries are windows within which instances of visual classes (controls or components) are placed. This is where the Graphical User Interface (GUI) for an application is developed. The GUI is usually the only part of an application that an end user will interact with and therefore proper design of a GUI is essential. - 1 -

SCL ENTRY SCL entries can either be stand-alone programs or they can be linked to a Frame entry. When linked to a Frame, SCL entries can be used to provide functionality to the visual components of the Frame. HOW TO DEVELOP A SAS/AF APPLICATION There are two ways to develop SAS/AF applications: using interactive development windows or using the Build Procedure. This paper will concentrate on using the interactive windows environment. CREATE A CATALOG 1. First create a new SAS library. 2. Enter the new library via the SAS Explorer window. 3. Select FILE -> NEW -> CATALOG 4. Name the new catalog and then click ok. CREATE A FRAME ENTRY AND ITS ASSOCIATED SCL ENTRY 1. Enter the new catalog via the SAS Explorer window. 2. Select FILE -> NEW -> FRAME 3. A new window will open on the right side of the screen and a third pane, called Components, will be added along side the SAS Explorer and SAS Results window. The new window is the Frame entry. 4. Select FILE -> SAVE AS. Enter a name for the new Frame and click save. 5. Select VIEW -> FRAME SCL. This will open the associated SCL entry for the new Frame. The SCL entry will have the same name as the new Frame but it will be of the SCL entry type. VISUAL COMPONENTS OVERVIEW The following table contains descriptions of some of the more generally useful visual components that are provided with SAS/AF. The visual components described in the table should provide enough functionality to allow a developer to produce effective applications. Visual Class Name Appearance Description Check Box Control Combo Box Control Provides a switch for On/Off, True/False or Yes/No functionality. Provides a drop down list of items from which an end user may select only one. List Box Control Push Button Control Radio Box Control Text Entry Control Text Label Entry Provides a list of items from which an end user may scroll through and select one or more. Provides a push button that can be used to run a process or provide switch functionality that is similar to the Check Box Control. Provides mutually exclusive selection options, so that only one selection can be made at any time. This Class is similar to the Combo Box Control except that all choices are visible. Provides the end user an option to enter text. Provides a text label that is not editable by the end user. These labels can be used to create page titles or to provide help and guidance to the end user. - 2 -

DEVELOP A SIMPLE APPLICATION USING A RADIO BOX VISUAL COMPONENT 1. Have the Frame and Components Window open. 2. Click on the Radio Box Control in the components window. Be sure to select from the Components list and not from the Version 6 objects list. 3. A Radio Box Control should appear in the Frame. 4. Click on the Frame and then Select VIEW -> PROPERTIES WINDOW. The Properties dialog window should open. On the left side of the properties window will be an expandable menu for all of the objects currently on the Frame. Expand RadioBox1 to view all of the possible Attributes, Methods and Events for the Radio Box Control Object. RadioBox1 is the default name for the object. This name can be easily changed by setting the object s name attribute. There are many other attributes divided into categories such as Appearance, Behavior, and Data etc. All the visual components described in the above table have very similar attribute lists associated with them. All of these attributes can be either interactively manipulated, using the mouse or keyboard via the properties window, or they can be manipulated from within an SCL program. To discuss and understand the full power of all of these attributes is beyond the scope of this paper. 5. In the properties window select ATTRIBUTES -> DATA. Open the list located in the VALUES column of the ITEMS ATTRIBUTE row. This is where a developer may enter data to be used as selections by an end user. Something similar to the following should be visible: - 3 -

6. Select Remove All. Use ADD to populate the list with data. This list now contains all possible selections to be displayed. Click OK and then close the properties window. - 4 -

7. Something similar to the following should be visible: 8. In a short time we have developed a very simple Graphical User Interface (GUI). To add functionality to this GUI we will now open the associated SCL entry. Click on the Frame. Select VIEW -> FRAME SCL. Something similar to the following should be visible: - 5 -

9. The SCL entry is where SCL code can be written to add functionality to the GUI. SCL is a fully developed and powerful programming language. A full discussion of SCL is beyond the scope of this paper. One very important feature of SCL programs is that they allow for the submission of SAS DATA STEP and SAS PROCEDURE statements to the SAS SYSTEM. This allows SAS/AF to be put to work without a programmer having to be an SCL expert first, although in the long run learning SCL will allow for even more powerful applications. SCL programs can be divided into what are known as Labeled Sections. These labeled sections allow for the development of modular code and for selective processing. The four main labeled sections are described below: The INIT section is executed when the associated application window (Frame) is opened. This can be used to set an application s initial conditions. The MAIN section is executed each time a field (control or component) within an application window (Frame) is modified. The RADIOBOX1 section is executed each time the RADIOBOX1 object is modified (when a selection is made). This section always executes before the MAIN section. Every visual component added to the Frame can have its own Labeled Section. The TERM section is executed when an application window (Frame) is closed. This can be used to close files, tables, clean up old variables etc. 10. Remove all label sections except RADIOBOX1. Within a labeled section it is possible to place what are called submit blocks. Within these submit blocks can be placed SAS DATA STEP and SAS PROC statements. These statements are then submitted to the SAS SYSTEM for execution. For the following example, assume that the available selections on the RADIOBOX1 object are SAS databsets that an end user wishes to run PROC CONTENTS on. - 6 -

SAS/AF Version 8 uses what is known as Dot Notation for returning (and setting) the value of an object s attribute. The standard syntax for returning an attributes value is: CurrentValue = ObjectName.AttributeName. If the variable, CurrentValue is not defined then it will be automatically created. When finished with developing an application select BUILD -> COMPILE. This will compile an application and will inform a developer of any problems via the Log window. Between SUBMIT CONTINUE; and ENDSUBMIT; can be placed SAS DATA step and PROC statements. CONTINUE causes these statements to execute immediately. There are options other than CONTINUE. Please see the SAS documentation referenced at the end of this paper. The value of an SCL variable can be passed into submit blocks by placing a single ampersand (&) in front of the variable name. If there are also using Macro variables within an SCL program and there is a name conflict, then use two ampersands (&&) in front of the variable name in order to force the value of the Macro variable to be used instead. 11. Close the Frame after compiling with no errors. Right mouse click on the Frame in the Explorer window and select RUN. The application should open on the right of the screen. Test the functionality of the application and check the Log file for errors. Something similar to the following should be visible: - 7 -

Run your application Application should open on the right. - 8 -

CONCLUSION The goal with this paper was not only to show the power of SAS/AF but to also show that getting started with SAS/AF need not involve weeks of study. Its intuitive point-and-click development environment is very user friendly and this allows for beginning SAS/AF programmers to see end results quickly. Once started, a developer, with practice and patience, should see satisfying improvements in the level of sophistication of his or her applications. REFERENCES SAS Institute Inc., SAS Component Language: Reference, Version 8, Cary, NC: SAS Institute Inc., 1999 SAS Institute Inc., SAS/AF Software: Class Dictionary, Version 8, Cary, NC: SAS Institute Inc., 1999 SAS Institute Inc., SAS/AF Software Procedure Guide, Version 8, Cary, NC: SAS Institute Inc., 1999 Developing SAS/AF Applications Made Easy, Bernd E. Imken, SUGI28 Getting Started with SAS/AF Software, Steven A. Wilson, SUGI27 SAS/AF: It s Not What It Used to Be!, Soora Wi, SUGI27 CONTACT INFORMATION Anders Longthorne US DOT, NHTSA, NPO-121, Room 2316 400 7th St., SW Washington, DC 20590 Tel: (202) 366-5356 Fax: (202) 366-7078 Email: anders.longthorne@nhtsa.dot.gov SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies. - 9 -