Using SAS/FSP Software for Ad hoc Reporting By Marc Schlessel SPS Software Services Inc.



Similar documents
Table of Contents. Changing Your Password in Windows NT p. 1. Changing Your Password in Alpha Connection.. pp. 1-3

Programming Tricks For Reducing Storage And Work Space Curtis A. Smith, Defense Contract Audit Agency, La Mirada, CA.

Welcome to Business Internet Banking

Styles, Tables of Contents, and Tables of Authorities in Microsoft Word 2010

Using Casio Graphics Calculators

How to Borrow Adobe EPUB Ebooks From Your iphone and ipod Touch

Sensi TM. Wi-Fi Programmable Thermostat SCHEDULING GUIDE. Version: March Emerson Electric Co. All rights reserved.

How to make internal links in a Word document

Monthly Payroll to Finance Reconciliation Report: Access and Instructions

Intro to Mail Merge. Contents: David Diskin for the University of the Pacific Center for Professional and Continuing Education. Word Mail Merge Wizard

DOING MORE WITH WORD: MICROSOFT OFFICE 2010

NJCU WEBSITE TRAINING MANUAL

A Guide to Getting Started with the AmeriCorps VISTA Applicant Tracking Tool

MEETINGONE ONLINE ACCOUNT MANAGEMENT PORTAL ACCOUNT ADMIN USER GUIDE

Beginning PowerPoint: Hands-On Exercise (Windows XP) Regent University

Using SAS to Control and Automate a Multi SAS Program Process. Patrick Halpin November 2008

Importing Excel File using Microsoft Access in SAS Ajay Gupta, PPD Inc, Morrisville, NC

Content Author's Reference and Cookbook

Windows XP Pro: Basics 1

City of De Pere. Halogen How To Guide

Sample- for evaluation purposes only. Advanced Crystal Reports. TeachUcomp, Inc.

Using Mail Merge in Microsoft Word 2003

Client Marketing: Sets

Getting Started with WebSite Tonight

paragraph(s). The bottom mark is for all following lines in that paragraph. The rectangle below the marks moves both marks at the same time.

Job Streaming User Guide

Pulling a Random Sample from a MAXQDA Dataset

Automated Inventory System

Making a Web Page with Microsoft Publisher 2003

How to Concatenate Cells in Microsoft Access

Alteryx Predictive Analytics for Oracle R

Microsoft Access 2000

What Do You Think? for Instructors

MICROSOFT ACCESS 2003 TUTORIAL

D2L: An introduction to CONTENT University of Wisconsin-Parkside

Basic Formulas in Excel. Why use cell names in formulas instead of actual numbers?

Rochester Institute of Technology. Oracle Training: Preparing Journal Entries in the Oracle Applications

Advanced BIAR Participant Guide

PT AVENUE GUIDE OVERVIEW

Paper FF-014. Tips for Moving to SAS Enterprise Guide on Unix Patricia Hettinger, Consultant, Oak Brook, IL

Creating tables of contents and figures in Word 2013

Using Outlook Outlook Screen

Creating and Using Forms in SharePoint

Producing Structured Clinical Trial Reports Using SAS: A Company Solution

How to Schedule Ketarin Update with Windows Task Scheduler

Database Program Instructions

Introduction to the UNIX Operating System and Open Windows Desktop Environment

Tutorial: Creating a CLX Database Application

2Creating Reports: Basic Techniques. Chapter

Introduction to the new mainframe Chapter 4: Interactive facilities of z/os: TSO/E, ISPF, and UNIX

Dragon Medical Practice Edition v2 Best Practices

Quick Guide. Passports in Microsoft PowerPoint. Getting Started with PowerPoint. Locating the PowerPoint Folder (PC) Locating PowerPoint (Mac)

9.1 SAS. SQL Query Window. User s Guide

Google Apps for Sharing Folders and Collecting Assignments

Online account access

Outlook Web App (formerly known as Outlook Web Access)

Excel basics. Before you begin. What you'll learn. Requirements. Estimated time to complete:

Enhanced Formatting and Document Management. Word Unit 3 Module 3. Diocese of St. Petersburg Office of Training Training@dosp.

Getting Started on the Computer With Mouseaerobics! Windows XP

Windows 95. 2a. Place the pointer on Programs. Move the pointer horizontally to the right into the next window.

How to test and debug an ASP.NET application

TIPS FOR DOING STATISTICS IN EXCEL

Google Sites. How to create a site using Google Sites

Mail Merge Microsoft Word and Excel Queries Scott Kern Senior Consultant

Appointments Module. User s Manual

EXST SAS Lab Lab #4: Data input and dataset modifications

Activity 6 Graphing Linear Equations

PharmaSUG Paper QT26

Version 8. Backing Up and Restoring Progeny Databases

COMMUNICATIONS... 1 COMMUNICATIONS...

Packaging Software: Making Software Install Silently

Linear functions Increasing Linear Functions. Decreasing Linear Functions

Microsoft Excel v5.0 Database Functions

Scheduling Programming Activities and Johnson's Algorithm

Ohio Educational Computer Network System (OECN) UDMS Beginning Training Guide

Special and Fundraising Events Masters Class. Part 2: Managing your Event and Sending Invitations

Microsoft PowerPoint 2010 Handout

SMALL BUSINESS ACCOUNTING. User Guide

Using Mail Merge to Create Form Letters and Labels

Version 4.1 USER S MANUAL Technical Support (800)

Using Excel as a Management Reporting Tool with your Minotaur Data. Exercise 1 Customer Item Profitability Reporting Tool for Management

Employee Manual Development Tool Version 7.0. User Guide

While You Were Sleeping - Scheduling SAS Jobs to Run Automatically Faron Kincheloe, Baylor University, Waco, TX

Basic Use of the TI-84 Plus

Microsoft Access Basics

Manual English KOI Desktop App 2.0.x

Employee Appointment Books. User s Manual

USER GUIDE VMware, Inc. Web: socialcast.com

S7 for Windows S7-300/400

Openbooks - Setting up bank feeds

Microsoft Office Word 2013

2. Type the username and password supplied by your Site Administrator and select Log In.

DARS/u.achieve Business Process Guide (BPG) for Transfer Graduation Counselors

Introduction to Microsoft Excel 2010

Formatting Your Thesis

Transcription:

Using SAS/FSP Software for Ad hoc Reporting By Marc Schlessel SPS Software Services Inc. Abstract This paper is geared towards mainframe SAS programmers who are looking for an easy solution of creating ad hoc reports from user input without the interaction from a SAS programmer. The SAS/FSP product is a great tool to use for these types of projects. A user could input some selection criteria into a screen, and receive a report based on the criteria entered. This can be done interactively or in batch mode. This paper will address creating these reports in batch mode, but the same code and concept can be applied interactively. Introduction I run into users all the time that request reports they would like to submit themselves, whenever they want, with a different set of selection criteria. By using SAS/FSP software, this can be accomplished with little effort. If your user doesn t ask for this type of request, it s always a good idea to keep this idea in the back of your mind, especially if your user is constantly calling you asking you to run a particular report using different selection criteria. You may want to take a little extra time and develop a system where you would turn it over to the user and eliminate phone calls. Another plus to using SAS/FSP to accomplish this task is that with clists you can create it so the user never sees the SAS code. It s always a good idea not to let the user see any code. This will eliminate possible problems in the future. Another option to accomplish the task of users running their own reports and changing the selection criteria within the report is to use %let s at the top of the code. This however is not as user friendly as using SAS/FSP software, plus the user would have access to the SAS code, which potentially can cause problems down the road. This paper does not address the %let option. Information needed from the User Before starting, information from the user would need to be gathered. The two main sets of information needed are: 1. What different selection criteria would the user be asking for? 2. What should the report(s) look like? Sort Order What variables should be shown on the report Titles Footnotes Etc After gathering this information, you should be ready to begin building your system.

Setting up the SAS/FSP Screen When in interactive SAS, first you ll need to allocate the dataset(s) where the inputted data and the screen that you will be creating will reside. After allocating the dataset(s) where you want the data stored, you will need to issue an fsedit command to start creating your SAS/FSP screen. Note: The SAS dataset must be created prior to editing the file. This includes setting up the variables to be used for input by the user. This is shown in the data step below. The commands could look something like this: Libname tst mhs.sas.dataset disp=old; Data tst.file1; Length Lastname $25. City $25. statecod $2. Zip $5. Operand1-operand4 $2.; Proc fsedit data=tst.file1 screen=tst.testscrn; Run; The above code will allocate the dataset where the data inputted by the user will reside and where the screen attributes and formats will be stored. The disp is set to old since we will be writing to the dataset. The data step above creates the variables used for the selection criteria. This example uses the length statement. The Proc Fsedit statement above needs to include the screen= option to identify the screen being created by the programmer (this will be discussed later within this paper).

The following in figure 1 is what will appear after submitting the above statements. Figure 1 Next, type in mod on the command line to modify the screen (Figure 2). Choose option 2 (Screen Modification and Field Identification). After choosing option 2 the screen will look the same as in Figure 1 except it will say modify in the upper left corner. At this point you may modify the screen any way you want. The following bullets are a couple of helpful tools when using the modify screen: Typing nums on the command line will insert line numbers. nums off on the command line will get rid of the line numbers. Use the underscore ( _ ) to identify all data fields. There must be a space between the data field and any other character. When done modifying the screen, back out by hitting PF3 (End). At this time you will need to identify all the fields to the system by placing the cursor anywhere on the data field (_) that the system prompts you for. Next, choose selection 4 (Assign Special Attributes to Fields) in the mod menu (Figure 2). Here you will assign attributes to any or all of the fields you ve defined. An example of a worthwhile attribute would be to change the max value of the operand fields to ZZ and the min value to AA. This will not allow a user to enter a equal sign (=) to the operand field. Hit PF3 (End) to get back to the mod menu (Figure 2). Now choose selection 5 (Modification of General Parameters).

Change the Allow DELETE command and the Allow ADD/DUP command values to N (see figure 3). This will not allow the user to add, delete, or modify any observations in the SAS dataset. PF3 (End) twice will get you back to the finished modified screen. Figure 4 is an example of what a modified screen might look like. Figure 2

Figure 3 Figure 4

The Code Since the data from the SAS/FSP screen is already in a SAS file, the code to make this work is quite simple. It would look something like the following: The following is the test data used for this paper: CITYNAM LNAME STATE ZIPCODE CLEVELAND SMITH OH 44115 CLEVELAND ANDERSON OH 44115 CLEVELAND JACKSON OH 44115 COLUMBUS JACKSON OH 44123 COLUMBUS MARKS OH 44123 NASHVILLE ADAMS TN 58941 NASHVILLE GRAY TN 58941 NASHVILLE STEVENS TN 58941 This test data is stored in a SAS dataset called testdata Data select; Set tst.testdata; If _n_ = 1 then do; Set tst.file1; Retain Lastname City statecod Zip Operand1-operand4; Array flds lastname city zip statecod ; Array infl lname citynam zipcode state zipcode; Array op operand1-operand4; Do over flds; If flds ne then do; If op = EQ then do; If flds = infl; Else do; If flds ne infl; Run; The above data statement is all that would be needed to create a SAS file (in the above code it would be called select ) of the data selected via the selection criteria from the SAS/FSP screen. Setting up Access for the User

There are many ways of setting up this type of system for a user to submit. One of the easiest ways and secure ways is to create clists. The following is an example of what a clist might look like to accomplish this task: PROC 0 ATTN GOTO EX1 CONTROL NOMSG NOFLUSH PROMPT SAS AUTOEXEC( TMVS717.AGENT.CNTL(EXTABLE) ) + OPTIONS( NOSOURCE NONOTES ) EX1: EXIT The code would then reside in TMVS717.AGENT.CNTL(EXTABLE). That code would look something like the following: LIBNAME TST MHS.SAS.DATASET DISP=OLD; PROC FSEDIT DATA=TST.FILE1 SCREEN=TST.SCRNTEST; RUN; INSERT SAS CODE HERE IF NEEDED ENDSAS; The SAS code above will take the user directly into the SAS/FSP screen. The code that follows the FSEDIT statement (if you inserted any code where it says insert sas code here if needed ) will run as soon as the user exits the screen. A proc print could be placed in here to bring a report directly back to the screen. Conclusion Lots of main frame SAS programmers deal with this dilemma every day. Users like the control of running their own reports, whenever they want, and be able to change the selection criteria to meet their ever-changing needs. This paper addresses one way of many ways to accomplishing this dilemma. The SAS/FSP product is a very easy product to use. It s a good tool to use for Ad Hoc user generated reports. A system like this is a very easy way to WOW your users.