PROC FSVIEW: A REAL PROGRAMMER'S TOOL (or "a real programmer doesn't use PROC PRINT")

Similar documents
PROC FSVIEW: A REAL PROGRAMMER S TOOL (or a real programmer doesn t use PROC PRINT )

FSEDIT Procedure Windows

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

FSVIEW Procedure Windows

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

SAS/FSP 9.2. Procedures Guide

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

MillinPro+ USER GUIDE. A Complete Web-Based Platform for Managing Medical Bills and Insurance Claims

The DATA Statement: Efficiency Techniques

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

10 The First Steps 4 Chapter 2

User Guide. Version 3.0. Revision Date: 11-Feb Esoterix, Inc., All Rights Reserved

Provider Secure Portal User Manual

Using SAS Files CHAPTER 3

Chapter 2 The SAS Environment

MDr PracticeManager Multiple Charge Entry

Integrated MS-DRG Grouper & Calculator Printable How To Guide

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

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

Creating and Locating Electronic Forms The Basics Training Part 2 of 5 COGCC Denver, CO

A Tutorial for Excel 2002 for Windows

Using SAS Files CHAPTER 3

Ten Great Reasons to Learn SAS Software's SQL Procedure

Locking SAS Data Objects

Lexis for Microsoft Office User Guide

What Is SAS? CHAPTER 1 Essential Concepts of Base SAS Software

Introduction. Introduction to SCL. SCL Elements CHAPTER 1

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

Welcome to Client Access Web!

Look Ma, No DATA Stepl An Introduction to SASIFSP Software

EZClaim Advanced Quick Start Guide

Link 1500 / Online Claims Entry User Guide

USING TMXWR & TMXWRX U PDATED

SYSTEM 2000 Essentials

Spreadsheet definition: Starting a New Excel Worksheet: Navigating Through an Excel Worksheet


Provider User Guides

Provider TouCHPoint Training Guide

Tellus EVV Introduction and Dashboard TRAINING REFERENCE GUIDE

CPS v12 Tips, Tricks and Shortcuts. Presented by Arman Virani and Maurice Rosenbaum HealthSystems

DXWeb Webenabled Version 4.0 Supplement

Microsoft Office Excel 2007

SAS Programming Basics

FOCUS ON: DATABASE MANAGEMENT

Team Member Management

VisRMS Resident Scheduling Module Visits Quick Tracker Visits Quick Tracker Overview... 3 Set Up Information... 3

Advisor Workstation Training Manual: Working in the Research Module

VETtrak Data Insights User Guide. for VETtrak version

CLAIMS ACTIVITIES IN PRO32

Patient Registration

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

Netsmart Sandbox Tour Guide Script

EXPERIENCES USING SAS/ACCESS IN A COMPLEX RELATIONAL DATABASE APPLICATION. Murty Arisetty, Howmedica, Div. of Pfizer Hospital Products Group, Inc.

Excel Project 5 Creating Sorting, and Querying a Worksheet Database

New Perspectives on Microsoft Excel Module 5: Working with Excel Tables, PivotTables, and PivotCharts

Service Minder Plus Features/Helpful Hints

Microsoft Office Access Learn how to use the Query window in Design view. Tutorial 3b Querying a Database

Lecture bonus with Mentimeter

Excel Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts. 6. You can use a table s sizing handle to add columns or rows to a table.

CareDx Customer Web Portal User Guide Version 3.6.3

Batch vs. Interactive: Why You Need Both Janet E. Stuelpner. ASG. Inc Cary. North Carolina

Representative Payee Manager User Guide

IBM. Database Database overview. IBM i 7.1

Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts. Microsoft Excel 2013 Enhanced

HarePoint Analytics. For SharePoint. User Manual

Scottish Care Information. SCI Gateway v10.3. Sending Referrals & Receiving Discharges User Guide

Chapter 9 Data Analysis

Microsoft Office Excel Use Excel s functions. Tutorial 2 Working With Formulas and Functions

Expense: Process Reports

Filing Forms Electronically COGCC Denver, CO

Querying Data Easily with the SQl QUERY Window Henrietta Cummings, SAS Institute Inc, Cary, NC

If You Need These OBS and These VARS, Then Drop IF, and Keep WHERE Jay Iyengar, Data Systems Consultants LLC

Membership Table of Contents

TOP 10 (OR MORE) WAYS TO OPTIMIZE YOUR SAS CODE

EXCEL 2003 DISCLAIMER:

Getting Information from a Table

Base and Advance SAS

BANNER 9 QUICK NAVIGATION GUIDE

APPENDIX 3 Tuning Tips for Applications That Use SAS/SHARE Software

SAS Studio: A New Way to Program in SAS

Welcome to Cole On-line Help system!

UC Davis Health System

1. Managing Information in Table

Azquo User Guide. data made simple

DBLOAD Procedure Reference

Access Intermediate

Tutorial 3 Maintaining and Querying a Database. Finding Data in a Table. Updating a Database

EVALUATION ONLY. In this chapter, you will learn new. Text and Analysis EXCEL 2016 CHAPTER TIMING PROJECT: ANALYZING SALES INFORMATION

Working with Mailbox Manager

Tellus EVV Introduction and Dashboard TRAINING REFERENCE GUIDE

Stata: A Brief Introduction Biostatistics

MAPIR User Guide for Eligible Hospitals. Medical Assistance Provider Incentive Repository (MAPIR): User Guide for Eligible Hospitals

SAS Infrastructure for Risk Management 3.4: User s Guide

SAS System Powers Web Measurement Solution at U S WEST

Contents. About This Book...1

EXCEL Using Excel for Data Query & Management. Information Technology. MS Office Excel 2007 Users Guide. IT Training & Development

Chapter 5 Retrieving Documents

SURVEYOR/400. Users Guide. Copyright , LINOMA SOFTWARE LINOMA SOFTWARE is a division of LINOMA GROUP, Inc.

Microsoft Access XP (2002) - Advanced Queries

User Manual. MDWorkflow. Web Application from Midrange Dynamics

Transcription:

PROC FSVIEW: A REAL PROGRAMMER'S TOOL (or "a real programmer doesn't use PROC PRINT") Marge Scerbo and Alan Wilson CHPDM-University of Maryland at Baltimore County UMDNJ-Robert Wood Johnson Medical School Abstract Although SAS/FSP* is often regarded as the domain of application developers using SAS/AF, SAS/EIS, sel and FRAME, new enhancements have made PRoe FSVIEW an efficient and effective tool for programmers and researchers to browse and edit data, debug SAS code, perform multi-level queries on-line and create reports and new data sets interactively. An on-line demonstration will show subsetting with WHERE and WHERE ALSO clauses, interactive SORTing, and rearranging the displayed columns as scrolling or ID variables. This tutorial will also include examples of modifying existing variables and creating new variables interactively using FSVIEW formulas. In addition, and perhaps most importantly, the when and why to use PRoe FSVIEW will be discussed. Introduction One could say that PROe PRINT is a simple snapshot while PROe FSVIEW is an interactive video. The PRINT procedure allows a programmer to create a static view of the data; in an FSVIEW session the programmer can actively change the display of the data and turn it up, down and around to allow alternate views of the data. In addition, FSVIEW provides the opportunity to edit the data set interactively. In a perfect world, data is entered cleanly with validation of each field as well as each record. The observations in the IDe create a whole and work together. But this is not a perfect data world. Validating each field can slow a system to a crawl. There is rarely validation across records or across IDes except for table lookup checks. A researcher cannot progress to reporting and data analysis without really "seeing" what is in the IDe. Grasping a basic understanding of where or how outliers occur is needed. And so it comes down to the tedious task of "looking" at the data. There is simply no way around an intimate understanding of the data if the research is to be yalid. In order to understand the data, it must be viewed from several perspectives. Final reports may not rest on only one identifying variable but on many, depending on the aim of the particular research. FSVIEW can play an important role in the everyday life of a researcher. It can be used to view the initial data as it is stored in the data set. It can then be used to track the manipulation of the data values as the DATA and/or PROC steps progress. It can also be used to view the 'final' data. set to be analyzed; this 'final' copy may have been subset, sorted, and contain new calculations, all which could have been constructed prior to the view and interactively during the session. This paper will step through the process of 'playing with the data' using FSVIEW. The steps themselves are easy and could fit into a beginning tutorial. But the processes discussed will best suit the needs of more advanced programmers who may have faced the problems mentioned above and to be discussed throughout the paper. The goal of this tutorial is to introduce the new facets of this procedure and their potential use in the everyday life of a programmer or researcher. The DATA One data set will be discussed and manipulated throughout the paper. This data set contains 17 variables and over 2500 observations. Here is the PROC CONTENTS of the data set: NIIME TYPE LpGTH Li\BiL AGE 1 4 Age as of March 31 AID1 1 4 Eligibility Category BBGDOS 1 5 Beginning date COUNTY 1 4 County DOSDIS 1 5 Date of discharge DX2 2 5 Secondary diagnoses MCARE 2 1 Medicare Indicator PAY 1 B Payment POX 2 5 Primary diagnoses PLACE 1 4 Place of service PROCODE 2 5 Procedure code RACE 1 4 Race RECID 2 11 Recipient ID SERVCD 1 4 MA service code SEX 1 4 Gender SPEC 1 4 Proyider specialty NESUG '96 Proceedings 90

This data is a sample from Maryland Medicaid claims data. The file includes data on each procedure performed by a physician in a variety of sites: hospitals, clinics, office, etc. The records will also include diagnosis codes (ICD9- CM codes), dates, and charges for the treatment and patient information such as gender, age, race, and a flag indicating Medicare coverage. The data were only partially validated at the time of data entry. PROCPRINT PROC PRINT has long been a basic tool of the SAS programmer and there is no reason for this not to remain so. It provides a simple method to view the actual contents of a record or records in a data set. This procedure allows selection and order of variables (with use of the V AR statement) and selection of observations (with use of the WHERE statement). But once a PROC PRINT output has been produced, the information is fixed (unless of course someone chooses to manually edit it). There is some degree of control over the output: observation numbers may be omitted from the output (NOOBS); the pages may be formatted to appear alike (UNIFORM); an ID variable can be specified (10 var); numeric variables can be summed (SUM var). But in the end, programmer control over the output and its appearance is limited. Although PROC PRINT has been around since the beginning of base SAS, the Display Products Division, under the leadership of Dr. James H. Goodnight, developed SAS/FSP for SAS Version 5 over ten years ago. The predecessor to FSVIEW was FSPRINT, which is still accepted as an alias. PROCFSVIEW FSVIEW is an interactive procedure allowing full screen browsing and editing of SAS data sets and SAS data views created with the SQL procedure or SAS/ACCESS. FSVIEW will display the data set or view as a table with observations as rows and variables as columns. It can be run from a batch program, from the display manager, or from the command line. FSVIEW can be used to manipulate the display of the data; to calculate new variables (either permanent or temporary); and create a new data set, be it a subset, resort or recalculation of the original data set. The use of menu objects and the mouse, available in a windowing enviroument, makes it easier for most people to use. For those oldtimers who avoid the use of the mouse, commands can be entered from the command line. Note that FSVIEW allows the editing of the data set in place -- the live data set. This paper will not discuss this aspect of the procedure in depth, except in the discussion of the SORT command. The emphasis of this paper is the manipulation of the display of the data, the calculation of new variables (either permanent or temporary) and the creation of a new data set, be it a subset, resort or recalculation of the original data set. This procedure is a utility that can grow on a programmer. The more it is used, the more useful it becomes. This is particularly the case in displaying data that is not clearly documented and/or validated. It provides the programmer or researcher a starting point on which to continue the study. With more use, it also becomes an invaluable utility for viewing the progress of data set manipulation or creation. Proc FSVIEW is but one of the procedures included in the FSP software product line. Other procedures include FSEDIT and FSLIST, but FSVIEW is probably the most useful procedure to a researcher or anyone who deals with dirty, inconcise, or poorly documented data. To submit an executable statement to SAS, the program can be as simple as: PROC FSVIEW DATA RUN; DEMO. CLAIMS; assuming of course that a library has been referenced as DEMO. There are options available for the FSVIEW statement, including V AR, WHERE, etc. The default screen for the above code would be displayed as: W2111SS4.. /24/1_ 1113011", 0811811994 0813011".. 101'''1994 GtlI711S95..,15/1. '/'11/1_ WIIiII"" ovrn/lsls MlI6II"S 10/11/1* WWIS95 WW,... 11111/1994 011'21/1_ 10I1S/1* 0412911!1!15 H~3fl!1J4!~!!~!!!!... 17 000.. OMoeI.1 4149 III OHOO 11 V709 HI MOOO 17... 5... I. W" 11 1709 n 29510 " "18:1 as 147. 5'.HH If 14210 11 4U' sa 21512.7 S24ZG IS 09Of'!!!!!!2 Note that the variables appear as columns and are listed in the order in which they were stored in the data set. The records are displayed in rows, each identified by an observation number. PROC FSVIEW displays as many observations and variables at a time as can fit within the 91 NESUG '96 Proceedings

display. If the data set is longer or wider than can be displayed on a screen and a mouse is identified, scroll bars will appear on the bottom and right side of the screen; these can be used to move from one variable to another or from one observation or another. If a mouse is not available, the commands right and left, up and down, etc, can be used on the command line or assigned to function keys. Browse vs Edit Mode By default, an FSVIEW session is opened in browse mode which does not allow editing capabilities. The letter (B) is displayed at the top of the window. In almost all cases, the processes described in this paper can be run from browse mode; the exception is sorting the data set. If the FSVIEW session is in the browse mode, any newly calculated values will be temporary. However if the edit mode is in effect (the letter (E) is displayed), then any edited variable values will be replaced and newly calculated variables will be stored immediately. A new aspect found in the FSVIEW editing process in Version 6.08 and later is the concept of two control levels. The first is RECORD level, where one record at a time is highlighted (by clicking or pressing Enter on it), locked, and modifiable. The second is MEMBER level locking, where the whole data set is locked and any observation can be edited. The selection Edit-> Update- > Member.. or the MODIFY MEMBER command will lock the entire data set for sorting. -The FSVIEW session can be executed directly in edit mode by using the EDIT option or (cntllev= member) argument in an FSVIEW command or a PROC FSVIEW statement. The File option of the menu bar allows for the saving of the original data set or a new data set. To create a new data set, choose the File- > Save As... : Always use caution when working within an edit session of FSVIEW; all edits and sons change the data set immediately--interactively. The File- > Cancel. option does not 'undo' any of these changes. The NOREPLACE system option does not apply to FSVIEW. For researchers, understanding the data and how to analyze it is far more important than the ability to change the values. Exclusion of certain observations is a more accepted method for the analysis of data than editing of the data values. Arranging Variables Once a PROC PRINT has been run, 'What you see is what you get'. This is not the case with PROC FSVIEW. By default in an FSVIEW session, all variables and all observations of the data set will be displayed. Often there are more variables displayed than are actually -needed for a current indeptb study of the data. To 'drop' a variable or variables, select View- > Arrange Variables. The three options under this submenu are Drop., Show. and Move... With these options, the user can control which variables are to be displayed and in what order. The screen displayed is: I'.. "0" 00000 44 412.8 414' II.toOO 11 yr., II OOOto 11... 5 0549 II YlOO' 11 '1(11. 2'570 " 80183 II &4'0.7... 00 17 14210 II 4&1iO sa t95u!! ~!! ~ 09/21.11"" 01/M11995 1113011SM 081'1111194 O8I301IIM 10/10/'194 08/'15.11SM OU'S/ISM ~i~l!ft 02/17/1995 0&f2&/1," 02/.711SSS..v0"'ln5 10.117/1_ 64J'HI'I!1SS OSIKlIIM 11/1111... Oi/211'IftS 10.11511"" WHI'!3S.."..,.-., 00000...... 412 It 4149 ".1000 11 Y709 " "Of' 11 84. 5 0549.8 woe. 53 II usn I'".9 ""0 93 80113 If 00000 11 1421. 11 04110 93 29512 17 92420 A To drop one variable, simply enter the variable name in the box and press ENTER. More often, there are multiple variables to be removed from the display. To accomplish this without individually naming each variable, click on the OK and a list of variables will be displayed. Highlight (press the Enter key or mouse button) the variables to be dropped. If there are more 'pages' of records, use the page up and page down key to move backward and forward through the data set. The list of variables is useful in that it contains the variable name, variable type, and label; with a 1arge data set this makes the process of distinguishing one NESUG '96 Proceedings 92

variable from another much easier. The list displayed on the screen would be: user-defmed format is to be used, it must have been identified by a temporary PROC FORMAT statement preceding the PROC FSVIEW call or a LIBNAME LffiRARY statement pointing to the location of a Formats catalog. This screen shows the before and after effects of a format imposed on the variable, PAY: O!ll211'1IM, 3 12.1 1t/301'1"" 3." 14' 01l24/UI!lS lillo/19m, 1ii.48 09121.11994 1.. 15.5 10/10/1994... 10/10/'1994, 2.21 02/17/1995, 02/17/199S ".. O4/HlIIIS... 01/241'1995 3. '1/18/1994 '3. OBlIl/19M 5 &.48 01130/'934, 01/30/1954 08/19/1994." 08/19/1'M $" 10 33 0812 1'1914 001lt9/.,14 10 S33 0111911994 08/!6Il!11"., 02/0111995 11 $4' 02/07/1915 " 041'211'1115 '3 50 10/31/1994 13 '5O 10/31/1954 14 40.88 041'20/1915.. 14' 04/20/1195 IS H.II 911'Z8I'I954 15,., OS/26/19!M 18.5 1111)/UIS4 17 ",.." 11/11/1954 01/2311'95 $I. 01/2311915 10 54 IIV3VI994 " OS<.0/31/1''''..._..,..... $!! ~~~!!! "!8;.~ 04/29/1995.. If during the process, a dropped variable needs to be redisplayed on the screen, again select the View- > Arrange Variables submenu, but choose Show",. Use the default V AR option and click on OK. Select the variables to be 'added' to the display and press OK. Another option found in the Arrange Variables- > Show", menu is the ability to set an ID variable (non-scrolling variable). (The default color for ID variables is different from scrolling variables on color display monitors.) Choose the menu option Show (or SHOW ID var from the command line). Rather than having the observation number appear in the lefthand column, this column will be set to any variable or variables chosen from the data set. The maximum combined length of all ID variables is 60 characters. This is very useful when an identifying field allows more definition of the entire observation, an observation which may be too wide to appear on one screen. In data sets where there can be multiple observations with the same identifier, the ID variable will clarify the groupings of the observations. The observation number may be determined by entering the OBS command while the cursor is on the record of interest. Use the View->Rename selection to change the variable name and the View- > Assign Formats- > Format.. and Informal... options to change the variable attributes. For example, to change the format of the variable, PAY, to a more readable value, choose View- > Assign Formats-> FoT71Ull... from the menu. Enter the variable name, PAY, and the format, DOLLARIO.. Use formats or informats which are SAS system or user-defined formats. When a For advanced programmers the mechanism for use of the Arrange VariJJbles- > menu item is fairly intuitive and easy. But the strength of this menu is best defmed as a method for visualizing unknown or undefmed data. With data collected by other sources, including government agencies, the flie layout is only the tip of the iceberg in the comprehension of the data and therefore limits the ability to analyze it correctly. Fields which are defined in one fashion may actually include wrong data, undefined data, and other anomalies. These can affect the outcome of the study. Therefore, getting down and dirty with the data can help validate the study. Sorting the file The capability to sort SAS data sets using SAS's Full Screen Product (FSP) has been available since FSPRINT (Version 6.03 for PC's) and continues in FSVIEW. To sort the data set the default browse mode denoted by (B) must be changed to the edit (E) mode. The SORT command sorts the physical data set, not just the current display. To preserve a copy of the original data, be sure to save a copy of the data set before the SORT command has been issued. The SORT conunand (with the Ascending I Descending modifiers) can be applied to one or more variables. SORT AGE SEX DESCENDING PAY 93 NESUG '96 Proceedings

SORT cannot use computed variables. If necessary, create a new data set containing the new variable (see section on Formulas) and then SORT. In addition, SORT cannot be performed if a WHERE (permanent or temporary) clause is in effect. If the above SORT were imposed on the data, the display would be:... 31 011'111'1115.." 10/11/1914 10/, 04"31'1995 04/1 410 31 4 Z 0511111995.51, 411 Z4 4 03/0TI",.. 412.. 4 Z 07/28/IS'" '01' Of/J 413 11.5 4 Z.stuns,s.51, 414 15 4.",.,./1,,.. 415 14.5 4 07/10/1954 '01' 07/1 410 12.65 4 11113J'1'" II/( 411 U.5 08/'25/1994 '81' 418 12.1 lllaoli9s4 11/~ 410 10 4..., 0412S/199S 420 10 4 (113/27/1"5 081, 421 4.&/U/HiSS.."... 4.'..., 420 4 OV03llS!lS OS/I2/'ISM OIl' 424 50 1 o 11'11/1 ISS ou,, 1 03/3I/II!1S...,.. 0:/... 1'1111 407 4 400 4' 4!!!!! ~ This would give a 'look and feel' of a less sensitive frequency table. Actual observations can be identified to clarify inclusion or exclusion from results. Where Subsetting There are two methods for imposing a WHERE subset on a data set to be viewed by FSVIEW, a permanent subset and a temporary one. If the FSVIEW statement is submitted to SAS with a WHERE statement as in: " PROC FSVIEW DATA = DEMO.CLAIMS; WHERE PAY GT 10000; RUN; Only observations which meet the specification will be displayed with the word (Subset) in the window title. The data set can then be viewed and further subsetted, but those initially 'removed' observations will not be included until the FSVIEW session is ended, and another procedure without the subset is submitted. This is called a permanent WHERE clause and is equivalent to a WHERE = data set option. The above code only affects the display of the data set; the number of observations in the data set upon exiting FSVIEW will remain the same as the original data set before the WHERE subset was imposed, even if edit mode was selected. By submitting an FSVIEW statement without any initial subset, the entire data set is available for viewing. By selecting the Search- > Where menu item, various forms of the temporary WHERE clauses are available, and the word (Where... ) appears in the window title. The primary clause is the straightforward WHERE. A box will be displayed which allows the entry of a WHERE clause (the WHERE keyword is not needed). Note that while a WHERE clause is in effect, the observation numbers cannot be used to scroll an observation to the top of the window and the SORT command is not allowed. A correct WHERE clause includes a basic condition statement. This statement should be specific to either character or numeric types, dependent on the variable to be used for the subset. Character values must be enclosed in quotes and appear in the same case as in the data set. Functions can be used in the statement as well. For example, WHERE ROUND (PAY) GE 12000 or DOSDIS = TODAY () A WHERE clause can be augmented by use of the Search > Where also... option. This subset is imposed on the initial or subsequent subsets. A WHERE clause imposed on an already WHERE-subsetted data set will undo the last subset. Make sure to use Where Also to impose a second subset. To remove the last (most recent) subset, use the Where - > Undo last where selection. To cancel all WHERE subsets, simply select > Where Also... and submit it with no criteria, or enter WHERE CLEAR on the command line. These WHERE statements become even more useful with additional operators. For instance, the CONTAINS operator is very helpful in character string searches. Searching through a table for a hospital name that includes 'HOPK' to find all hospital which might be associated with JOHNS HOPKINS, such as WHERE HOSPNAME CONTAINS 'HOPK' The IN operator is useful when looking for observations where data may be found in a list of numbers or character strings. For example searching a primary diagnosis (PDX) within a set of codes where only the first three characters are used, WHERE SUBSTR(PDX, 1, 3) IN( '295', '300', '301') Another useful technique is to use the BETWEEN operator. This allows a search between two different NESUG '96 Proceedings 94

numbers or character strings. It is a simpler form of a phrase which includes less than and greater than. For example WHERE PROCODE BETWEEN 'R2100' AND 'R3400' By using various combinations of WHERE clauses, the mix of data stored in a particular data set can be clarified. It can help lead to a more efficient method of searching the data set for a particular set of observations in a larger program, and it may clearly demonstrate which fields contain outliers or errors in entry. Fonnulas PROC FSVIEW provides the ability to use formulas to create new variables and redefine existing variables. These formulas can be calculated from the values of any variables in the data set (even if these variables are not displayed). Formulas can be created, reviewed, cleared, saved and reused with the following menu options: Locals-> Define fonnuta., LoCQ/s- > Review fonnuta., Locals- > Clear fonnula, File-> Save as -> Fonnula., Open- > Read a fonnula.. File-> although a label associated with the variable is not displayed in the FSVIEW window. The formulas defined in a session can be Reviewed or Reset by the corresponding commands. The selection Locals- > Review fonnula... opens the Review window. The selection Locals- > Clear fonnula... will open the Clear formula window. Enter the selected variable name or ALL to reset (delete) all computed variables. Formulas can be named and saved to a SAS catalog, and reloaded and applied to subsequent FSVIEW sessions using the File- > Open- > Read a fonnula... selection. The formula saves with it all the custom features of the FSVIEW screen, including the current size, position and colors, and the order of the displayed variables, but not the current WHERE conditions. To create a formula, specify one or more statements (as many as will fit on the four lines), separating multiple statements with semicolons. Here is a short formula that creates a new variable which contains the month the procedure was performed: Creation of a formula can be done interactively in the Locals-> Define Fonnula. window, using as many SAS code statements as will fit on the four lines available in the window as shown below. Any function or operator is available for use in a formula. The concatenation operator, II, is used with the substring function to create a formatted diagnosis to match typical ICD-9 codes. The Name field defmes the variable to be created or modified. Enter the name of an existing variable to modify its values and press ENTER. To create a new variable, specify a new variable name whose values are the result of the calculations. (This new variable is added only to the display, not to the data set.) The Type field specifies the variable type. To select a type, select either NUMERIC or CHARACTER (NUMERIC is the default.) The Label field assigns a descriptive label up to 40 characters long, 95 NESUG '96 Proceedings

The COMPILE button checks the syntax of the formula. To return to the FSVIEW window, select OK at the bottom of the window. To cancel the formula definition and close the window, select the CANCEL button. The formula created is automatica1ly applied to the data set and displayed. The new variable appears at the far right of the display (this variable becomes the last variable in the data set). Although this field is added to the display, it is not automatically added to the permanent data set. Exiting the FSVIEW session without saving the formula will cause a message warning to appear at the bottom of the screen which states that the formula will not be stored. W ARNINO: No formula catalog. Use SAVE FORMULA command to store formulas Unless a formula created has been stored, it will be deleted at the close of the FSVIEW session. Remember that the changes made affect the display only and are not stored in the data set at the end of the FSVIEW session. To modify the data set permanently with a formula, edit mode must imposed. To store the formula permanently, choose File- > Save as -> Formula.... Enter the location and name of the formula. If this method is not used, saved formulas by default are stored in the SASUSER.PROFILE catalog, a user profile catalog that the SAS System creates. Therefore, if OK is selected from the FSVIEW Define Formula dialog box, an entry with the same name as the data set is stored in the SASUSER.PROFILE. The formula stores the names and order of the variables displayed and their formats and informats, plus the formula definitions and screen colors. The formula does not record which observations are currently displayed (determined by WHERE clauses). In later FSVIEW sessions, to reuse a stored formula associated with the data set and perform the calculations specified in an existing formula, access the formula by selecting File-> Open-> Read aformula... To read in a formula simply specify its name and exact location. Note that observations are not selected as in the prior FSVIEW session. To select observations based on conditions, use one or more WHERE clauses. Formulas can be of great use in the analysis process. They allow a researcher to view the data from different angles. This option provides the ability to create new variables from existing variables and then sort or subset the data set and view the results. The process becomes a 'living data set'. The data is static in its original form but is 'alive' under the microscope of FSVIEW. Printing By choosing the File-> Print utilities-> menu option and then the Screen print option, a 'snapshot' of the screen is printed. This is useful after various techniques have been executed and the data displayed shows a particular trend. The printout will contain only the variables and the observations displayed and not the entire data set. The printout is similar to a PROC PRINT with an OBS = option and possibly a FIRSTOBS = option. The When and Why and When not WhY use it? Use it because the better a researcher or analyst knows the data, the cleaner and surer the results will be. When else can FSYXEW he used? Use it generously to debug the development of the data analysis process and to check the results of logical procedures to insure what resulted is what was intended. Place PROC FSVIEW calls liberally among the steps of a program. After test analysis is complete, comment out or delete the FSVIEW portions and rerun to avoid interaction with the completed data analysis code. This step by step process can be of use to both new and old programmers alike. For experienced users, FSVIEW can be as a method of 'tutoring' new programmers in tracking the data and its changes through the DATA and PROC steps. When should FSYIEW not he used? Since it is possible to interactively change the data, a common mistake is to edit with no audit trail. If the data set is derived from an external source which contains the original errors, if and when the data set is recreated, the original errors are restored. Result: Wasted work and time. What does the future hold? Look for the new Data Form and Data Table objects for viewing and editing SAS data sets. Invoked from within a SASI AF FRAME application, the Data Form object is similar in some ways to the SASIFSP FSEDIT procedure, while the Data Table is like FSVIEW. References: Computer Based Training (CBT) SAS tutor and FSP Online Help Screens NESUG '96 Proceedings 96

PP56001 is SAS/FSP Software: Usage and Reference, Version 6, First Edition PP55147 is SAS Screen Control Language: Reference, Version 6, Second Edition PP59133 SAS Technical Repon P216, SAS/AF, SAS/FSP and SAS SCL: Changes and Enhancements, release 6.07 Observations IQ93:58 Observations IQ92:57 Scott Williams, Rapid Applications Development using the Data Form and Data Table Objects in SASIAF for Release 6.11, SAS Users Group International Proceedings. SUGI 21, March 1996 For more information contact: Marge Scerbo 410-455-6807 scerbo@umbc.edu Alan Wilson 908-235-7857 awilson@umdnj.edu 97 NESUG '96 Proceedings