Swap the DATA Step for PROC TRANSPOSE Katie Joseph, U.S. Office of Personnel Management, Washington, DC
|
|
- Walter Harrington
- 7 years ago
- Views:
Transcription
1 Swap the DATA Step for PROC TRANSPOSE Katie Joseph, U.S. Office of Personnel Management, Washington, DC ABSTRACT Anyone who has spent an unspeakable amount of time using arrays and do loops in a DATA step to convert observations to variables or vice versa has certainly thought, Isn't there an easier way to do this? The answer is YES! SAS offers a convenient way of circumventing these lengthy DATA steps with PROC TRANSPOSE. This paper presents an introduction to PROC TRANSPOSE, the useful SAS procedure that rotates SAS datasets. Through examples, I will compare code that transposes data with the DATA step to much simpler code using PROC TRANSPOSE and discuss ways to name and shape variables in the output dataset using the PREFIX= option, the ID statement, and BY processing. INTRODUCTION SAS programmers are often faced with the task of transposing data sets. You may need to transpose your data set in order to merge it with another data set, to feed into a SAS/STAT procedure, or to simply create a better-looking report. You can write a DATA step to do this, but the useful TRANSPOSE procedure can do the job in a fraction of the code, with knowledge of a few simple options and statements. SAMPLE DATA The following portion of the SAS data set SURVEY in Figure 1 will be used for demonstration. The task is to restructure the data so that there is one observation per question, and the observations of RESPONSE are four separate variables, as in Figure 2. Figure 1 Sample Dataset SURVEY Q Q Q Q Q Q Q Q Q Q Q Q Figure 2 Transposed Data Q Q Q Q Q Q Q Q Q Q
2 TRANSPOSING WITH THE DATA STEP The DATA step can accomplish this transposition with arrays and do loops with the following code: proc sort data=survey; data survey2 (keep=question response1-response4); retain response1-response4; array responses{4} response1-response4; set survey; if first.question then do; i=1; do j=1 to 4; responses{j}=.; end; end; responses{i}=percent; if last.question then output; i + 1; This DATA step, in addition to being lengthy, may produce unwanted results if the data set does not have placeholders for missing observations. In the data set SURVEY, none of the survey respondents chose response 2 for question 12, so no observation exists for question= Q12 and response= 2. The do loop processing assigns the value 21.3 to the variable response2, the value.9 to response3, and the value missing to response4, as shown in Figure 3. This is clearly not correct. In absence of an observation for question Q12 and response 2, the DATA step essentially shifts the values for question 12 and sets response4 to missing. Figure 3 Incorrect Results of Transposing with the DATA step Question 12 in data set SURVEY DATA step processing Question 12 in data set SURVEY2 Q Some manipulation to this DATA step can fix the problem, but an intimate familiarity with do loops, arrays, the first. and last. variables, and the program data vector is essential for correctly transposing data with the DATA step. In addition, a minor change to the data set structure may require significant recoding. For example, adapting this program to a data set with 5 rows of data for each by group would require updating multiple statements in the program. Fortunately, PROC TRANSPOSE provides an easier, less volatile path to data transposition. USING PROC TRANSPOSE PROC TRANSPOSE will correctly align the variables in an output data set with a few simple lines of code, and I will discuss the options and statements below. proc transpose data=survey out=survey3 (drop=_name LABEL_) prefix=response; id response; var percent; 2
3 PROC TRANSPOSE OPTIONS As with all SAS procedures, the DATA= option names the input data set and the OUT= option names the output data set. SAS will use the data set naming convention DATA1, DATA2, etc. in absence of an OUT= option. The PREFIX= option assigns a prefix to the transposed variables in the output data set. In our output data set SURVEY3, the prefix is response so the transposed variables are named response1, response2, response3, and response4. _NAME_ and _LABEL_, variables that SAS automatically generates in PROC TRANSPOSE, contain the names and labels, of the variables that were transposed. These may not be useful if you are only transposing one variable and can be dropped using the DROP= data set option. BY STATEMENT We use the BY statement in PROC TRANSPOSE to create an observation for each value of the BY variable for each transposed variable. The number of observations in the transposed data set is the number of unique values of the BY variable times the number of variables you are transposing. We are only transposing one variable, PERCENT, and there are 73 questions in the data set SURVEY, so our transposed data set, SURVEY3, will have 73 observations. PROC TRANSPOSE supports multiple BY variables. For example, if the sample data consisted of survey results by question for 80 different agencies, I could sort the data by question and agency, then use question and agency in the BY statement in PROC TRANSPOSE to create one observation for each combination of question and agency, resulting in 80 agencies X 73 questions X 1 variable that we are transposing = 5,840 observations. ID STATEMENT The variable you specify in the ID statement will be used to name the transposed variables in the output data set. If you use the PREFIX= option, the ID variable values will be concatenated to the prefix you specify to name the new variables. In the SAMPLE data, the ID variable is response (whose values are 1, 2, 3, and 4 ) and our prefix is response so our variable names in SURVEY3 are response1, response2, response3, and response4. If you use the ID statement without the PREFIX= option, the values of the ID variable will simply name the new variables. This is particularly useful if the values of the ID variable are descriptive (i.e. age, race, weight, etc.), as opposed to numbers in our example. However, if the first character of the ID variable is a number, or if it is a numeric variable, SAS will prefix the variable names with an underscore, since SAS variable names cannot begin with a number. If you do not use the PREFIX= option or the ID statement, the transposed variables will follow the naming convention COL1, COL2, etc. If you specify a prefix in the PREFIX= option and you do not use the ID statement, SAS will using the naming convention <prefix>1, <prefix>2, <prefix>3, etc. Because the ID variable RESPONSE has values 1, 2, 3, and 4, our variables in the transposed data set would have the same name, regardless of whether you use the ID statement or not. However, the ID statement is important because it places values within the correct variables, even when there is no placeholder for missing observations, as in question Q12. Without the ID statement, the output data set will look like the data set SURVEY2 that was created by the DATA step (see Figure 3). Figure 4 shows that the ID statement in PROC TRANSPOSE correctly transposes input data with no placeholders for missing values. Figure 4 Correct Results of Transposing with PROC TRANSPOSE and the ID Statement Question 12 in data set SURVEY PROC TRANSPOSE Question 12 in data set SURVEY3 Q
4 VAR STATEMENT The VAR statement tells SAS which variable(s) you want to transpose. Without a VAR statement, all numeric variables not named in the ID or BY statement will be transposed. If you want to transpose a character variable, you must use the VAR statement. The VAR statement could be omitted in this example because PERCENT is the only numeric variable. CONVERTING VARIABLES INTO OBSERVATIONS WITH PROC TRANSPOSE In addition to converting observations into variables, as in the example above, PROC TRANSPOSE can conversely make variables into observations. Several SAS/STAT procedures require a specific layout of the input data set and a transposition may be necessary if the data is not organized in that manner. For example, for each question in a survey, there are 4 possible responses, A, B, C, or D, and I have done a significance test for each of the 6 possible response comparisons. I have a data set with an observation for each question and a variable for each of the 6 possible tests containing the p-values I computed from the significance tests, as shown below in Figure 5. PROC MULTTEST is the SAS/STAT procedure that adjusts raw p-values from multiple hypothesis tests to avoid false significances that can occur with multiple testing. I want to adjust the p-values in the survey data using PROC MULTTEST, but it requires the input data to have one variable named RAW_P that contains the raw p-values. Thus, the data must be transposed to make the 6 p-value variables into observations, as shown in Figure 6. Figure 5 Original Data Set of Raw P-Values question pvalue_a_b pvalue_a_c pvalue_a_d pvalue_b_c pvalue_b_d pvalue_c_d Q Q Q Q Q Q Q Q Q Q Figure 6 Input Data Set Needed for PROC MULTTEST question test Raw_P Q01 pvalue_a_b Q01 pvalue_a_c Q01 pvalue_a_d Q01 pvalue_b_c Q01 pvalue_b_d Q01 pvalue_c_d Q02 pvalue_a_b Q02 pvalue_a_c Q02 pvalue_a_d Q02 pvalue_b_c Q02 pvalue_b_d Q02 pvalue_c_d : : Q10 pvalue_c_d
5 The following code effortlessly changes the original data into a data set suitable for PROC MULTTEST: proc transpose data=rawpvalues out=data4multtest (rename=(col1=raw_p _NAME_=test)); Recall that if you do not use a VAR statement, all numeric variables not named in the BY or ID statement will be transposed, so a VAR statement is not necessary. The RENAME= data set option renames automatic SAS variable names into variable names that PROC MULTTEST will recognize. CONCLUSION The ability to transpose data sets is a powerful data manipulation skill for SAS programmers. The DATA step is one method of transposing, but the code can be long and produce undesired results in some situations. With the few simple options and statements described in this paper, you can save time and hassle by swapping the DATA step for PROC TRANSPOSE. REFERENCES SAS Institute Inc Base SAS 9.1 Procedures Guide. Cary, NC: SAS Institute Inc. SAS Institute Inc SAS/STAT 9.1 User s Guide. Cary, NC: SAS Institute Inc. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Katie Joseph U.S. Office of Personnel Management 1900 E St, NW, Room 7439 Washington, DC Work Phone: (202) Fax: (202) katie.joseph@opm.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 trademarks of their respective companies. 5
Taming the PROC TRANSPOSE
Taming the PROC TRANSPOSE Matt Taylor, Carolina Analytical Consulting, LLC ABSTRACT The PROC TRANSPOSE is often misunderstood and seldom used. SAS users are unsure of the results it will give and curious
More informationPaper 2917. Creating Variables: Traps and Pitfalls Olena Galligan, Clinops LLC, San Francisco, CA
Paper 2917 Creating Variables: Traps and Pitfalls Olena Galligan, Clinops LLC, San Francisco, CA ABSTRACT Creation of variables is one of the most common SAS programming tasks. However, sometimes it produces
More informationReshaping & Combining Tables Unit of analysis Combining. Assignment 4. Assignment 4 continued PHPM 672/677 2/21/2016. Kum 1
Reshaping & Combining Tables Unit of analysis Combining Reshaping set: concatenate tables (stack rows) merge: link tables (attach columns) proc summary: consolidate rows proc transpose: reshape table Hye-Chung
More informationGuido s Guide to PROC FREQ A Tutorial for Beginners Using the SAS System Joseph J. Guido, University of Rochester Medical Center, Rochester, NY
Guido s Guide to PROC FREQ A Tutorial for Beginners Using the SAS System Joseph J. Guido, University of Rochester Medical Center, Rochester, NY ABSTRACT PROC FREQ is an essential procedure within BASE
More informationMore Tales from the Help Desk: Solutions for Simple SAS Mistakes Bruce Gilsen, Federal Reserve Board
More Tales from the Help Desk: Solutions for Simple SAS Mistakes Bruce Gilsen, Federal Reserve Board INTRODUCTION In 20 years as a SAS consultant at the Federal Reserve Board, I have seen SAS users make
More informationIntro to Longitudinal Data: A Grad Student How-To Paper Elisa L. Priest 1,2, Ashley W. Collinsworth 1,3 1
Intro to Longitudinal Data: A Grad Student How-To Paper Elisa L. Priest 1,2, Ashley W. Collinsworth 1,3 1 Institute for Health Care Research and Improvement, Baylor Health Care System 2 University of North
More informationChanging the Shape of Your Data: PROC TRANSPOSE vs. Arrays
Changing the Shape of Your Data: PROC TRANSPOSE vs. Arrays Bob Virgile Robert Virgile Associates, Inc. Overview To transpose your data (turning variables into observations or turning observations into
More informationPaper 232-2012. Getting to the Good Part of Data Analysis: Data Access, Manipulation, and Customization Using JMP
Paper 232-2012 Getting to the Good Part of Data Analysis: Data Access, Manipulation, and Customization Using JMP Audrey Ventura, SAS Institute Inc., Cary, NC ABSTRACT Effective data analysis requires easy
More informationCounting the Ways to Count in SAS. Imelda C. Go, South Carolina Department of Education, Columbia, SC
Paper CC 14 Counting the Ways to Count in SAS Imelda C. Go, South Carolina Department of Education, Columbia, SC ABSTRACT This paper first takes the reader through a progression of ways to count in SAS.
More informationPreparing Real World Data in Excel Sheets for Statistical Analysis
Paper DM03 Preparing Real World Data in Excel Sheets for Statistical Analysis Volker Harm, Bayer Schering Pharma AG, Berlin, Germany ABSTRACT This paper collects a set of techniques of importing Excel
More informationSAS PROGRAM EFFICIENCY FOR BEGINNERS. Bruce Gilsen, Federal Reserve Board
SAS PROGRAM EFFICIENCY FOR BEGINNERS Bruce Gilsen, Federal Reserve Board INTRODUCTION This paper presents simple efficiency techniques that can benefit inexperienced SAS software users on all platforms.
More informationEXST SAS Lab Lab #4: Data input and dataset modifications
EXST SAS Lab Lab #4: Data input and dataset modifications Objectives 1. Import an EXCEL dataset. 2. Infile an external dataset (CSV file) 3. Concatenate two datasets into one 4. The PLOT statement will
More informationPharmaSUG 2015 - Paper QT26
PharmaSUG 2015 - Paper QT26 Keyboard Macros - The most magical tool you may have never heard of - You will never program the same again (It's that amazing!) Steven Black, Agility-Clinical Inc., Carlsbad,
More informationStatistics and Analysis. Quality Control: How to Analyze and Verify Financial Data
Abstract Quality Control: How to Analyze and Verify Financial Data Michelle Duan, Wharton Research Data Services, Philadelphia, PA As SAS programmers dealing with massive financial data from a variety
More informationEmailing Automated Notification of Errors in a Batch SAS Program Julie Kilburn, City of Hope, Duarte, CA Rebecca Ottesen, City of Hope, Duarte, CA
Emailing Automated Notification of Errors in a Batch SAS Program Julie Kilburn, City of Hope, Duarte, CA Rebecca Ottesen, City of Hope, Duarte, CA ABSTRACT With multiple programmers contributing to a batch
More informationTransforming SAS Data Sets Using Arrays. Introduction
Transforming SAS Data Sets Using Arrays Ronald Cody, Ed.D., Robert Wood Johnson Medical School, Piscataway, NJ Introduction This paper describes how to efficiently transform SAS data sets using arrays.
More informationImporting Excel File using Microsoft Access in SAS Ajay Gupta, PPD Inc, Morrisville, NC
ABSTRACT PharmaSUG 2012 - Paper CC07 Importing Excel File using Microsoft Access in SAS Ajay Gupta, PPD Inc, Morrisville, NC In Pharmaceuticals/CRO industries, Excel files are widely use for data storage.
More informationDATA CLEANING: LONGITUDINAL STUDY CROSS-VISIT CHECKS
Paper 1314-2014 ABSTRACT DATA CLEANING: LONGITUDINAL STUDY CROSS-VISIT CHECKS Lauren Parlett,PhD Johns Hopkins University Bloomberg School of Public Health, Baltimore, MD Cross-visit checks are a vital
More informationAlternatives to Merging SAS Data Sets But Be Careful
lternatives to Merging SS Data Sets ut e Careful Michael J. Wieczkowski, IMS HELTH, Plymouth Meeting, P bstract The MERGE statement in the SS programming language is a very useful tool in combining or
More informationPROC SQL for SQL Die-hards Jessica Bennett, Advance America, Spartanburg, SC Barbara Ross, Flexshopper LLC, Boca Raton, FL
PharmaSUG 2015 - Paper QT06 PROC SQL for SQL Die-hards Jessica Bennett, Advance America, Spartanburg, SC Barbara Ross, Flexshopper LLC, Boca Raton, FL ABSTRACT Inspired by Christianna William s paper on
More informationData Presentation. Paper 126-27. Using SAS Macros to Create Automated Excel Reports Containing Tables, Charts and Graphs
Paper 126-27 Using SAS Macros to Create Automated Excel Reports Containing Tables, Charts and Graphs Tugluke Abdurazak Abt Associates Inc. 1110 Vermont Avenue N.W. Suite 610 Washington D.C. 20005-3522
More informationCombining SAS LIBNAME and VBA Macro to Import Excel file in an Intriguing, Efficient way Ajay Gupta, PPD Inc, Morrisville, NC
ABSTRACT PharmaSUG 2013 - Paper CC11 Combining SAS LIBNAME and VBA Macro to Import Excel file in an Intriguing, Efficient way Ajay Gupta, PPD Inc, Morrisville, NC There are different methods such PROC
More informationPerformance Test Suite Results for SAS 9.1 Foundation on the IBM zseries Mainframe
Performance Test Suite Results for SAS 9.1 Foundation on the IBM zseries Mainframe A SAS White Paper Table of Contents The SAS and IBM Relationship... 1 Introduction...1 Customer Jobs Test Suite... 1
More informationPaper 109-25 Merges and Joins Timothy J Harrington, Trilogy Consulting Corporation
Paper 109-25 Merges and Joins Timothy J Harrington, Trilogy Consulting Corporation Abstract This paper discusses methods of joining SAS data sets. The different methods and the reasons for choosing a particular
More informationPreserving Line Breaks When Exporting to Excel Nelson Lee, Genentech, South San Francisco, CA
PharmaSUG 2014 Paper CC07 Preserving Line Breaks When Exporting to Excel Nelson Lee, Genentech, South San Francisco, CA ABSTRACT Do you have imported data with line breaks and want to export the data to
More informationLet the CAT Out of the Bag: String Concatenation in SAS 9 Joshua Horstman, Nested Loop Consulting, Indianapolis, IN
Paper S1-08-2013 Let the CAT Out of the Bag: String Concatenation in SAS 9 Joshua Horstman, Nested Loop Consulting, Indianapolis, IN ABSTRACT Are you still using TRIM, LEFT, and vertical bar operators
More informationFrom The Little SAS Book, Fifth Edition. Full book available for purchase here.
From The Little SAS Book, Fifth Edition. Full book available for purchase here. Acknowledgments ix Introducing SAS Software About This Book xi What s New xiv x Chapter 1 Getting Started Using SAS Software
More informationC H A P T E R 1 Introducing Data Relationships, Techniques for Data Manipulation, and Access Methods
C H A P T E R 1 Introducing Data Relationships, Techniques for Data Manipulation, and Access Methods Overview 1 Determining Data Relationships 1 Understanding the Methods for Combining SAS Data Sets 3
More informationB) Mean Function: This function returns the arithmetic mean (average) and ignores the missing value. E.G: Var=MEAN (var1, var2, var3 varn);
SAS-INTERVIEW QUESTIONS 1. What SAS statements would you code to read an external raw data file to a DATA step? Ans: Infile and Input statements are used to read external raw data file to a Data Step.
More informationBeyond the Simple SAS Merge. Vanessa L. Cox, MS 1,2, and Kimberly A. Wildes, DrPH, MA, LPC, NCC 3. Cancer Center, Houston, TX. vlcox@mdanderson.
Beyond the Simple SAS Merge Vanessa L. Cox, MS 1,2, and Kimberly A. Wildes, DrPH, MA, LPC, NCC 3 1 General Internal Medicine and Ambulatory Treatment, The University of Texas MD Anderson Cancer Center,
More informationPharmaSUG 2011 - Paper AD03
PharmaSUG 2011 - Paper AD03 Using Visual Basic for Application to Produce Table of Contents from SAS Output List Files Zemin Zeng, Forest Research Institute, Inc., Jersey City, NJ Mei Li, ImClone Systems,
More informationData management and SAS Programming Language EPID576D
Time: Location: Tuesday and Thursdays, 11:00am 12:15 pm Drachman Hall A319 Instructors: Angelika Gruessner, MS, PhD 626-3118 (office) Drachman Hall A224 acgruess@azcc.arizona.edu Office Hours: Monday Thursday
More informationA Dose of SAS to Brighten Your Healthcare Blues
A Dose of SAS to Brighten Your Healthcare Blues Gabriela Cantu 1, Christopher Klekar 1 1 Center for Clinical Effectiveness, Baylor Scott & White Health, Dallas, Texas ABSTRACT The development and adoption
More informationPaper TU_09. Proc SQL Tips and Techniques - How to get the most out of your queries
Paper TU_09 Proc SQL Tips and Techniques - How to get the most out of your queries Kevin McGowan, Constella Group, Durham, NC Brian Spruell, Constella Group, Durham, NC Abstract: Proc SQL is a powerful
More informationManaging Tables in Microsoft SQL Server using SAS
Managing Tables in Microsoft SQL Server using SAS Jason Chen, Kaiser Permanente, San Diego, CA Jon Javines, Kaiser Permanente, San Diego, CA Alan L Schepps, M.S., Kaiser Permanente, San Diego, CA Yuexin
More informationProgramming Idioms Using the SET Statement
Programming Idioms Using the SET Statement Jack E. Fuller, Trilogy Consulting Corporation, Kalamazoo, MI ABSTRACT While virtually every programmer of base SAS uses the SET statement, surprisingly few programmers
More informationTales from the Help Desk 3: More Solutions for Simple SAS Mistakes Bruce Gilsen, Federal Reserve Board
Tales from the Help Desk 3: More Solutions for Simple SAS Mistakes Bruce Gilsen, Federal Reserve Board INTRODUCTION In 20 years as a SAS consultant at the Federal Reserve Board, I have seen SAS users make
More information2: Entering Data. Open SPSS and follow along as your read this description.
2: Entering Data Objectives Understand the logic of data files Create data files and enter data Insert cases and variables Merge data files Read data into SPSS from other sources The Logic of Data Files
More informationSubsetting Observations from Large SAS Data Sets
Subsetting Observations from Large SAS Data Sets Christopher J. Bost, MDRC, New York, NY ABSTRACT This paper reviews four techniques to subset observations from large SAS data sets: MERGE, PROC SQL, user-defined
More informationTable Lookups: From IF-THEN to Key-Indexing
Paper 158-26 Table Lookups: From IF-THEN to Key-Indexing Arthur L. Carpenter, California Occidental Consultants ABSTRACT One of the more commonly needed operations within SAS programming is to determine
More informationLabels, Labels, and More Labels Stephanie R. Thompson, Rochester Institute of Technology, Rochester, NY
Paper FF-007 Labels, Labels, and More Labels Stephanie R. Thompson, Rochester Institute of Technology, Rochester, NY ABSTRACT SAS datasets include labels as optional variable attributes in the descriptor
More informationA Method for Cleaning Clinical Trial Analysis Data Sets
A Method for Cleaning Clinical Trial Analysis Data Sets Carol R. Vaughn, Bridgewater Crossings, NJ ABSTRACT This paper presents a method for using SAS software to search SAS programs in selected directories
More informationNew Tricks for an Old Tool: Using Custom Formats for Data Validation and Program Efficiency
New Tricks for an Old Tool: Using Custom Formats for Data Validation and Program Efficiency S. David Riba, JADE Tech, Inc., Clearwater, FL ABSTRACT PROC FORMAT is one of the old standards among SAS Procedures,
More informationThe Program Data Vector As an Aid to DATA step Reasoning Marianne Whitlock, Kennett Square, PA
PAPER IN09_05 The Program Data Vector As an Aid to DATA step Reasoning Marianne Whitlock, Kennett Square, PA ABSTRACT The SAS DATA step is easy enough for beginners to produce results quickly. You can
More informationFun with PROC SQL Darryl Putnam, CACI Inc., Stevensville MD
NESUG 2012 Fun with PROC SQL Darryl Putnam, CACI Inc., Stevensville MD ABSTRACT PROC SQL is a powerful yet still overlooked tool within our SAS arsenal. PROC SQL can create tables, sort and summarize data,
More informationSET The SET statement is often used in two ways copying and appending.
Point, Set, Match (Merge) A Beginner s Lesson Jennifer Hoff Lindquist, Institute for Clinical and Epidemiologic Research, Veterans Affairs Medical Center, Durham, NC The phrase Point, Set and Match is
More informationMultiple Set Statements in a Data Step: A Powerful Technique for Combining and Aggregating Complex Data. Renu Gehring
Multiple Set Statements in a Data Step: A Powerful Technique for Combining and Aggregating Complex Data Renu Gehring SAS Instructor Ace-Cube, LLP Beaverton, OR Health Care Analyst CareOregon, Inc. Portland,
More informationMethods for Interaction Detection in Predictive Modeling Using SAS Doug Thompson, PhD, Blue Cross Blue Shield of IL, NM, OK & TX, Chicago, IL
Paper SA01-2012 Methods for Interaction Detection in Predictive Modeling Using SAS Doug Thompson, PhD, Blue Cross Blue Shield of IL, NM, OK & TX, Chicago, IL ABSTRACT Analysts typically consider combinations
More informationHOW TO USE SAS SOFTWARE EFFECTIVELY ON LARGE FILES. Juliana M. Ma, University of North Carolina
INTRODUCTION HOW TO USE SAS SOFTWARE EFFECTIVELY ON LARGE FILES The intent of this tutorial was to present basic principles worth remembering when working with SAS software and large files. The paper varies
More informationUSING PROCEDURES TO CREATE SAS DATA SETS... ILLUSTRATED WITH AGE ADJUSTING OF DEATH RATES 1
USING PROCEDURES TO CREATE SAS DATA SETS... ILLUSTRATED WITH AGE ADJUSTING OF DEATH RATES 1 There may be times when you run a SAS procedure when you would like to direct the procedure output to a SAS data
More informationStoring and Using a List of Values in a Macro Variable
Storing and Using a List of Values in a Macro Variable Arthur L. Carpenter California Occidental Consultants, Oceanside, California ABSTRACT When using the macro language it is not at all unusual to need
More informationDo It Yourself (DIY) Data: Creating a Searchable Data Set of Available Classrooms using SAS Enterprise BI Server
Paper 8801-2016 Do It Yourself (DIY) Data: Creating a Searchable Data Set of Available Classrooms using SAS Enterprise BI Server Nicole E. Jagusztyn, Hillsborough Community College ABSTRACT At a community
More informationSalary. Cumulative Frequency
HW01 Answering the Right Question with the Right PROC Carrie Mariner, Afton-Royal Training & Consulting, Richmond, VA ABSTRACT When your boss comes to you and says "I need this report by tomorrow!" do
More informationBuilding and Customizing a CDISC Compliance and Data Quality Application Wayne Zhong, Accretion Softworks, Chester Springs, PA
WUSS2015 Paper 84 Building and Customizing a CDISC Compliance and Data Quality Application Wayne Zhong, Accretion Softworks, Chester Springs, PA ABSTRACT Creating your own SAS application to perform CDISC
More informationUsing DATA Step MERGE and PROC SQL JOIN to Combine SAS Datasets Dalia C. Kahane, Westat, Rockville, MD
Using DATA Step MERGE and PROC SQL JOIN to Combine SAS Datasets Dalia C. Kahane, Westat, Rockville, MD ABSTRACT This paper demonstrates important features of combining datasets in SAS. The facility to
More informationPaper 208-28. KEYWORDS PROC TRANSPOSE, PROC CORR, PROC MEANS, PROC GPLOT, Macro Language, Mean, Standard Deviation, Vertical Reference.
Paper 208-28 Analysis of Method Comparison Studies Using SAS Mohamed Shoukri, King Faisal Specialist Hospital & Research Center, Riyadh, KSA and Department of Epidemiology and Biostatistics, University
More informationProgramming Tricks For Reducing Storage And Work Space Curtis A. Smith, Defense Contract Audit Agency, La Mirada, CA.
Paper 23-27 Programming Tricks For Reducing Storage And Work Space Curtis A. Smith, Defense Contract Audit Agency, La Mirada, CA. ABSTRACT Have you ever had trouble getting a SAS job to complete, although
More informationLOCF-Different Approaches, Same Results Using LAG Function, RETAIN Statement, and ARRAY Facility Iuliana Barbalau, ClinOps LLC. San Francisco, CA.
LOCF-Different Approaches, Same Results Using LAG Function, RETAIN Statement, and ARRAY Facility Iuliana Barbalau, ClinOps LLC. San Francisco, CA. ABSTRACT LOCF stands for Last Observation Carried Forward
More informationFlat Pack Data: Converting and ZIPping SAS Data for Delivery
Flat Pack Data: Converting and ZIPping SAS Data for Delivery Sarah Woodruff, Westat, Rockville, MD ABSTRACT Clients or collaborators often need SAS data converted to a different format. Delivery or even
More informationData-driven Validation Rules: Custom Data Validation Without Custom Programming Don Hopkins, Ursa Logic Corporation, Durham, NC
Data-driven Validation Rules: Custom Data Validation Without Custom Programming Don Hopkins, Ursa Logic Corporation, Durham, NC ABSTRACT One of the most expensive and time-consuming aspects of data management
More informationThe Power of PROC DATASETS Lisa M. Davis, Blue Cross Blue Shield of Florida, Jacksonville, Florida
Paper #TU20 The Power of PROC DATASETS Lisa M. Davis, Blue Cross Blue Shield of Florida, Jacksonville, Florida ABSTRACT The DATASETS procedure can be used to do many functions that are normally done within
More informationDownloading Your Financial Statements to Excel
Downloading Your Financial Statements to Excel Downloading Data from CU*BASE to PC INTRODUCTION How can I get my favorite financial statement from CU*BASE into my Excel worksheet? How can I get this data
More informationEffective Use of SQL in SAS Programming
INTRODUCTION Effective Use of SQL in SAS Programming Yi Zhao Merck & Co. Inc., Upper Gwynedd, Pennsylvania Structured Query Language (SQL) is a data manipulation tool of which many SAS programmers are
More informationEssential Project Management Reports in Clinical Development Nalin Tikoo, BioMarin Pharmaceutical Inc., Novato, CA
Essential Project Management Reports in Clinical Development Nalin Tikoo, BioMarin Pharmaceutical Inc., Novato, CA ABSTRACT Throughout the course of a clinical trial the Statistical Programming group is
More informationBase Conversion written by Cathy Saxton
Base Conversion written by Cathy Saxton 1. Base 10 In base 10, the digits, from right to left, specify the 1 s, 10 s, 100 s, 1000 s, etc. These are powers of 10 (10 x ): 10 0 = 1, 10 1 = 10, 10 2 = 100,
More informationSPSS INSTRUCTION CHAPTER 1
SPSS INSTRUCTION CHAPTER 1 Performing the data manipulations described in Section 1.4 of the chapter require minimal computations, easily handled with a pencil, sheet of paper, and a calculator. However,
More informationInnovative Techniques and Tools to Detect Data Quality Problems
Paper DM05 Innovative Techniques and Tools to Detect Data Quality Problems Hong Qi and Allan Glaser Merck & Co., Inc., Upper Gwynnedd, PA ABSTRACT High quality data are essential for accurate and meaningful
More informationKEYWORDS ARRAY statement, DO loop, temporary arrays, MERGE statement, Hash Objects, Big Data, Brute force Techniques, PROC PHREG
Paper BB-07-2014 Using Arrays to Quickly Perform Fuzzy Merge Look-ups: Case Studies in Efficiency Arthur L. Carpenter California Occidental Consultants, Anchorage, AK ABSTRACT Merging two data sets when
More informationChapter 2 The Data Table. Chapter Table of Contents
Chapter 2 The Data Table Chapter Table of Contents Introduction... 21 Bringing in Data... 22 OpeningLocalFiles... 22 OpeningSASFiles... 27 UsingtheQueryWindow... 28 Modifying Tables... 31 Viewing and Editing
More informationSurvey Analysis: Options for Missing Data
Survey Analysis: Options for Missing Data Paul Gorrell, Social & Scientific Systems, Inc., Silver Spring, MD Abstract A common situation researchers working with survey data face is the analysis of missing
More informationThe SET Statement and Beyond: Uses and Abuses of the SET Statement. S. David Riba, JADE Tech, Inc., Clearwater, FL
The SET Statement and Beyond: Uses and Abuses of the SET Statement S. David Riba, JADE Tech, Inc., Clearwater, FL ABSTRACT The SET statement is one of the most frequently used statements in the SAS System.
More informationp-values and significance levels (false positive or false alarm rates)
p-values and significance levels (false positive or false alarm rates) Let's say 123 people in the class toss a coin. Call it "Coin A." There are 65 heads. Then they toss another coin. Call it "Coin B."
More informationFoundations & Fundamentals. A PROC SQL Primer. Matt Taylor, Carolina Analytical Consulting, LLC, Charlotte, NC
A PROC SQL Primer Matt Taylor, Carolina Analytical Consulting, LLC, Charlotte, NC ABSTRACT Most SAS programmers utilize the power of the DATA step to manipulate their datasets. However, unless they pull
More informationParallel Data Preparation with the DS2 Programming Language
ABSTRACT Paper SAS329-2014 Parallel Data Preparation with the DS2 Programming Language Jason Secosky and Robert Ray, SAS Institute Inc., Cary, NC and Greg Otto, Teradata Corporation, Dayton, OH A time-consuming
More informationRapid Development of an ALM System
Rapid Development of an ALM System Irmantas Kamienas CONTENT Tools developed by RMD Tools developed through the collaboration with the vendors Future plans AB VILNIAUS BANKAS AB Vilniaus Bankas was established
More informationPaper 10-27 Designing Web Applications: Lessons from SAS User Interface Analysts Todd Barlow, SAS Institute Inc., Cary, NC
Paper 10-27 Designing Web Applications: Lessons from SAS User Interface Analysts Todd Barlow, SAS Institute Inc., Cary, NC ABSTRACT Web application user interfaces combine aspects of non-web GUI design
More informationPharmaSUG 2013 - Paper DG06
PharmaSUG 2013 - Paper DG06 JMP versus JMP Clinical for Interactive Visualization of Clinical Trials Data Doug Robinson, SAS Institute, Cary, NC Jordan Hiller, SAS Institute, Cary, NC ABSTRACT JMP software
More informationUsing SAS to Build Customer Level Datasets for Predictive Modeling Scott Shockley, Cox Communications, New Orleans, Louisiana
Using SAS to Build Customer Level Datasets for Predictive Modeling Scott Shockley, Cox Communications, New Orleans, Louisiana ABSTRACT If you are using operational data to build datasets at the customer
More informationPreparing your data for analysis using SAS. Landon Sego 24 April 2003 Department of Statistics UW-Madison
Preparing your data for analysis using SAS Landon Sego 24 April 2003 Department of Statistics UW-Madison Assumptions That you have used SAS at least a few times. It doesn t matter whether you run SAS in
More informationDefining a Validation Process for End-user (Data Manager / Statisticians) SAS Programs
Defining a Validation Process for End-user (Data Manager / Statisticians) SAS Programs Andy Lawton, Boehringer Ingelheim UK Ltd., Berkshire, England INTRODUCTION The requirements for validating end-user
More informationAnyone Can Learn PROC TABULATE
Paper 60-27 Anyone Can Learn PROC TABULATE Lauren Haworth, Genentech, Inc., South San Francisco, CA ABSTRACT SAS Software provides hundreds of ways you can analyze your data. You can use the DATA step
More informationThe Query Builder: The Swiss Army Knife of SAS Enterprise Guide
Paper 1557-2014 The Query Builder: The Swiss Army Knife of SAS Enterprise Guide ABSTRACT Jennifer First-Kluge and Steven First, Systems Seminar Consultants, Inc. The SAS Enterprise Guide Query Builder
More informationIntegrating SAS with JMP to Build an Interactive Application
Paper JMP50 Integrating SAS with JMP to Build an Interactive Application ABSTRACT This presentation will demonstrate how to bring various JMP visuals into one platform to build an appealing, informative,
More informationSyntax Menu Description Options Remarks and examples Stored results References Also see
Title stata.com xi Interaction expansion Syntax Syntax Menu Description Options Remarks and examples Stored results References Also see xi [, prefix(string) noomit ] term(s) xi [, prefix(string) noomit
More informationSAS Enterprise Guide A Quick Overview of Developing, Creating, and Successfully Delivering a Simple Project
Paper 156-29 SAS Enterprise Guide A Quick Overview of Developing, Creating, and Successfully Delivering a Simple Project Ajaz (A.J.) Farooqi, Walt Disney Parks and Resorts, Lake Buena Vista, FL ABSTRACT
More informationWhite Paper. Thirsting for Insight? Quench It With 5 Data Management for Analytics Best Practices.
White Paper Thirsting for Insight? Quench It With 5 Data Management for Analytics Best Practices. Contents Data Management: Why It s So Essential... 1 The Basics of Data Preparation... 1 1: Simplify Access
More informationSample Fraction Addition and Subtraction Concepts Activities 1 3
Sample Fraction Addition and Subtraction Concepts Activities 1 3 College- and Career-Ready Standard Addressed: Build fractions from unit fractions by applying and extending previous understandings of operations
More informationListings and Patient Summaries in Excel (SAS and Excel, an excellent partnership)
Paper TS01 Listings and Patient Summaries in Excel (SAS and Excel, an excellent partnership) Xavier Passera, Detour Solutions Ltd., United Kingdom ABSTRACT The purpose of this paper is to explain how SAS
More informationChapter 19 Operational Amplifiers
Chapter 19 Operational Amplifiers The operational amplifier, or op-amp, is a basic building block of modern electronics. Op-amps date back to the early days of vacuum tubes, but they only became common
More informationPaper 74881-2011 Creating SAS Datasets from Varied Sources Mansi Singh and Sofia Shamas, MaxisIT Inc, NJ
Paper 788-0 Creating SAS Datasets from Varied Sources Mansi Singh and Sofia Shamas, MaxisIT Inc, NJ ABSTRACT Often SAS programmers find themselves dealing with data coming from multiple sources and usually
More informationHow to Reduce the Disk Space Required by a SAS Data Set
How to Reduce the Disk Space Required by a SAS Data Set Selvaratnam Sridharma, U.S. Census Bureau, Washington, DC ABSTRACT SAS datasets can be large and disk space can often be at a premium. In this paper,
More informationVLOOKUP Functions How do I?
For Adviser use only (Not to be relied on by anyone else) Once you ve produced your ISA subscription report and client listings report you then use the VLOOKUP to create all the information you need into
More informationMICROSOFT OFFICE ACCESS 2007 - LEVEL 2
MICROSOFT OFFICE 2007 MICROSOFT OFFICE ACCESS 2007 - LEVEL 2 Modifying Tables Setting Field Properties Using Operators in Queries Designing Advanced Queries Creating Action Queries Using Advanced Query
More informationBefore You Begin... 2 Running SAS in Batch Mode... 2 Printing the Output of Your Program... 3 SAS Statements and Syntax... 3
Using SAS In UNIX 2010 Stanford University provides UNIX computing resources on the UNIX Systems, which can be accessed through the Stanford University Network (SUNet). This document provides a basic overview
More informationParameter Passing in Pascal
Parameter Passing in Pascal Mordechai Ben-Ari Department of Science Teaching Weizmann Institute of Science Rehovot 76100 Israel ntbenari@wis.weizmann.ac.il Abstract This paper claims that reference parameters
More informationWhat You re Missing About Missing Values
Paper 1440-2014 What You re Missing About Missing Values Christopher J. Bost, MDRC, New York, NY ABSTRACT Do you know everything you need to know about missing values? Do you know how to assign a missing
More informationData exploration with Microsoft Excel: univariate analysis
Data exploration with Microsoft Excel: univariate analysis Contents 1 Introduction... 1 2 Exploring a variable s frequency distribution... 2 3 Calculating measures of central tendency... 16 4 Calculating
More informationPharmaSUG2010 HW06. Insights into ADaM. Matthew Becker, PharmaNet, Cary, NC, United States
PharmaSUG2010 HW06 Insights into ADaM Matthew Becker, PharmaNet, Cary, NC, United States ABSTRACT ADaM (Analysis Dataset Model) is meant to describe the data attributes such as structure, content, and
More informationPROC SUMMARY Options Beyond the Basics Susmita Pattnaik, PPD Inc, Morrisville, NC
Paper BB-12 PROC SUMMARY Options Beyond the Basics Susmita Pattnaik, PPD Inc, Morrisville, NC ABSTRACT PROC SUMMARY is used for summarizing the data across all observations and is familiar to most SAS
More informationBeyond the Basics: Advanced REPORT Procedure Tips and Tricks Updated for SAS 9.2 Allison McMahill Booth, SAS Institute Inc.
ABSTRACT PharmaSUG 2011 - Paper SAS-AD02 Beyond the Basics: Advanced REPORT Procedure Tips and Tricks Updated for SAS 9.2 Allison McMahill Booth, SAS Institute Inc., Cary, NC, USA This paper is an update
More information