Coders' Corner. Paper Scrolling & Downloading Web Results. Ming C. Lee, Trilogy Consulting, Denver, CO. Abstract.

Similar documents
Scrolling & Downloading Web Results

Internet, Intranets, and The Web

A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY

Creating Macro Calls using Proc Freq

Web-Application Bar Charts without SAS/GRAPH. Steve James, Centers for Disease Control and Prevention, Atlanta, GA

Developing Data-Driven SAS Programs Using Proc Contents

ABSTRACT INTRODUCTION TRICK 1: CHOOSE THE BEST METHOD TO CREATE MACRO VARIABLES

A Generic Solution to Running the SAS System on the Web Without SAS/Intrnet David L. Ward, InterNext, Inc., Somerset, NJ

Different Methods for Accessing Non-SAS Data to Build and Incrementally Update That Data Warehouse

A Dynamic Imagemap Generator Carol Martell, Highway Safety Research Center, Chapel Hill, NC

Amie Bissonett, inventiv Health Clinical, Minneapolis, MN

SAS System Powers Web Measurement Solution at U S WEST

PharmaSUG Paper TT11

Utilizing SAS for Cross- Report Verification in a Clinical Trials Setting

Use SAS/AF, SCL and MACRO to Build User-friendly Applications on UNIX

Create a Format from a SAS Data Set Ruth Marisol Rivera, i3 Statprobe, Mexico City, Mexico

PhUSE US Connect 2018 Paper CT06 A Macro Tool to Find and/or Split Variable Text String Greater Than 200 Characters for Regulatory Submission Datasets

Using Different Methods for Accessing Non-SAS Data to Build and Incrementally Update That Data Warehouse

Rocky Mountain Web: Telecom Network Interconnection Quality Measurements

Arthur L. Carpenter California Occidental Consultants, Oceanside, California

Using SAS software to shrink the data in your applications

Three Ways to Utilize the SAS/IntrNet Application Dispatcher

Greenspace: A Macro to Improve a SAS Data Set Footprint

SAS Macro Dynamics: from Simple Basics to Powerful Invocations Rick Andrews, Office of Research, Development, and Information, Baltimore, MD

Internet/Intranet, the Web & SAS

Best Practice for Creation and Maintenance of a SAS Infrastructure

Validation Summary using SYSINFO

PharmaSUG 2013 CC26 Automating the Labeling of X- Axis Sanjiv Ramalingam, Vertex Pharmaceuticals, Inc., Cambridge, MA

A Format to Make the _TYPE_ Field of PROC MEANS Easier to Interpret Matt Pettis, Thomson West, Eagan, MN

SAS Drug Development Program Portability

How to Keep Multiple Formats in One Variable after Transpose Mindy Wang

Tablet Android Update Instructions from to 4.2.2

LST in Comparison Sanket Kale, Parexel International Inc., Durham, NC Sajin Johnny, Parexel International Inc., Durham, NC

SAS Data Integration Studio Take Control with Conditional & Looping Transformations

So Much Data, So Little Time: Splitting Datasets For More Efficient Run Times and Meeting FDA Submission Guidelines

C-Assist Set up Guide

Procurer User Manual

Line Spacing and Double Spacing...24 Finding and Replacing Text...24 Inserting or Linking Graphics...25 Wrapping Text Around Graphics...

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

IT 341 Introduction to System Administration Project I Installing Ubuntu Server on an Virtual Machine

BTA Billing Online Support Statement File Reference Guide

Introduction. Getting Started with the Macro Facility CHAPTER 1

Layout and display. STILOG IST, all rights reserved

Lazy Programmers Write Self-Modifying Code OR Dealing with XML File Ordinals

WHAT ARE SASHELP VIEWS?

A Generalized Macro-Based Data Reporting System to Produce Both HTML and Text Files

PharmaSUG Paper PO12

This paper describes a report layout for reporting adverse events by study consumption pattern and explains its programming aspects.

A Macro To Generate a Study Report Hany Aboutaleb, Biogen Idec, Cambridge, MA

Text Generational Data Sets (Text GDS)

The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data

Write SAS Code to Generate Another SAS Program A Dynamic Way to Get Your Data into SAS

Implementing external file processing with no record delimiter via a metadata-driven approach

A Useful Macro for Converting SAS Data sets into SAS Transport Files in Electronic Submissions

Knit Perl and SAS Software for DIY Web Applications

An Easy Route to a Missing Data Report with ODS+PROC FREQ+A Data Step Mike Zdeb, FSL, University at Albany School of Public Health, Rensselaer, NY

FSEDIT Procedure Windows

Understanding the Concepts and Features of Macro Programming 1

Changes and Enhancements

Technical Guide Login Page Customization

Using Java to Front SAS Software: A Detailed Design for Internet Information Delivery

Table of Contents COPYRIGHTED MATERIAL. Introduction Book I: Excel Basics Chapter 1: The Excel 2013 User Experience...

for Western Users of SAS Software 2014

Macros from Beginning to Mend A Simple and Practical Approach to the SAS Macro Facility

IT 341 Introduction to System Administration Project I Installing Ubuntu Server on an Virtual Machine

A Macro that can Search and Replace String in your SAS Programs

Efficient Processing of Long Lists of Variable Names

Submitting SAS Code On The Side

Useful Tips When Deploying SAS Code in a Production Environment

Contents. Tutorials Section 1. About SAS Enterprise Guide ix About This Book xi Acknowledgments xiii

Internet/Intranet, the Web & SAS

Overview 14 Table Definitions and Style Definitions 16 Output Objects and Output Destinations 18 ODS References and Resources 20

Basics of Using SAS with the World Wide Web

COMS 359: Interactive Media

Extending the Scope of Custom Transformations

Paper HOW-06. Tricia Aanderud, And Data Inc, Raleigh, NC

Program Validation: Logging the Log

SAS/IntrNet 9.2. Overview. SAS Documentation

PDF Multi-Level Bookmarks via SAS

Using a Fillable PDF together with SAS for Questionnaire Data Donald Evans, US Department of the Treasury

Reading in Data Directly from Microsoft Word Questionnaire Forms

Your Own SAS Macros Are as Powerful as You Are Ingenious

Tales from the Help Desk 6: Solutions to Common SAS Tasks

SAS Macro Technique for Embedding and Using Metadata in Web Pages. DataCeutics, Inc., Pottstown, PA

HTML for the SAS Programmer

EVALUATION ONLY. Table of Contents. iv Labyrinth Learning

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

An Introduction to SAS/SHARE, By Example

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

To conceptualize the process, the table below shows the highly correlated covariates in descending order of their R statistic.

A Practical Introduction to SAS Data Integration Studio

Customized Flowcharts Using SAS Annotation Abhinav Srivastva, PaxVax Inc., Redwood City, CA

Paper A Simplified and Efficient Way to Map Variable Attributes of a Clinical Data Warehouse

Set & Forget Marketing

SAS Universal Viewer 1.3

10 The First Steps 4 Chapter 2

IT 341 Introduction to System Administration Project I Installing Ubuntu Server on a Virtual Machine

An Easier and Faster Way to Untranspose a Wide File

Xerox WorkCentre 6655 Software Installation Instructions

SeUGI 19 - Florence WEB Enabling SAS output. Author : Darryl Lawrence

Transcription:

Paper 71-25 Scrolling & Downloading Web Results Ming C. Lee, Trilogy Consulting, Denver, CO Abstract Since the inception of the INTERNET and Web Browsers, the need for speedy information to make split second business decisions has become part of our daily lives. However, information retrieved from the Web can be overwhelming at times due to the immense size of the data, which is only the beginning of the problem. Web Browsers allow users to access information with ease; however, the number of records a user is able to browse at one time is limited to the amount of memory and processor on their computer. One of the many ways to circumvent the problem is to upgrade their computer with a faster processor and more memory, which is expensive. Therefore, it would be easier to control the number of records the user can view at any one time, and provide an option to allow them to download all of the data if required. This will eliminate the possibility of a frozen keyboard and the need to reboot the computer and would also eliminate any frustrations. Introduction There are a couple of ways to control the number of records being viewed by the user. One of them is to provide some search criteria to the users, prompting them to for information. These so call inputted information / parameters are then passed to the program for processing, eliminating unnecessary information. This would be ideal if most of the databases were small in size 20,000 records or less, but in the real world databases are rarely that size. Most of them contain hundreds of thousands and even millions or billions of records. To display all records retrieved at one time can prove to be a challenge even to current high-end computers available in the market today. It is almost impossible to display a million records of retrieved data on a Web Browser without the computer keyboard freezing up and aborting the process altogether. Therefore, the only viable solution is by means of using a scrolling program, and also providing the user the option to download a delimited version of the file to their own desktop when the user is tired of scrolling. Base/SAS, SAS/MACRO, SAS/IntrNet and HTML provide ease of coding for both the scrolling and downloading processes within a SAS program. To successfully invoke the Scrolling / Downloading program, the HTML or htmsql page needs to pass in an initializing variable along with other required information or variables. In this case, a MACRO variable contains an initial value, which instructs the program on how to begin. For instance a MACRO variable containing the value YES for first time use will cause the program to initialize all of the necessary variables. With each page displayed, the user will be given several button options to click on including returning to the menu, downloading a delimited file, and scrolling forward and backwards. All of these options (one at a time) can be selected by a click of the button. Each time the scrolling program is being executed a set of pre-calculated scroll values for forward and backward scrolling is passed back to the scrolling program. In the case of downloading a delimited file, a list of parameters is passed to the download program, where it can extract the required information for downloading. The scrolling and downloading program has been proven to be a very effective tool to circumvent the problem of computer memory shortage, speed of the INTERNET lines, and processor speed. By using the scrolling technique, it also optimizes the use of the INTERNET and prevents monopolizing the INTERNET lines by a single user. This Scrolling and Downloading set of code can be used time and time again, making it recyclable. Technical Aspects of the Scrolling & Downloading Program The main core of the scrolling program involves the handling the initial group of record display, the second group of records displayed with the consideration of scrolling back to the initial set of records and the last group of records being displayed. The definition of handling determines the option buttons being displayed to the user. If an initial group of records is displayed, only a Forward or Next button will be shown. Similarly, when the scrolling program reaches the end of the group of records, only a Backward or Previous button will be shown. If the second group of records is displayed, and the user selects Backward or Previous button, the program should be able to display the initial group of records with only the Forward or Next button. Finally, the scrolling program should also be able to handle the case where the number of

records received is less than or equal to the scrolling pre-set amount, displaying either no Forward or Backward option scrolling, or just Backward scrolling only. The downloading program is part of the scrolling program linked by means of a button to invoke the downloading program with the necessary parameters passed to it. The criteria are similar to that of the scrolling program except without the pre-calculated Forward and Backward scrolling ranges. The downloading program uses PROC CONTENTS to build the delimited file. The information that is kept from the successful execution of PROC CONTENTS follows: i. Name ii. Type iii. Length iv. Label v. Format vi. Formatl vii. Formatd viii. Informat ix. Informl x. Informd xi. Varnum xii. Nobs Using the different FORMATS and INFORMATS variables, a download template is built. With the NAME variable, the header is built. A pre-selected delimiter is used, in this case a is used, otherwise known as the PIPE. The is selected to be used as a delimiter mainly because of its rarity of being used in inputting data. Upon invoking the download program, the selected data will be downloaded to the user s desktop using the template built, where the user can browse or manipulate the data at their own leisure. The scrolling and downloading program works hand in hand presenting similar data to the user in different formats, thus giving the user the option to see and verify the information selected before retrieving a copy for use. Program Listing & Description The program listed below has a pre-set value of 50, that means that only 50 records will be displayed at a time. However, that value can be changed to accommodate the developers choice or it can be changed to pass in a SAS/MACRO variable that contains the user s preference, which mean minor changes need to be made to the program. SAS statements that are highlighted below are essential to the successful execution of the scrolling program. * Program name : test_report.sas *; * Function : This MACRO call itself *; * over and over again, it pass the *; * scroll values back to itself each *; * time either a Next or Previous *; * button is selected. Each time when *; * the values are passed back to the *; * program the values for Next and *; * Previous will be calculated each *; * time. It also provides data viewed *; * to be downloaded. *; libname test /data/test ; %macro viewrec; %global start stop pstart pstop ftime userid password status loc; * Selecting only required records. *; data temp; set test.jobs; where (compress(upcase(status)) eq upcase( &status )); * Peform Proc Contents to obtain the *; * total number of records selected *; * from above. And created a MACRO *; * variable to hold the count of the *; * records selected. *; proc contents data=temp out=xxx(keep=nobs); noprint; data _null_; set xxx end=eof; if eof then do; call symput( lastrec,nobs); call symput( lstrec,put(nobs,comma10.)); * Create Start and Stop ranges for *; * both forward and backward scrolling *; * Variable start and stop are *; * designated for forward scrolling *; * Variable pstart and pstop are *; * designated for backward scrolling *; * The FTIME variable here refers to *; * First Time usage. *; data tempset; set temp end=eof;

format begin 3.; format ending 3.; format start 3.; format stop 3.; format pstart 3.; format pstop 3.; informat begin 3.; informat ending 3.; informat start 3.; informat stop 3.; informat pstart 3.; informat pstop 3.; %if &ftime = YES %then %do; start = 51; stop = 100; pstart = 1; pstop = 50; call symput( pstart,pstart); call symput( pstop,pstop); call symput( start,start); call symput( stop,stop); if _N_ LT &lastrec then do; if (_N_ < 51) then output tempset; % %else %do; start = &start; stop = &stop; pstart = (start 50); pstop = (stop - 50); begin = (start + 50); ending = (stop + 50); if _N_ LT &lastrec then do; if (start <= _N_ <= stop) then output tempset; call symput( pstart,pstart); call symput( pstop,pstop); call symput( start,start); call symput( stop,stop); % if "&ftime" NE "YES" then do; if stop GT &lastrec then do; if eof then output tempset; if start GT &lastrec then do; if eof then output tempset; data _null_; set tempset end=eof; file _webout; if _N_ = 1 then do; put Content-type: text/html ; put ; put <HTML> ; put <HEAD> ; put </HEAD> ; put <BODY BGCOLOR= #f5f5cd > ; link header;! More SAS / HTML codes " if eof then do; link footer; put </BODY> ; put </HTML> ; header: put <CENTER> ; put <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0> ; put <TR> ; put <FORM ACTION= /cgibin/htmsql/testlib/test_report_main.hsql NAME=USERID NAME=PASSWORD VALUE= &password > ; Go Back To Report Menu ALIGN=LEFT> ; put <FORM ACTION= /cgi-bin/broker NAME=USERID NAME=PASSWORD VALUE= &password > ; NAME= _debug VALUE= 0 > ; NAME= _service VALUE= newsas > ; NAME= _program VALUE= testp.test_download.sas > ; put <INPUT TYPE=SUBMIT VALUE= Download A Delimited File ALIGN=LEFT> ; put </TR> ; put </TABLE> ; put </CENTER> ; footer: if &ftime = YES then do; put <FORM ACTION= /cgi-bin/broker NAME=STATUS VALUE= &status > ; NAME=LOC NAME=USERID NAME=_debug VALUE= 0 > ; NAME=FTIME VALUE= NO > ;

NAME=PSTART VALUE=&pstart> ; NAME=PSTOP VALUE=&pstop> ; NAME=START VALUE=&start> ; NAME=STOP VALUE=&stop> ; Next ALIGN=LEFT> ; COLOR=BLUE><B>50 Records</B></FONT> ; if &start GE &lastrec then do; NAME=LOC NAME=USERID NAME=PSTART VALUE=&start> ; NAME=PSTOP VALUE=&stop> ; NAME=START VALUE=&pstart> ; NAME=STOP VALUE=&pstop> ; Previous ALIGN=LEFT> ; put <BR> ; put <CENTER> ; put <TABLE BORDER=0 CELLSPACING=2 CELLPADDING=0> ; put <TR> ; NAME=LOC NAME=USERID if &pstart = 1 then do; NAME=FTIME VALUE= YES > ; NAME=START VALUE=&pstart> ; NAME=STOP VALUE=&pstop> ; Previous ALIGN=LEFT> ; NAME=LOC NAME=USERID NAME=START VALUE=&start> ; NAME=STOP VALUE=&stop> ; Next ALIGN=LEFT> ; put </TR> ; put </TABLE> ; put </CENTER> ; %mend viewrec; %viewrec; quit; Conclusion

The scrolling and downloading program allows user to conserve precious memory resource on their desktop when interfacing with a web application. AUTHOR CONTACTS Ming C. Lee Trilogy Consulting 700 W. Mineral, Room MN E21.20 Littleton, CO 80120 (303) 707-8452 mxlee5@uswest.com SAS and SAS/htmSQL are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. Other brand and product names are registered trademarks or trademarks of their respective companies.