PC/SAS Archive and Restore System



Similar documents
THE INTRICATE ORGANIZATION AND MANAGEMENT OF CLINICAL RESEARCH LABORATORY SAMPLES USING SAS/AF"

Master Your Domain: Automated Software Distribution In A Client/Server Environment Jeff Lessenberry, Jeff Lessenberry Consulting Group

SAS 9.4 Installation Instructions Summary

Using Version Control and Configuration Management in a SAS Data Warehouse Environment

Data Presentation. Paper Using SAS Macros to Create Automated Excel Reports Containing Tables, Charts and Graphs

The Virginia Higher Education Information System

Preparing your data for analysis using SAS. Landon Sego 24 April 2003 Department of Statistics UW-Madison

Double-Key Data EntryNerification in SASe Software Part of Downsizing a Clinical Data System to the OS/2" Operating System

Effective Use of SAS/CONNECT ~ Cheryl Garner SAS Institute Inc., Cary, NC

An Introduction to SAS/SHARE, By Example

File Transfer Protocol. What is Anonymous FTP? What is FTP?

PharmaSUG Paper AD11

Using Wharton's FDIC Research Database

Using Pharmacovigilance Reporting System to Generate Ad-hoc Reports

Using Macros to Automate SAS Processing Kari Richardson, SAS Institute, Cary, NC Eric Rossland, SAS Institute, Dallas, TX

Applications Development ABSTRACT PROGRAM DESIGN INTRODUCTION SAS FEATURES USED

A SAS Based Correspondence Management System Bernd E. Imken, Patented Medicine Prices Review Board, Ottawa, Canada

Bulk Downloader. Call Recording: Bulk Downloader

An Application of the Internet-based Automated Data Management System (IADMS) for a Multi-Site Public Health Project

Telops headquarters. Some users are remotely located in other states, therefore authorized remote access has been provided to these users.

ing Automated Notification of Errors in a Batch SAS Program Julie Kilburn, City of Hope, Duarte, CA Rebecca Ottesen, City of Hope, Duarte, CA

Analyzing the Server Log

Eliminating Tedium by Building Applications that Use SQL Generated SAS Code Segments

Determine What SAS Version and Components Are Available

SUGI 29 Applications Development

Creating PMENUs for Application Windows Holly Whittle, SAS Institute Inc., Cary, NC

Overview. NT Event Log. CHAPTER 8 Enhancements for SAS Users under Windows NT

Writing Packages: A New Way to Distribute and Use SAS/IML Programs

ABSTRACT INTRODUCTION FILE IMPORT WIZARD

emedny FTP Batch Dial-Up Number emedny SUN UNIX Server ftp

Managed File Transfer with Universal File Mover

IMF Tune v7.0 Backup, Restore, Replication

AN ANIMATED GUIDE: SENDING SAS FILE TO EXCEL

Return of the Codes: SAS, Windows, and Your s Mark Tabladillo, Ph.D., MarkTab Consulting, Atlanta, GA Associate Faculty, University of Phoenix

USING SAS WITH ORACLE PRODUCTS FOR DATABASE MANAGEMENT AND REPORTING

Sales Tax Automation System AR-1129

ABSTRACT INTRODUCTION SAS AND EXCEL CAPABILITIES SAS AND EXCEL STRUCTURES

Search and Replace in SAS Data Sets thru GUI

Effective strategies for managing SAS applications development Christopher A. Roper, Qualex Consulting Services, Inc., Apex, NC

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

KEY FEATURES OF SOURCE CONTROL UTILITIES

MARCH Conversion Software User Guide for Windows. Version 2.0

SAS Programming Tips, Tricks, and Techniques

Technical Paper. Defining an ODBC Library in SAS 9.2 Management Console Using Microsoft Windows NT Authentication

Moving Files from TSO to a PC

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

How To Write A Clinical Trial In Sas

Applications Development

How To Transfer Your Mainframe SAS (R) Dataset Into Your Lotus 123 (R) Spreadsheet or dbase III (R) Databaste; Det1ef Dewitz, idv GmbH Bonn

Query Management Facility

Improving Your Relationship with SAS Enterprise Guide

Transferring vs. Transporting Between SAS Operating Environments Mimi Lou, Medical College of Georgia, Augusta, GA

NT Event Log. CHAPTER 8 Enhancements for SAS Users under Windows NT

Managing very large EXCEL files using the XLS engine John H. Adams, Boehringer Ingelheim Pharmaceutical, Inc., Ridgefield, CT

William E Benjamin Jr, Owl Computer Consultancy, LLC

How To Use Sas With A Computer System Knowledge Management (Sas)

SAS Credit Scoring for Banking 4.3

Automation of Large SAS Processes with and Text Message Notification Seva Kumar, JPMorgan Chase, Seattle, WA

Call Recorder Quick CD Access System

Introduction to Windows XP Operating System

EXTRACTING DATA FROM PDF FILES

Producing Structured Clinical Trial Reports Using SAS: A Company Solution

A Microsoft Access Based System, Using SAS as a Background Number Cruncher David Kiasi, Applications Alternatives, Upper Marlboro, MD

A Method for Cleaning Clinical Trial Analysis Data Sets

STAT 524. Biostatistical Computing. Data Sources and Data Entry

You have got SASMAIL!

It s not the Yellow Brick Road but the SAS PC FILES SERVER will take you Down the LIBNAME PATH= to Using the 64-Bit Excel Workbooks.

Backing up your WebCT Course

Database Operations (Backup/Restore/Move/Manage) Technical Support Engineering Rosslare Security NA For more information please see

Introduction on Contact Management Software EZY Call Manager 7. Prepare By : Joseph Har Web Site :

CHAPTER 1 Overview of SAS/ACCESS Interface to Relational Databases

Archiving GroupWise items

PKZIP 6.0. Command Line for Windows Getting Started Manual

An Introduction to SASlFSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

9.1 SAS/ACCESS. Interface to SAP BW. User s Guide

General Guide to Installation and Migration for Client/Server BAMS/DSS. Release 6.0

Pharos Uniprint 8.4. Maintenance Guide. Document Version: UP84-Maintenance-1.0. Distribution Date: July 2013

STDINFO: From SAS/AF to SAS/IntrNet Reshma Kakkar and Ray L. Ransom, Centers for Disease Control and Prevention

SAS Client-Server Development: Through Thick and Thin and Version 8

HP Compaq Thin Client Imaging Tool HP Compaq Thin Client t5000 Series

PGP Desktop Quick Start Guide version 9.6

Paper # P505 Florida Community College System Putting Minds to Work

AN INTRODUCTION TO MACRO VARIABLES AND MACRO PROGRAMS Mike S. Zdeb, New York State Department of Health

Instructions for Analyzing Data from CAHPS Surveys:

BA-1000 Software Package. Version 1.00

WS_FTP Professional 12

With this document you will be able to download and install all of the components needed for a full installation of PCRASTER for windows.

REx: An Automated System for Extracting Clinical Trial Data from Oracle to SAS

Voyager Reporting System (VRS) Installation Guide. Revised 5/09/06

BACKUP MICROSOFT OUTLOOK/OUTLOOK EXPRESS

Your data is valuable! Think of how much time it will take you to manually re-enter all your data!

Using SAS With a SQL Server Database. M. Rita Thissen, Yan Chen Tang, Elizabeth Heath RTI International, RTP, NC

Air Deal Manager: American Express provides an End to End Purchasing Management Solution

Published. Technical Bulletin: Use and Configuration of Quanterix Database Backup Scripts 1. PURPOSE 2. REFERENCES 3.

SAS UNIX-Space Analyzer A handy tool for UNIX SAS Administrators Airaha Chelvakkanthan Manickam, Cognizant Technology Solutions, Teaneck, NJ

Help File. Version February, MetaDigger for PC

Windows NT Backup Software

PS004 SAS , using Data Sets and Macros: A HUGE timesaver! Donna E. Levy, Dana-Farber Cancer Institute

Understanding Files and Folders

The Advantages of Using RAID

Transcription:

USING SAS/AF", SCl and the SAS'" Macro Language to Develop an Interactive Archival System Jerry A_ Musial Program Resources, Inc., a Unit of DynCorp Atlanta, Georgia INTRODUCTION Program Resources, Inc. is a management information and lechnical selvices consulting firm specializing in providing support for the bio-medical, public health and environmental concerns of numerous federal, state, and corporate agencies. The division located in Atlanta, GA currently provides a wide range of data processing support to the Centers for Disease Control. One area of support PRI provides is to operate the CDC User Support Hotline. This requires PRI personnel to answer data processing questions from thousands of CDC scientists and researchers. The majority of the calls received are questions concerning JCL, data management and use of the SA$" system on both the mainframe and personal computers. Discussions with callers to the Hotline has revealed that many mainframe SAS users are reluctant to install PC/SAS on their personal computer because of the large amount of disk space needed to store PC/SAS. The Installation Instructions for the SAS System for Personal Computers Release 6.03 describes a Custom Install of the PC/SAS software, but this procedure is somewhat tedious. Additionally, if the custom install is performed and the user fails to install a particular product or procedure which is required, they must get the Install diskettes and install it. This can be a problem for the users at the CDC who are using 'site-licensed' PC/SAS and do not have a copy 01 the installation diskettes. These users must call the person responsible for installing SAS and schedule the installation of the additional products. In order to minimize the amount of disk space used by the SAS system, PRI has developed a system which uses PKWARE Version 1.0 Compression Programs, a public domain software product from PKWARE, Inc., to compress or archive selected files from the SAS system. The ZIP files store the SAS system files at a fraction of their originat size. These ZIP files can be copied onto diskettes which allows for even more free disk space. For most PC/SAS users, hard disk space savings of 1 to 2 megs can be easily obtained. The PC/SAS System The PC/SAS software package continues to evolve and grow. Every new release contains additional enhancements and procedures. Consequently, disk space requirements increase every time a new release is installed. The BASE' product of SAS contains over 20 procedures with an average module size of approximately 72K, while SAS/STA~ contains over 30 procedures with an average module size of over l80k. Many users require only a small percentage of the SAS procedures and data sets installed on their machine. PC/SAS Archive and Restore System Status of Product: MAPS N"",. Original Zipped Space Size Size Savings CA:-iADA 237,904 91,835 140,069 CA:-iADA2 73,774 35,056 38,718 CAXCENS 10,642 2,881 7.761 QiTYNAME 113,754 28,222 85,532 COillITY 1,180,254 372,849 807,405 US 28,108 12,799 15,309 USCITY 44,891 22,81J7 22,084 TOTAL 1.689,327 567,143 1,122,184 Figure 1. Status Screen For example, Figure 1 shows the Status Screen of the PC/SAS Archive and Restore system which displays the disk space savings resulting from the archiving of 7 map data sets. --------------------------- 1100 ---------------------------

The disk space savings from these seven maps data sets is 1.1 megabytes. The rest of this paper describes how the system works and the SAS code used to program this system. INSTALLATION Installation of the PC/SAS Archive and Restore System is a simple process. After creating a directory with the name ARCHIVE, the files associated with this system are copied into this directory. II the PC/SAS system is stored in the C:\SAS directory, installation is complete. Otherwise the user must edit the AUTOEXEC.SAS file (see Figure 2) located in the ARCHIVE directory and change the SASROOT directory to match the user's system. AUTOEXEC.SAS File The AUTOEXEC.SAS file is used to initialize macro variables and establish libref's used by the system, and contains a OM statement which issues the AF command to execute the PC/SAS Archive and Restore System. The user normally will not need to modify this file unless the PC/SAS System is not stored in the C:\SAS directory. libname sugi. c:\archive'; libname library 'c:\archive'; %let basedir=c:\sas\sasexe\base; %let statdir=c:'sas\sasexe\stat; %let mapdir =c:\sas\maps; %let graphdir=c:\sas\sasexe\graph; dm 'af c=sugi.archive.main.menu af; Figure 2. AUTOEXEC.SAS System is displayed. After the user exits lrom the system, several DOS ERASE commands are executed to remove files created by the system. @echo=off echo 'Starting PC/SAS Archive and Restore System' cd\archive SAS erase c:\archive\baszip.lst erase c:\arcbive\basunzip.lst erase c:\azchive\sl2ip.1st erase c:\azchive\srunzip.1st erase c:\archive\grzip.lst erase c:\archive\grunzip.1st erase c:\archive\mapzip.lst erase c:\archive\mapunzip.lst Figure 3. ARCHIVE.BAT The PC/SAS Archive and Restore system creates these files by 'piping' the PKZlp and PKUNZIP commands into ASCII files and are used by the system as input files and lor documentation. MAIN.MENU Once the user executes the system, the Main Menu lor the system appears on the screen (see Figure 4). This is a MENU entry in the SAS catalog ARCHIVE.SCT, and the user can currently select from two choices. PC/SAS ARCHIVE AND RESTORE SYSTEM MAIN MENU T)'pC the nwnbcr of your request on the Command line and press Enter 1. ARClIIVEIRESTORE PCISAS PRODUcrS 2 CHECK STATUS OF ARCHIVED PC/SAS PRODUCTS ARCHIVE.BAT File Figure 3 displays the ARCHIVE.BAT file, which is used to change the current directory to the ARCHIVE directory containing the PC/SAS Archive and Restore System and executes the SAS command. Since an AUTOEXEC.SAS file is located in this directory, the statements in that file are executed by the SAS system and the Main Menu lor the PC/SAS Archive and Restore Figure 4. Sec the Help Screen for a descriptioll of these items Preu: F3 to retum to DOS P=a F! r", Help MAIN.MENU Choosing item 1 will display the Archive 1101

PC/SAS Archive and Restore Svstem and Restore PC/SAS Products menu (see Figure 5). This is also a MENU entry and displays five choices of SAS products and data sets the user may archive or restore. AROIIYE AND RESTORE PC/SAS PRODUCTS Type the number of your request on the command line and press Enter 1. BASE 2. STAT 3. GRAPH 4. MAPS 5.0TIIER Press F3 to return to Ihe Mlm Menu Press FI for Help Figure 5. Archive and Restore PCISAS Products Menu Choice 2 from the Main Menu displays the Utilities Menu (Figure 9). This is a MENU entry with 3 choices which allow the user to perform data management functions on the ZIP files created by the system. The user may also display a Help screen by pressing the Fl key or return to DOS by pressing the F3 key. Archive and Restore PC/SAS Products From the Archive and Restore PC/SAS Products menu the user selects a PC/SAS Product whose procedures are to be archived or restored. When the user selects one of the items, a product specific PROGRAM entry is executed. These PROGRAM entries use a special feature, the Extended Table, only available in SAS/AF. This feature allows a set of fields to be repeated in the display panel. Since extended tables are scrollable, the system allows the user to scroll through all of the procedures for the product and choose to archive andlor restore as many procedures as desired. The only limitation is that a procedure must have been previously archived in order to be restored. SCL statements in the PUTROW section control the processing of these rows. Figure 6 shows the SCL used in the PUTROW section. putrow: rcl = fetchobs(dsidl,_currow..); exenarne = getv8ic(dsidl,varnum(dsidl, 'exename'»; if p = 'AO then do; flaga = 'Y'; 1* user modified field *1 call set(dsid2); zipped = 'A'; rei = append(dsid2); if rel > 0 then put 'Update to ZIP.SSD not successful'; ifp = 'R' then do; if status = 'N' then do; _msil= 'You have asked to Restore a file which is not Archived.'; p=' '; return; call set(dsid2); zipped = 'R'; flagr = 'Y'; rei = append(dsid2); if rei> 0 then put 'Update to ZIP.SSD not successful'; return; Figure 6. PUTROW The PC/SAS Archive and Restore system uses the extended table to display four fields (see Figure 7). The first field, located to the left of each procedure name, is an action field. In this field, the user types an 'A' to archive or an 'R' to restore the listed procedure. The other three fields displayed list the SAS procedures available within the previously chosen SAS product, the size of the associated.exe file and the status of that file. The status field will either display an 'N' (normal) or 'A' (archived). These fields were protected by placing an X in the Protect field of the associated field attribute panel. Also, the third field, filesize, is displayed using the comma9. format, which was specified in the format field on the field attribute panel for the screen variable. ----------------------------1102----------------------------

PCJSAS STAT PRODUcr ARCIUVE!RE~rfORE Type A (Atl.:hiv\,l) or R (Restore) next to Pf(OC Press F3 to cx:x:utc r..::qucsl$ or F1 for H..::lp Procedure C=t AIR N:l.lu,:: FiI.:size Sl~lus Figure 7. Extended Table ACECLUS 145.952 N CAUS 901.664 N CANCORR!4~.224 N CANDfSC 172.784 N CATMOD li:i3.g64 N CLUSTER 17G;Lu3 N CORR 206,-'100 N CORREGR 144.8~6 N DISCRIM 320.576 N FACTOR ISJjGI:i N FASTCLUS gc,448 N GL\I 43':;,256 N LlFEREG 179.7~2 N Once all desired requests have been made, the user presses the F3 key and the TERM section is executed. The TERM section (see Figure 8) contains a SUBMIT block which processes several SAS datasets and creates ASCII files containing lists of procedures to archive or restore. Then depending on whether the user wants to archive andlor restore procedures, PKZIP and PKUNZIP commands are executed via the 'X' command. The user is then returned to the Archive and Restore PC/SAS Products menu. The user can choose to archive additional products, check the status of the ZI P files, or exit the system. Once the user has archived a procedure or dataset it is no longer available for use by the SAS system. If the user attempts to call for an archived procedure, he will receive an error message in the SAS log. For example, if the user had archived PROC CHART, a PROC CHART statement in a SAS program will produce the following error message: ERROR: PROCEDURE CHART not found. The user must restore the CHART procedure to usei!. term: cau close(dsidj); cau close( dsid2); if flaga. = 'Y' or flagr = 'Y' men do; submit inunediate; fllename zip 'c:\archive\baszip.ls['; filename tmzip 'c:\archivelilastmzip.1st'; proc son data=sugi.zip; by exename; run' proc son data=sugi.base out=base(drop=zipped); byexename; data base; basedir=symget('basedir'); merge sugi.zip (in = a) base; byexename; if a; if zipped = 'A' then do; file zip; put@j basedir '\' +(.1) exename; else if zipped = 'R' then do; file unzip; put exename ; run' data sugi.base; merge sugi.base(in=a) sugi.zip(in=b); byexename; if a & b then do; if zipped = 'R' then zipped = 'N'; /* set zip.ssd back to 0 obs */ dara sugi.zip; set sugi.zip; where(zipped = ); x 'PKZIP M sasbase@baszip.1st>pkbase.log'; X 'PKUNZIP -N sasbase c:\sas\sasexe\hase @basunzip.lst > upkbase.log ; endsubmit; 1* end flag *1 return: Figure 8. TERM secoon of BASE.PROGRAM UTILITIES Menu From the Utilities Menu (Figure 9) the user can perform data management functions on the ZIP files used by the system. Choice 1 calis a PROGRAM entry which updates the status of the ZIP file. -----------------------------1103---------------------------

PCISAS ARCHIVE AND RESTORE SYSTEM UTlLmES MENU Type the number of your r;.!~luest on me conunand line and press Enter 1. UPDATE STATUS 2. DISPLAY STATUS 3. DELETE HLES Press F3 [0 rerum [0 the Main Menu Press Fl for Help Figure 9. Utilities Menu Choice 2 from the Utility Menu calls a PROGRAM entry which displays the PC/SAS products and datasets whose status can be checked (similar to Figure 5). When the user makes his selection, a PROGRAM entry is called which uses an extended table to display (see Figure 1) the names of the PROe's or data sets archived, their original file size, their zip file size and the amount of disk space saved. The total savings are also given. Choice 3 allows the user to delete files from the ZIP files. This feature is included because the PKUNZIP command does not delete tiles from the ZI P file. This allows a user who restores a PROC or dataset and wants to leave it unarchived permanently to remove it from the ZIP file. The RESTORE Macro In order to allow a user of the PC/SAS Archive and Restore system to restore an archived procedure or dataset from within a PC/SAS program, the RESTORE macro was created. The simplest way to use the macro is to bring the macro cede into the program via a %INCLUDE statement. For example if the user has previously archived PROC CALIS, but now needs to use it, he could include the following code in his program and PROC CALIS would be unarchived and stored in the STAT directory: %INCLU DE 'C:\archivelrestore.sas'; %RESTORE(STAT,CAL1S) The SAS code for the RESTORE macro is listed in Figure 10. %MACRO RESTORE(produc~PROC); libname archive 'c:\archive'; libname library 'c:\archive'; filename restore 'C:\archive\pcrstr.bat'; options mprint; DATA _NULL_; me restore old; put '@ECHO=OFF'; exename = put("&proc",sexef12.); if exename = 'BAD' then put 'echo. 'Invalid Procedme in Restore Macro Call"'; else do; if upcase(" &praduct") in CBASE','STAT,'ORAPH','AF', 'FSP','IML','OR','QC') then do; zip = "SAS&product"; dir = "SAS\sASEXB&praduct"; link pkunzip; end else il- upcase("&product"j= 'MAPS' then do; zip = "SAS &product"; dir = "SAS\&praduct"; link pkunzip; else put 'echo "Invalid Product in Restore Macro Call" '; return; pkunzip: put "PKUNZ1P -N " zip dir exename '>pcrstr.lag'; rerum; X 'pcrstt'; %MEND RESTORE; Figure 10. RESTORE Macro LIMITATIONS There are several limitations with this system. The first is with version 6.04 of SAS. In several PROGRAMS used by the system, SUBMIT BLOCKS are used to SUBMIT to the SAS system DATA steps which are run to create ASCII files containing values needed to issue PKZIP and UNPKZ1P commands. The ability to read and write to ASCII fues via SCL would make the system much more efficient and flexible. 1104

Fortunately, this enhancement is available in 6.06 of SAS and hopefully will be included in the next release of PC/SAS. Personal Computers, Release 6.03. Secondly, the.exe files used by the PC/SAS system are often very large files, many well over 200K. Repeated use of the system to archive and restore the PC/SAS system files would eventually cause severe file fragmentation. To avoid this, it is recommended that the only procedures which should be archived are those which the user has a high degree of certainty he will not use. Then after running the system and archiving all the procedures, Ir,e user should run a disk optimizer utility. CONCLUSION The use of this system will allow PC/SAS users to fully customize the SAS software on their personnel computer and more efficiently use its disk space. This system will also give access to users with limited disk space the opportunity to install and use PC/SAS. A planned enhancement to the system will allow the user to archive and restore any file stored on his PC. Additionally, the development of this system was an effort to discover the capabilities of SAS/ AF software. As is the case with most SAS products, it is very flexi:jle and allows for several different programming techniques available to pertorm the same function. For example, PROGRAM entry's could be substituted for MENU entry's. Also, the PROGRAM entry's use the X command to issue PKZIP and PKUNZIP commands directly, while the RESTORE macro uses the X command to execute a.bat file. ACKNOWLEDGEMENTS SAS. SAS/AF. SAS/STAT. SASIGRAPH. SAS/FSP. SASIIML. SAS/OR. SASlQC are registered trademarks of SAS I nstitute Inc. PKZIP and PKUNZIP are registered trademarks of PKWARE. Inc. REFERENCES Installation Instructions for the SAS System for -------------1105----------------------------