Taming the PROC TRANSPOSE

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "Taming the PROC TRANSPOSE"

Transcription

1 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 about syntax that is often not particularly intuitive. Many programmers resort to use of the Data step to achieve transposition which they believe results in better control. This paper is intended to demystify the procedure, explaining the syntax and providing useful examples of how to utilize it. INTRODUCTION The PROC TRANSPOSE is part of the SAS language that does not get used as much as it should. It is very helpful when needing to shift data from rows to columns or vice versa. This function if achieved in a DATA step can be much more cumbersome to code. The PROC TRANSPOSE can save time and complexity once it is properly explained. TRANSPOSE SYNTAX: The syntax for the PROC TRANPOSE is somewhat misunderstood amongst SAS users. It is probably a little unorthodox when compared with other procedures that analysts use. In this section we will detail all of the features of the PROC TRANSPOSE. BY This statement allows you to transpose data within the combination of the BY variables, the BY variables themselves aren t transposed. A PROC SORT needs to be run on the source data in order for BY variables to be processed properly, unless the DESCENDING or NOTSORTED options are COPY ID This statement copies the value of a variable from the source data set to the data set resulting of the procedure. Because of this, the number of records in your output data set will be the same as your input data set. Missing data will show up for your duplicate records. This statement identifies the variable which creates a name for the value that was transposed. If the variable in the ID statement is numeric, an underscore will be put at the beginning of the variable name, in keeping with variable naming convention. Without the ID variable the default value will be col1, col2, etc. IDLABEL VAR This statement labels the variable being transposed. In order for this statement to work properly, it must follow the ID statement. This statement lists the actual data that needs to be transposed. If you do not include a VAR statement, the procedure will transpose all numeric variables that are not included in a BY statement or a ID statement. If you want to transpose a character variable, a VAR statement is required. DATA= This option specifies the input data set. LABEL= This option allows you to choose a name for the automatic variable _LABEL_ created by the procedure. In many cases this variable is dropped from the final results. 1

2 NAME= This option allows you to choose a name for the automatic variable _NAME_ created by the procedure. If you have chosen a more complex problem that involves multiple variables in the var statement this additional variable becomes important to identify which variable is represented in the results. Otherwise it can generally be dropped. OUT= This option creates a new data set for your results. If you do not specify an output data set in the code the results will be put into a default data set called data1. PREFIX= The prefix adds a string to the beginning of the transposed variable. In the default example, the prefix would be col as mentioned in the ID description. This option can be used in conjunction with the ID variable or with the default ID value. EXAMPLE 1 SIMPLE TRANSPOSE We start with a simple example of the transpose procedure. The data we are beginning with looks like the results of a typical PROC FREQ. It includes a product, a decision code and a count of each combination. State Popflag COUNT DC Pop2 6 DC Pop3 2 DC Pop4 3 DE Pop2 6 DE Pop3 5 DE Pop4 6 FL Pop2 8 FL Pop3 6 FL Pop4 6 GA Pop2 8 Our desired output is to transpose the value of count for each state. We would also like the columns to be titled with the values of popflag so that the data is clearly labeled. The following code illustrates how this would be done: proc sort data=tr1; proc transpose data=tr1 out=tr2; var count; The variable we desire to transpose is count and therefore goes into the VAR statement. The title desired for the transposed columns is the popflag field and goes in the ID field. Because we would like the transpose to occur for each value of product, it goes into the BY statement. The results of this code look like the following: Obs State _NAME LABEL_ Pop2 Pop3 Pop4 Pop1 1 DC COUNT Frequency Count DE COUNT Frequency Count FL COUNT Frequency Count GA COUNT Frequency Count NC COUNT Frequency Count

3 6 PA COUNT Frequency Count SC COUNT Frequency Count VA COUNT Frequency Count Note the default variables of _NAME_ and _LABEL_ were created by the procedure indicating which variable was transposed. If your ID variable was numeric, SAS would automatically put an underscore in front of it to conform to SAS rules on naming conventions. EXAMPLE 2 A MORE COMPLEX TRANSPOSE Our beginning data for this example has another dimension. It includes the state, the popflag, a count of accounts and a sum of the balances those accounts have. Here is its appearance: State Popflag count balance DC Pop DC Pop DC Pop DE Pop DE Pop DE Pop FL Pop FL Pop FL Pop The desired output for this procedure is to keep the state value on the left. We wish to transpose all of the numeric variables in the data set, those being count and balance. The ID variable will be the popflag variable in the data set. In this example we will be able to utilize the _NAME_ variable to keep the transposed variables straight. The code would look like this: proc sort data=test1; proc transpose data=test1 out=test2(drop=_label_) name=metrics; var count balance; As with the previous example, the transposed variables are listed in the VAR statement. In this example we use the NAME= option to title the name column and drop the _LABEL_ field. The resulting data looks like this: Obs State metrics Pop2 Pop3 Pop4 Pop1 1 DC count DC balance DE count DE balance FL count FL balance GA count GA balance Note the name variable is now titled metrics, while the _LABEL_ field has been deleted. The package codes are now across and the transposed variable are vertical. 3

4 EXAMPLE 3 THE DOUBLE TRANSPOSE Transposition of the same data twice in theory should return you to the exact same data. However, there are a few quirks to the procedure that a programmer can use to your advantage. For this example, our starting data has different source channels for each month and the corresponding booked accounts. Obs State Popflag COUNT 1 GA Pop2 8 2 GA Pop3 8 3 GA Pop4 4 4 NC Pop NC Pop NC Pop3 9 7 NC Pop4 2 One note about our beginning data is that not all values of popflag are represented in each month. On some occasions, you would like to report on all values in all months, whether they had population or not. This is where the double transpose can come in handy. The first transpose is similar to previous examples. We are transposing the count variable with popflag as the title of each column, and transposing it by state. proc sort data=tr1; proc transpose data=tr1 out=tr2(drop=_label_); var count; As can be seen, the resulting data has a placeholder for the popflags without data, therefore achieving the result we desired. Also note that we kept the _NAME_ variable this time because we will need it in the second transpose. Obs State _NAME_ Pop2 Pop3 Pop4 Pop1 1 GA COUNT NC COUNT The second transpose is an attempt to restore the data that we had originally. The syntax is designed to reverse the previous procedure. However, since the first transpose added placeholders for the missing months, they will be kept in the resulting data. proc sort data=tr2; proc transpose data=tr2 out=tr3(drop=_label_) name=popflag; var pop1 pop2 pop3 pop4; id _name_; The result of the second transpose returns the data back to its previous structure, but adds fields that were missing in the previous data. This gives the user a complete look at the data for all values of popflag and all states. 4

5 Obs State popflag COUNT 1 GA Pop1. 2 GA Pop2 8 3 GA Pop3 8 4 GA Pop4 4 5 NC Pop NC Pop NC Pop3 9 8 NC Pop4 2 CONCLUSIONS The PROC TRANPOSE can be a very useful procedure for SAS users. Once you pick up the syntax, it can serve a useful purpose in your coding arsenal and can make your life easier when desiring to shift data. ACKNOWLEDGMENTS 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. CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Matt Taylor Carolina Analytical Consulting, LLC 8511 Davis Lake Parkway Ste # C6-285 Charlotte, NC * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 5

Foundations & Fundamentals. A PROC SQL Primer. Matt Taylor, Carolina Analytical Consulting, LLC, Charlotte, NC

Foundations & 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 information

Simplifying Effective Data Transformation Via PROC TRANSPOSE

Simplifying Effective Data Transformation Via PROC TRANSPOSE ABSTRACT PharmaSUG 2012 - Paper TF03 Simplifying Effective Data Transformation Via PROC TRANSPOSE Arthur X. Li, City of Hope Comprehensive Cancer Center, Duarte, CA You can store data with repeated measures

More information

Swap the DATA Step for PROC TRANSPOSE Katie Joseph, U.S. Office of Personnel Management, Washington, DC

Swap the DATA Step for PROC TRANSPOSE Katie Joseph, U.S. Office of Personnel Management, Washington, DC 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

More information

The TRANSPOSE Procedure

The TRANSPOSE Procedure 1269 CHAPTER 39 The TRANSPOSE Procedure Overview 1269 Procedure Syntax 1271 PROC TRANSPOSE Statement 1272 BY Statement 1273 COPY Statement 1275 ID Statement 1275 IDLABEL Statement 1276 VAR Statement 1277

More information

Salary. Cumulative Frequency

Salary. 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 information

Sharpening Your Skills in Reshaping data: PROC TRANSPOSE vs. Array Processing Arthur X. Li, City of Hope National Medical Center, Duarte, CA

Sharpening Your Skills in Reshaping data: PROC TRANSPOSE vs. Array Processing Arthur X. Li, City of Hope National Medical Center, Duarte, CA PharmaSUG 2013 Paper BB07 Sharpening Your Skills in Reshaping data: PROC TRANSPOSE vs. Array Processing Arthur X. Li, City of Hope National Medical Center, Duarte, CA ABSTRACT A common data managing task

More information

Counting the Ways to Count in SAS. Imelda C. Go, South Carolina Department of Education, Columbia, SC

Counting 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 information

Paper 109-25 Merges and Joins Timothy J Harrington, Trilogy Consulting Corporation

Paper 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 information

PO-18 Array, Hurray, Array; Consolidate or Expand Your Input Data Stream Using Arrays

PO-18 Array, Hurray, Array; Consolidate or Expand Your Input Data Stream Using Arrays Array, Hurray, Array; Consolidate or Expand Your Input Data Stream Using Arrays, continued SESUG 2012 PO-18 Array, Hurray, Array; Consolidate or Expand Your Input Data Stream Using Arrays William E Benjamin

More information

The Essentials of Finding the Distinct, Unique, and Duplicate Values in Your Data

The Essentials of Finding the Distinct, Unique, and Duplicate Values in Your Data The Essentials of Finding the Distinct, Unique, and Duplicate Values in Your Data Carter Sevick MS, DoD Center for Deployment Health Research, San Diego, CA ABSTRACT Whether by design or by error there

More information

So You Want to be SAS Certified Ben Cochran, The Bedford Group, Raleigh, NC

So You Want to be SAS Certified Ben Cochran, The Bedford Group, Raleigh, NC Paper BB-15-2014 So You Want to be SAS Certified Ben Cochran, The Bedford Group, Raleigh, NC ABSTRACT Several years ago, SAS Institute, Inc. started a Certification program to give SAS users a chance to

More information

SAS PROGRAM EFFICIENCY FOR BEGINNERS. Bruce Gilsen, Federal Reserve Board

SAS 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 information

Guido 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 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 information

Paper 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 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 information

Let the CAT Out of the Bag: String Concatenation in SAS 9 Joshua Horstman, Nested Loop Consulting, Indianapolis, IN

Let 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 information

Do It Yourself (DIY) Data: Creating a Searchable Data Set of Available Classrooms using SAS Enterprise BI Server

Do 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 information

10-week SAS Training Program.

10-week SAS Training Program. 10-week SAS Training Program Passing the exam is guaranteed. Need help getting certified as a SAS Base Programmer? We can help! Our 10-week SAS Training Program is a complete SAS training program that

More information

Search and Replace in SAS Data Sets thru GUI

Search and Replace in SAS Data Sets thru GUI Search and Replace in SAS Data Sets thru GUI Edmond Cheng, Bureau of Labor Statistics, Washington, DC ABSTRACT In managing data with SAS /BASE software, performing a search and replace is not a straight

More information

Nutech Computer Training Institute 1682 E. Gude Dr. #102, Rockville, MD Tel: Website:

Nutech Computer Training Institute 1682 E. Gude Dr. #102, Rockville, MD Tel: Website: Nutech Computer Training Institute 1682 E. Gude Dr. #102, Rockville, MD. 20850 Tel:301-610-9300 Website: www.nutechtraining.com SAS Hands-On Programming Training Outline Total Hours: 96 hrs Package Tuition

More information

Integrating Data and Business Rules with a Control Data Set in SAS

Integrating Data and Business Rules with a Control Data Set in SAS Paper 3461-2015 Integrating Data and Business Rules with a Data Set in SAS Edmond Cheng, CACI International Inc. ABSTRACT In SAS software development, data specifications and process requirements can be

More information

Alternatives to Merging SAS Data Sets But Be Careful

Alternatives 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 information

The Program Data Vector As an Aid to DATA step Reasoning Marianne Whitlock, Kennett Square, PA

The 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 information

Foundations & Fundamentals

Foundations & Fundamentals Ad Hoc Data Preparation for Analysis Using SAS Enterprise Guide I-kong Fu, Wayne Thompson, Mike Porter, SAS Institute Inc., Cary, NC ABSTRACT SAS Enterprise Guide is a popular application for conducting

More information

Survey Analysis: Options for Missing Data

Survey 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 information

PROC SUMMARY Options Beyond the Basics Susmita Pattnaik, PPD Inc, Morrisville, NC

PROC 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 information

One problem > Multiple solutions; various ways of removing duplicates from dataset using SAS Jaya Dhillon, Louisiana State University

One problem > Multiple solutions; various ways of removing duplicates from dataset using SAS Jaya Dhillon, Louisiana State University One problem > Multiple solutions; various ways of removing duplicates from dataset using SAS Jaya Dhillon, Louisiana State University ABSTRACT In real world, analysts seldom come across data which is in

More information

Chapter 2 The Data Table. Chapter Table of Contents

Chapter 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 information

PROC SQL for SQL Die-hards Jessica Bennett, Advance America, Spartanburg, SC Barbara Ross, Flexshopper LLC, Boca Raton, FL

PROC 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 information

Andrew H. Karp Sierra Information Services, Inc. San Francisco, California USA

Andrew H. Karp Sierra Information Services, Inc. San Francisco, California USA Indexing and Compressing SAS Data Sets: How, Why, and Why Not Andrew H. Karp Sierra Information Services, Inc. San Francisco, California USA Many users of SAS System software, especially those working

More information

Paper 70-27 An Introduction to SAS PROC SQL Timothy J Harrington, Venturi Partners Consulting, Waukegan, Illinois

Paper 70-27 An Introduction to SAS PROC SQL Timothy J Harrington, Venturi Partners Consulting, Waukegan, Illinois Paper 70-27 An Introduction to SAS PROC SQL Timothy J Harrington, Venturi Partners Consulting, Waukegan, Illinois Abstract This paper introduces SAS users with at least a basic understanding of SAS data

More information

Christianna S. Williams, University of North Carolina at Chapel Hill, Chapel Hill, NC

Christianna S. Williams, University of North Carolina at Chapel Hill, Chapel Hill, NC Christianna S. Williams, University of North Carolina at Chapel Hill, Chapel Hill, NC ABSTRACT Have you used PROC MEANS or PROC SUMMARY and wished there was something intermediate between the NWAY option

More information

PharmaSUG 2015 - Paper QT26

PharmaSUG 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 information

Performing Queries Using PROC SQL (1)

Performing Queries Using PROC SQL (1) SAS SQL Contents Performing queries using PROC SQL Performing advanced queries using PROC SQL Combining tables horizontally using PROC SQL Combining tables vertically using PROC SQL 2 Performing Queries

More information

Introduction to Criteria-based Deduplication of Records, continued SESUG 2012

Introduction to Criteria-based Deduplication of Records, continued SESUG 2012 SESUG 2012 Paper CT-11 An Introduction to Criteria-based Deduplication of Records Elizabeth Heath RTI International, RTP, NC Priya Suresh RTI International, RTP, NC ABSTRACT When survey respondents are

More information

New 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 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 information

Transforming SAS Data Sets Using Arrays. Introduction

Transforming 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 information

Labels, Labels, and More Labels Stephanie R. Thompson, Rochester Institute of Technology, Rochester, NY

Labels, 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 information

Sage Abra SQL HRMS Reports. User Guide

Sage Abra SQL HRMS Reports. User Guide Sage Abra SQL HRMS Reports User Guide 2010 Sage Software, Inc. All rights reserved. Sage, the Sage logos, and the Sage product and service names mentioned herein are registered trademarks or trademarks

More information

BUSINESS DATA ANALYSIS WITH PIVOTTABLES

BUSINESS DATA ANALYSIS WITH PIVOTTABLES BUSINESS DATA ANALYSIS WITH PIVOTTABLES Jim Chen, Ph.D. Professor Norfolk State University 700 Park Avenue Norfolk, VA 23504 (757) 823-2564 jchen@nsu.edu BUSINESS DATA ANALYSIS WITH PIVOTTABLES INTRODUCTION

More information

Frequently Asked Questions About Using The GRE Search Service

Frequently Asked Questions About Using The GRE Search Service Frequently Asked Questions About Using The GRE Search Service General Information Who can use the GRE Search Service? Institutions eligible to participate in the GRE Search Service include (1) institutions

More information

Writing Code in SAS Enterprise Guide

Writing Code in SAS Enterprise Guide Writing Code in SAS Enterprise Guide Susan J. Slaughter, Avocet Solutions, Davis, CA Lora D. Delwiche, University of California, Davis, CA ABSTRACT If you are a SAS programmer who has avoided using SAS

More information

ONLINE EXTERNAL AND SURVEY STUDIES

ONLINE EXTERNAL AND SURVEY STUDIES ONLINE EXTERNAL AND SURVEY STUDIES Before reading this document, be sure you are already familiar with the Instructions for using the School of Psychological Sciences Participant Pool available on the

More information

Creating a Pivot Table

Creating a Pivot Table Creating a Pivot Table Basic information: A pivot table is an Excel function using any data set on a spreadsheet to provide a summary. The data should be in consecutive rows and have labels at the top

More information

Yes, No, Maybe So: Tips and Tricks for Using 0/1 Binary Variables Laurie Hamilton, Healthcare Management Solutions LLC, Columbia MD

Yes, No, Maybe So: Tips and Tricks for Using 0/1 Binary Variables Laurie Hamilton, Healthcare Management Solutions LLC, Columbia MD Yes, No, Maybe So: Tips and Tricks for Using 0/1 Binary Variables Laurie Hamilton, Healthcare Management Solutions LLC, Columbia MD ABSTRACT Many SAS programmers are familiar with the use of 0/1 binary

More information

Chapter 6 Working with SAS Data Sets

Chapter 6 Working with SAS Data Sets Chapter 6 Working with SAS Data Sets Chapter Table of Contents OVERVIEW... 79 OPENING A SAS DATA SET... 80 MAKING A SAS DATA SET CURRENT... 81 DISPLAYING SAS DATA SET INFORMATION... 82 REFERRING TO A SAS

More information

1. The 1095-C Excel spreadsheet template that Pro-Ware provides as a download from our website.

1. The 1095-C Excel spreadsheet template that Pro-Ware provides as a download from our website. Importing Data Importing Data - Overview The Import Data option is located in the File menu. The import option provides an alternative method of data input for your employees, employee's dependents, and

More information

Aileen L. Yam, PharmaNet, Inc., Princeton, NJ

Aileen L. Yam, PharmaNet, Inc., Princeton, NJ Paper 15-25 SAS SOFTWARE AND MICROSOFT OFFICE VISUAL BASIC FOR APPLICATIONS MAKE BEAUTIFUL REPORTS TOGETHER Aileen L. Yam, PharmaNet, Inc., Princeton, NJ ABSTRACT In pharmaceutical research, clinical study

More information

TC 2014 Hands on Presentation When Universes Collide: Table Joins in Tableau Guided PDF

TC 2014 Hands on Presentation When Universes Collide: Table Joins in Tableau Guided PDF TC 2014 Hands on Presentation When Universes Collide: Table Joins in Tableau Guided PDF Introduction - Anatomy of a Table Concepts and vocabulary used in this class Table - A set of values that is organized

More information

Chapter 32 Histograms and Bar Charts. Chapter Table of Contents VARIABLES...470 METHOD...471 OUTPUT...472 REFERENCES...474

Chapter 32 Histograms and Bar Charts. Chapter Table of Contents VARIABLES...470 METHOD...471 OUTPUT...472 REFERENCES...474 Chapter 32 Histograms and Bar Charts Chapter Table of Contents VARIABLES...470 METHOD...471 OUTPUT...472 REFERENCES...474 467 Part 3. Introduction 468 Chapter 32 Histograms and Bar Charts Bar charts are

More information

Enterprise Guide for Business Analysts Sunil Gupta, Gupta Programming, Simi Valley, CA

Enterprise Guide for Business Analysts Sunil Gupta, Gupta Programming, Simi Valley, CA Enterprise Guide for Business Analysts Sunil Gupta, Gupta Programming, Simi Valley, CA ABSTRACT Business Analysts will find that SAS s new Enterprise Guide makes it easier to perform data analysis and

More information

PROC PRINT - the Granddaddy of all Procedures, Enhanced and Still Going Strong! David Franklin, TheProgrammersCabin.com, Litchfield, NH

PROC PRINT - the Granddaddy of all Procedures, Enhanced and Still Going Strong! David Franklin, TheProgrammersCabin.com, Litchfield, NH PROC PRINT - the Granddaddy of all Procedures, Enhanced and Still Going Strong! David Franklin, TheProgrammersCabin.com, Litchfield, NH ABSTRACT The PRINT procedure, or PROC PRINT, has been around since

More information

Restricting and Sorting Data. Copyright 2006, Oracle. All rights reserved.

Restricting and Sorting Data. Copyright 2006, Oracle. All rights reserved. Restricting and Sorting Data Objectives After completing this lesson, you should be able to do the following: Limit the rows that are retrieved by a query Sort the rows that are retrieved by a query Use

More information

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

Data 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 information

IRA Pivot Table Review and Using Analyze to Modify Reports. For help, email Financial.Reports@dartmouth.edu

IRA Pivot Table Review and Using Analyze to Modify Reports. For help, email Financial.Reports@dartmouth.edu IRA Pivot Table Review and Using Analyze to Modify Reports 1 What is a Pivot Table? A pivot table takes rows of detailed data (such as the lines in a downloadable table) and summarizes them at a higher

More information

SAS BI Dashboard 3.1. User s Guide

SAS BI Dashboard 3.1. User s Guide SAS BI Dashboard 3.1 User s Guide The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2007. SAS BI Dashboard 3.1: User s Guide. Cary, NC: SAS Institute Inc. SAS BI Dashboard

More information

More 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 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 information

The SURVEYMEANS Procedure

The SURVEYMEANS Procedure SAS/STAT 9.2 User s Guide The SURVEYMEANS Procedure (Book Excerpt) SAS Documentation This document is an individual chapter from SAS/STAT 9.2 User s Guide. The correct bibliographic citation for the complete

More information

MWSUG Paper TS07

MWSUG Paper TS07 MWSUG 2011 - Paper TS07 Taming the Interactive SAS Environment: Tips and Tricks for VIEWTABLE, The Enhanced Editor and More Roger D. Muller, Ph.D., First Phase Consulting, Carmel, IN Joshua M. Horstman,

More information

Working with Excel spreadsheets using the SAS/ACCESS LIBNAME statement Gwen Babcock, New York State Department of Health, Albany, NY

Working with Excel spreadsheets using the SAS/ACCESS LIBNAME statement Gwen Babcock, New York State Department of Health, Albany, NY Working with Excel spreadsheets using the SAS/ACCESS LIBNAME statement Gwen Babcock, New York State Department of Health, Albany, NY ABSTRACT SAS programmers often receive data in a Microsoft Excel spreadsheet,

More information

PROC MEANS versus PROC SQL for Descriptive Statistics Generation of Weighted Data

PROC MEANS versus PROC SQL for Descriptive Statistics Generation of Weighted Data PROC MEANS versus PROC SQL for Descriptive Statistics Generation of Weighted Data Keiko I. Powers, Ph.D., J. D. Power and Associates, Westlake Village, CA ABSTRACT When sample representativeness is a key

More information

Intro 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 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 information

Trademarks: Yellowfin and the Yellowfin Logo are registered trademarks of Yellowfin International.

Trademarks: Yellowfin and the Yellowfin Logo are registered trademarks of Yellowfin International. Yellowfin Release 6.0 Tutorial Guide Under international copyright laws, neither the documentation nor the software may be copied, photocopied, reproduced, translated or reduced to any electronic medium

More information

An Approach to Creating Archives That Minimizes Storage Requirements

An Approach to Creating Archives That Minimizes Storage Requirements Paper SC-008 An Approach to Creating Archives That Minimizes Storage Requirements Ruben Chiflikyan, RTI International, Research Triangle Park, NC Mila Chiflikyan, RTI International, Research Triangle Park,

More information

Some Issues in Using PROC LOGISTIC for Binary Logistic Regression

Some Issues in Using PROC LOGISTIC for Binary Logistic Regression Some Issues in Using PROC LOGISTIC for Binary Logistic Regression by David C. Schlotzhauer Contents Abstract 1. The Effect of Response Level Ordering on Parameter Estimate Interpretation 2. Odds Ratios

More information

THE FUNDAMENTALS OF DATA STEP PROGRAMMING I: THE ESSENCE OF DATA STEP PROGRAMMING Arthur Li, City of Hope Comprehensive Cancer Center, Duarte, CA

THE FUNDAMENTALS OF DATA STEP PROGRAMMING I: THE ESSENCE OF DATA STEP PROGRAMMING Arthur Li, City of Hope Comprehensive Cancer Center, Duarte, CA THE FUNDAMENTALS OF DATA STEP PROGRAMMING I: THE ESSENCE OF DATA STEP PROGRAMMING Arthur Li, City of Hope Comprehensive Cancer Center, Duarte, CA 1.1. COMPILATION AND EXECUTION PHASES A DATA step is processed

More information

9.1 SAS. SQL Query Window. User s Guide

9.1 SAS. SQL Query Window. User s Guide SAS 9.1 SQL Query Window User s Guide The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2004. SAS 9.1 SQL Query Window User s Guide. Cary, NC: SAS Institute Inc. SAS

More information

The Query Builder: The Swiss Army Knife of SAS Enterprise Guide

The 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 information

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

Sample- for evaluation purposes only. Advanced Crystal Reports. TeachUcomp, Inc. A Presentation of TeachUcomp Incorporated. Copyright TeachUcomp, Inc. 2011 Advanced Crystal Reports TeachUcomp, Inc. it s all about you Copyright: Copyright 2011 by TeachUcomp, Inc. All rights reserved.

More information

Subsetting Observations from Large SAS Data Sets

Subsetting 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 information

A Closer Look at PROC SQL s FEEDBACK Option Kenneth W. Borowiak, PPD, Inc., Morrisville, NC

A Closer Look at PROC SQL s FEEDBACK Option Kenneth W. Borowiak, PPD, Inc., Morrisville, NC A Closer Look at PROC SQL s FEEDBACK Option Kenneth W. Borowiak, PPD, Inc., Morrisville, NC SESUG 2012 ABSTRACT The FEEDBACK option on the PROC SQL statement controls whether an expanded or transformed

More information

Paper 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 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 information

Managing Tables in Microsoft SQL Server using SAS

Managing 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 information

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

EXST 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 information

PROC MEANS: More than just your average procedure

PROC MEANS: More than just your average procedure Paper 68-25 PROC MEANS: More than just your average procedure Peter R. Welbrock Strategic Information Systems, Inc., Philadelphia, PA Abstract PROC MEANS and its close relative PROC SUMMARY have been two

More information

Internal User Guide. AECsoft USA, Inc 1776 Yorktown Ste 435 Houston, TX 77056 1-800-233-1121

Internal User Guide. AECsoft USA, Inc 1776 Yorktown Ste 435 Houston, TX 77056 1-800-233-1121 AECsoft USA, Inc 1776 Yorktown Ste 435 Houston, TX 77056 1-800-233-1121 Table of Contents Internal User Guide Outlook... 3 Supplier... 4 Search Supplier... 4 Simple Search... 4 Advanced Search... 4 Dynamic

More information

THE TERMS AND CONCEPTS

THE TERMS AND CONCEPTS Calculating Medication Compliance, Adherence, and Persistence in Administrative Pharmacy Claims Databases R. Scott Leslie, MedImpact Healthcare Systems, Inc., San Diego, CA ABSTRACT Compliance, adherence,

More information

Point-and-Click Style Editing in SAS Enterprise Guide

Point-and-Click Style Editing in SAS Enterprise Guide Paper 141-2007 Point-and-Click Style Editing in SAS Enterprise Guide Lora D. Delwiche, University of California, Davis, CA Susan J. Slaughter, Avocet Solutions, Davis, CA ABSTRACT SAS comes with a variety

More information

SAS/Data Integration Studio Creating and Using A Generated Transformation Jeff Dyson, Financial Risk Group, Cary, NC

SAS/Data Integration Studio Creating and Using A Generated Transformation Jeff Dyson, Financial Risk Group, Cary, NC Paper BB-05 SAS/Data Integration Studio Creating and Using A Generated Transformation Jeff Dyson, Financial Risk Group, Cary, NC ABSTRACT SAS/Data Integration Studio (DI Studio) transformations are packaged

More information

Same Data Different Attributes: Cloning Issues with Data Sets Brian Varney, Experis Business Analytics, Portage, MI

Same Data Different Attributes: Cloning Issues with Data Sets Brian Varney, Experis Business Analytics, Portage, MI Paper BtB-16 Same Data Different Attributes: Cloning Issues with Data Sets Brian Varney, Experis Business Analytics, Portage, MI SESUG 2013 ABSTRACT When dealing with data from multiple or unstructured

More information

Generic Automated Data Dictionary for Any SAS DATA Set or Format Library Dale Harrington, Kaiser Permanente, Oakland, CA

Generic Automated Data Dictionary for Any SAS DATA Set or Format Library Dale Harrington, Kaiser Permanente, Oakland, CA Generic Automated Data Dictionary for Any SAS DATA Set or Format Library Dale Harrington, Kaiser Permanente, Oakland, CA ABSTRACT This paper explains how to create an automated data dictionary which will

More information

Microsoft Access Basics

Microsoft Access Basics Microsoft Access Basics 2006 ipic Development Group, LLC Authored by James D Ballotti Microsoft, Access, Excel, Word, and Office are registered trademarks of the Microsoft Corporation Version 1 - Revision

More information

Access Queries (Office 2003)

Access Queries (Office 2003) Access Queries (Office 2003) Technical Support Services Office of Information Technology, West Virginia University OIT Help Desk 293-4444 x 1 oit.wvu.edu/support/training/classmat/db/ Instructor: Kathy

More information

Effectively Utilizing Loops and Arrays in the DATA Step

Effectively Utilizing Loops and Arrays in the DATA Step Paper HW08-2012 Effectively Utilizing Loops and Arrays in the DATA Step Arthur X. Li, City of Hope Comprehensive Cancer Center, Duarte, CA ABSTRACT The implicit loop refers to the DATA step repetitively

More information

What You re Missing About Missing Values

What 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 information

Reading Delimited Text Files into SAS 9 TS-673

Reading Delimited Text Files into SAS 9 TS-673 Reading Delimited Text Files into SAS 9 TS-673 Reading Delimited Text Files into SAS 9 i Reading Delimited Text Files into SAS 9 Table of Contents Introduction... 1 Options Available for Reading Delimited

More information

Statistics and Data Analysis

Statistics and Data Analysis NESUG 27 PRO LOGISTI: The Logistics ehind Interpreting ategorical Variable Effects Taylor Lewis, U.S. Office of Personnel Management, Washington, D STRT The goal of this paper is to demystify how SS models

More information

Horizon Debt Collect. User s and Administrator s Guide

Horizon Debt Collect. User s and Administrator s Guide Horizon Debt Collect User s and Administrator s Guide Microsoft, Windows, Windows NT, Windows 2000, Windows XP, and SQL Server are registered trademarks of Microsoft Corporation. Sybase is a registered

More information

Introduction to Matrix Algebra I

Introduction to Matrix Algebra I Appendix A Introduction to Matrix Algebra I Today we will begin the course with a discussion of matrix algebra. Why are we studying this? We will use matrix algebra to derive the linear regression model

More information

This book serves as a guide for those interested in using IBM

This book serves as a guide for those interested in using IBM 1 Overview This book serves as a guide for those interested in using IBM SPSS/PASW Statistics software to aid in statistical data analysis whether as a companion to a statistics or research methods course

More information

Combining SAS LIBNAME and VBA Macro to Import Excel file in an Intriguing, Efficient way Ajay Gupta, PPD Inc, Morrisville, NC

Combining 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 information

SQL Query & Modification

SQL Query & Modification CS145 Lecture Notes #7 SQL Query & Modification Introduction SQL Structured Query Language Pronounced S-Q-L or sequel The query language of every commercial RDBMS Evolution of SQL standard: SQL89 SQL92

More information

EXTRACTING DATA FROM PDF FILES

EXTRACTING DATA FROM PDF FILES Paper SER10_05 EXTRACTING DATA FROM PDF FILES Nat Wooding, Dominion Virginia Power, Richmond, Virginia ABSTRACT The Adobe Portable Document File (PDF) format has become a popular means of producing documents

More information

Tips, Tricks, and Techniques from the Experts

Tips, Tricks, and Techniques from the Experts Tips, Tricks, and Techniques from the Experts Presented by Katie Ronk 2997 Yarmouth Greenway Drive, Madison, WI 53711 Phone: (608) 278-9964 Web: www.sys-seminar.com Systems Seminar Consultants, Inc www.sys-seminar.com

More information

SAS Abbreviations Are Your Friends; Use a Template Method to Code! Elizabeth Ceranowski, SAS Institute Inc., Cary, NC

SAS Abbreviations Are Your Friends; Use a Template Method to Code! Elizabeth Ceranowski, SAS Institute Inc., Cary, NC Paper CC-18 SAS Abbreviations Are Your Friends; Use a Template Method to Code! Elizabeth Ceranowski, SAS Institute Inc., Cary, NC ABSTRACT Often, coders find themselves using the same procedures or sequence

More information

Text Analytics Illustrated with a Simple Data Set

Text Analytics Illustrated with a Simple Data Set CSC 594 Text Mining More on SAS Enterprise Miner Text Analytics Illustrated with a Simple Data Set This demonstration illustrates some text analytic results using a simple data set that is designed to

More information

Tales 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 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 information

Excel Database Management Microsoft Excel 2003

Excel Database Management Microsoft Excel 2003 Excel Database Management Microsoft Reference Guide University Technology Services Computer Training Copyright Notice Copyright 2003 EBook Publishing. All rights reserved. No part of this publication may

More information

Background. Figure 1. HyperRESEARCH 2.8 The User Interface the Case card and hyperlinks to text and multimedia data

Background. Figure 1. HyperRESEARCH 2.8 The User Interface the Case card and hyperlinks to text and multimedia data HyperRESEARCH V.2.8 Distinguishing features and functions This document is intended to be read in conjunction with the Choosing a CAQDAS Package Working Paper which provides a more general commentary of

More information

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

Programming 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 information

Top Ten Reasons to Use PROC SQL

Top Ten Reasons to Use PROC SQL Paper 042-29 Top Ten Reasons to Use PROC SQL Weiming Hu, Center for Health Research Kaiser Permanente, Portland, Oregon, USA ABSTRACT Among SAS users, it seems there are two groups of people, those who

More information