Chapter 2 (was Ch. 8) (September 21, 2008; 4:54 p.m.) Constructing a data set for analysis: reading, combining, managing and manipulating data sets

Size: px
Start display at page:

Download "Chapter 2 (was Ch. 8) (September 21, 2008; 4:54 p.m.) Constructing a data set for analysis: reading, combining, managing and manipulating data sets"

Transcription

1 Chapter 2 (was Ch. 8) (September 21, :54 p.m.) Constructing a data set for analysis: reading, combining, managing and manipulating data sets 2. Constructing a data set for analysis: reading, combining, managing and manipulating data sets 1. Temporary versus permanent status of data sets LIBNAME 2. Reading data into a SAS data set 2.1 Reading data directly as part of a program anyone for datalines? 2.2 Reading data sets that were saved as text infile can be your friend 2.3 Sometimes variables are in particular columns or in particular formats 2.4 Reading comma-separated values text files with, delimiters 2.5 Reading Excel spreadsheets directly 2.6 Reading SPSS data files the little (SPSS) engine that could 3. Writing out a file or constructing a simple report 4. Concatenating data sets/adding observations SET 5. Merging data sets/adding variables MERGE 6 Database processing with PROC SQL 7. Next steps and a summary Exercises 2.1. Temporary versus permanent status of data sets LIBNAME Display 2.1: Defining a library and referencing a data set within that library libname myfiles "\\muserver2\users\b\baileraj\public.www\classes\sta402\data" ods rtf bodytitle proc means data=myfiles.nitrofen maxdec=1 min q1 median q3 max class conc var total brood1 brood2 brood3 ods rtf close Display 2.2: Concentration-specific five-number summary for brood counts conc N Obs 0 10 total brood1 brood2 brood3 Minimum Lower Quartile Median Upper Quartile Maximum

2 Lower Upper conc N Obs Minimum Quartile Median Quartile Maximum total brood1 brood2 brood total brood1 brood2 brood total brood1 brood2 brood total brood1 brood2 brood Display 2.3: Example code that generates a temporary data set data junk do kk = 0 to 10 by 1 x = kk y = 3 + 2*kk + rannor(0) output end proc plot data=junk * or equivalently, data=work.junk plot y*x proc reg data=junk model y=x 2.2. Reading data into a SAS data set Common starting point for a statistical collaborator or consultant: meet with a colleague or client who is interested in securing assistance in exploring relationships among a collection of variables, testing for treatment differences, or other really fun stuff. Critical question: do you have your data in an electronic format? The answer to this question varies across disciplines. Colleagues from the biological and medical sciences and business often use Excel spreadsheets for data entry and to do primitive analyses. 2

3 Colleagues from the social sciences may be more likely to use SPSS or some other statistical package to do data set up and manipulation. File types: text only (*.txt) and comma-separated files (*.csv) Importing: via IMPORT WIZARD (SAS/ACCESS) or Example data set for illustrations: SMSA was part of the Data and Story Library (DASL) and include properties of 60 Standard Metropolitan Statistical Areas. The documentation and a copy of this data file can be downloaded from (accessed: 10 Sept. 2008). The U.S. Department of Labor Statistics was the referenced data source, and this data file was * characterized as having free use authorization. s: Each of the 60 SMSA has 17 variables recorded for it including: 1) city name 2) mean January temperature (deg. F) 3) mean July temperature (deg. F) 4) relative humidity 5) annual rainfall (in.) 6) age-adjusted mortality 7) median education 8) population density 9) percent of nonwhites 10) percent white collar workers 11) population 12) population per household 13) median income 14) hazardous chemical pollution potential 15) nitrous oxide pollution potential 16) sulfur dioxide pollution potential and 17) nitrous oxide. The first line of the data file includes variable names although for the illustration, the line with the variable names has been removed Reading data directly as part of a program anyone for datalines? Display 2.4: Reading free format data into SAS using datalines (code that doesn t work correctly) Data SMSA_subset input city $ JanTemp JulyTemp RelHum Rain Mortality Education PopDensity pct_nonwhite pct_wc pop pop_per_house income HCPot NOxPot S02Pot NOx datalines Akron, OH Albany-Schenectady-Troy, NY Allentown, Bethlehem, PA-NJ Atlanta, GA

4 Baltimore, MD ods rtf bodytitle proc print data=smsa_subset var city JanTemp JulyTemp RelHum NOxPot S02Pot NOx ods rtf close Did this work? Display 2.5: PROC PRINT of the misread subset of SMSA observations Obs City JanTemp JulyTemp RelHum NOxPot S02Pot NOx 1 Akron, Albany-S Allentow Atlanta, Baltimor SAS Log (slightly edited) error message associated with processing the first observation is NOTE: Invalid data for JanTemp in line RULE: Akron, OH city=akron, JanTemp=. JulyTemp=27 RelHum=71 Rain=59 Mortality=36 Education= PopDensity=11.4 pct_nonwhite=3243 pct_wc=8.8 pop=42.6 pop_per_house= income=3.34 HCPot=29560 NOxPot=21 S02Pot=15 NOx=59 _ERROR_=1 _N_=1 Display 2.6: Reading the SMSA data with a length declaration and code to allow embedded blanks in the value of a character value. data SMSA_subset length city $ 27 input city & JanTemp JulyTemp RelHum Rain Mortality Education PopDensity pct_nonwhite pct_wc pop pop_per_house income HCPot NOxPot S02Pot NOx datalines Akron, OH Albany-Schenectady-Troy, NY Allentown, Bethlehem, PA-NJ Atlanta, GA Baltimore, MD

5 ods rtf bodytitle proc print data=smsa_subset var city JanTemp JulyTemp RelHum NOxPot S02Pot NOx ods rtf close Display 2.7: PROC PRINT output from the correctly read subset of the SMSA observations Obs City JanTemp JulyTemp RelHum NOxPot S02Pot NOx 1 Akron, OH Albany-Schenectady- Troy, NY 3 Allentown, Bethlehem, PA-NJ Atlanta, GA Baltimore, MD Reading data sets that were saved as text infile can be your friend /* Notes: 1) Two spaces separate each entry in the input data file. A global replace of tabs with two spaces was performed before saving the text file. 2) The first line contains the names of the variables, and the data begins on the 2nd line of the file. 3) Fort Worth had missing values for POP and INCOME and "." were entered in the data file. 4) Increased LENGTH to 39 to accomodate GREENSBORO-WINSTON-SALEM... */ options nodate nocenter data SMSA_from_txt infile "C:\Users\baileraj\Desktop\SMSA-DASL-2space-sep.txt" firstobs=2 length city $ 39 input city & JanTemp JulyTemp RelHum Rain Mortality Education PopDensity pct_nonwhite pct_wc pop pop_per_house income HCPot NOxPot S02Pot NOx ods rtf bodytitle proc print data=smsa_from_txt var city JanTemp JulyTemp RelHum NOxPot S02Pot NOx ods rtf close Display 2.9: Output from PROC PRINT of the SMSA subset read using infile Obs City JanTemp JulyTemp RelHum NOxPot S02Pot NOx 1 Akron, OH Albany-Schenectady-Troy, NY

6 Obs City JanTemp JulyTemp RelHum NOxPot S02Pot NOx 59 York, PA Youngstown-Warren, OH Sometimes variables are in particular columns or in particular formats data d1 infile 'M:\public.www\classes\sta402\SAS-programs\ch2-dat.txt' firstobs=16 expandtabs missover pad animal conc brood1 brood2 brood3 total 2. firstobs=16 declares that SAS should ignore the first 15 lines of the data file remaining options - expandtabs missover pad expands any tab characters to a standard tab spacing of 8 columns, assign missing values to variables that were not defined on the input line (not as critical here as compared to reading free-formatted data with missing values at the end of a line), and pads the datalines to be of the same length Reading comma-separated values text files with, delimiters DASL-SMSA-commasep.csv =A copy of the SMSA data set was constructed to have comma-separated values first row "Akron, OH",27,71,59,36,921.87,11.4,3243,8.8,42.6,660328,3.34,29560,21,15,59,15 DSD (delimiter sensitive data) option in an infile statement is needed for reading such data. Display 2.10: Reading input data from files using commas as delimiters between variable values options nodate nocenter data SMSA_from_CSV infile "C:\Users\baileraj\Desktop\DASL-SMSA-commasep.csv" firstobs=2 dsd length city $ 39 input city & JanTemp JulyTemp RelHum Rain Mortality Education PopDensity pct_nonwhite pct_wc pop pop_per_house income HCPot NOxPot S02Pot NOx ods rtf bodytitle proc print data=smsa_from_csv (firstobs=17 obs=25) var city JanTemp JulyTemp RelHum pop pop_per_house income ods rtf close Display 2.11: Observations 17 to 25 from the SMSA data file 6

7 Obs City JanTemp JulyTemp RelHum pop pop_per _house income 17 Dayton-Springfield, OH Denver, CO Detroit, MI Flint, MI Fort Worth, TX Grand Rapids, MI Greensboro-Winston-Salem-High Point, NC Hartford, CT Houston, TX Reading Excel spreadsheets directly Display 2.12: Importing an Excel spreadsheet using IMPORT or the Excel engine with a LIBNAME /* Assumes SAS/ACCESS engines are available */ /* IMPORT code produced by the IMPORT WIZARD */ PROC IMPORT OUT= WORK.DASL_FROM_EXCEL2 DATAFILE= "C:\Documents and Settings\baileraj\Desktop\DASL-SMSA.xls" DBMS=EXCEL REPLACE SHEET="Sheet1$" GETNAMES=YES MIXED=NO SCANTEXT=YES USEDATE=YES SCANTIME=YES RUN /* via EXCEL engine with LIBNAME */ options nodate title libname spreads excel "C:\Documents and Settings\baileraj\Desktop\DASL-SMSA.xls" header=yes ods rtf bodytitle /* list the contents of the spreadsheet that was read */ proc contents data=spreads._all_ varnum /* set contents of the 1st worksheet to SAS data set */ data DASL_from_Libname_Excel_engine set spreads.'sheet1$'n proc print data=dasl_from_libname_excel_engine 7

8 ods rtf close Display 2.13: Contents of the SAS library produced when referencing an Excel spreadsheet using a LIBNAME with an Excel engine. Directory Libref Engine Physical Name Schema/Owner SPREADS EXCEL C:\Documents and Settings\baileraj\Desktop\DASL-SMSA.xls Admin # Name Member Type DBMS Member Type 1 Sheet1$ DATA TABLE 2 Sheet2$ DATA TABLE 3 Sheet3$ DATA TABLE Data Set Name SPREADS.'Sheet1$'n Observations. Member Type DATA s 17 Engine EXCEL Indexes 0 Created. Observation Length 0 Last Modified. Deleted Observations 0 Protection Compressed NO Data Set Type Sorted NO Label Data Representation Encoding Default Default 8

9 s in Creation Order # Type Len Format Informat Label 1 City Char 39 $39. $39. city 2 JanTemp Num 8 JanTemp 3 JulyTemp Num 8 JulyTemp 4 RelHum Num 8 RelHum 5 Rain Num 8 Rain 6 Mortality Num 8 Mortality 7 Education Num 8 Education 8 PopDensity Num 8 PopDensity 9 _NonWhite Num 8 %NonWhite 10 _WC Num 8 %WC 11 Pop Num 8 pop 12 Pop_house Num 8 pop/house 13 income Num 8 income 14 HCPot Num 8 HCPot 15 NOxPot Num 8 NOxPot 16 S02Pot Num 8 S02Pot 17 NOx Num 8 NOx Reading SPSS data files the little (SPSS) engine that could The PROC IMPORT procedure described above can be applied to read an SPSS data set using a DBMS=SPSS option or by specifying a LIBNAME with an SPSS engine. 2.3 Writing out a file or making a simple report Display 2.14: Echoing the values of variables in a data set using a PUT statement libname myfiles "\\muserver2\users\b\baileraj\public.www\classes\sta402\data" data _null_ set myfiles.nitrofen put 18*'----' put _all_ /* useful to check values during input */ 9

10 Display 2.15: SAS LOG with the echo of the nitrofen variable values animal=1 conc=0 brood1=3 brood2=14 brood3=10 total=27 _ERROR_=0 _N_= animal=2 conc=0 brood1=5 brood2=12 brood3=15 total=32 _ERROR_=0 _N_= animal=3 conc=0 brood1=6 brood2=11 brood3=17 total=34 _ERROR_=0 _N_=3... animal=48 conc=310 brood1=4 brood2=0 brood3=0 total=4 _ERROR_=0 _N_= animal=49 conc=310 brood1=6 brood2=0 brood3=0 total=6 _ERROR_=0 _N_= animal=50 conc=310 brood1=5 brood2=0 brood3=0 total=5 _ERROR_=0 _N_=50 Display 2.16: Producing a formatted report with an annotated print out of the nitrofen data libname myfiles "\\muserver2\users\b\baileraj\public.www\classes\sta402\data" proc sort data=myfiles.nitrofen by conc data _NULL_ set myfiles.nitrofen by conc file 'C:\Users\baileraj\Desktop\nitrofen-put.txt' /* Write out header text information for the first observation in each conc*/ if FIRST.conc then do put 6*'+-----' '+' put 'Conc = ' conc 'Brood 'Brood 'Brood 'TOTAL' '-----' end /* Write out the data for all records */ brood1 brood2 brood3 total 3. data _NULL_ /* add last line to the output file */ file 'C:\Users\baileraj\Desktop\nitrofen-put.txt' MOD put 6*'+-----' '+' // 'Data from C. dubia Nitrofen exposure data [ & Oris 1993]' Display 2.17: Contents of the nitrofen-put.txt file constructed by PUT Conc = 0 Brood 1 Brood 2 Brood 3 TOTAL

11 lines deleted Conc = 310 Brood 1 Brood 2 Brood 3 TOTAL Data from C. dubia Nitrofen exposure data [ & Oris 1993] Display 2.18: Creating external data files containing the contents of a SAS data set libname myfiles "\\muserver2\users\b\baileraj\public.www\classes\sta402\data" /* create a TEXT file with the nitrofen data */ data _NULL_ set myfiles.nitrofen file 'C:\Users\baileraj\Desktop\nitrofen-TEXT.txt' total /* create a CSV file with the nitrofen data */ data _NULL_ set myfiles.nitrofen file 'C:\Users\baileraj\Desktop\nitrofen-CSV.csv' dsd put conc animal brood1 brood2 brood3 total /* create a CSV file with the nitrofen data and a row with variable names */ data _NULL_ file 'C:\Users\baileraj\Desktop\nitrofen-CSV2.csv' dsd put "conc,animal,brood1,brood2,brood3,total" data _NULL_ set myfiles.nitrofen file 'C:\Users\baileraj\Desktop\nitrofen-CSV2.csv' dsd MOD put conc animal brood1 brood2 brood3 total Display 2.19: First 4 lines from the 3 data files constructed using PUT statements nitrofen-text.txt

12 0,1,3,14,10,27 0,2,5,12,15,32 0,3,6,11,17,34 0,4,6,12,15,33 nitrofen-csv.csv nitrofen-csv2.csv conc,animal,brood1,brood2,brood3,total 0,1,3,14,10,27 0,2,5,12,15,32 0,3,6,11,17, Concatenating data sets/adding observations SET Display 2.20: Adding observations / "rows" concatenating data sets Observation ID CONCATENATED WITH Observation ID PRODUCES Observation ID

13 Display 2.21: Combining observations for 5 separate concentration-specific data sets into a single analysis data set data conc_0 input conc = 0 * define a variable containing the value of the nitrofen conc. datalines data conc_80 input conc = 80 * define a variable containing the value of the nitrofen conc. datalines data conc_160 input conc = 160 * define a variable containing the value of the nitrofen conc. datalines data conc_235 input conc = 235 * define a variable containing the value of the nitrofen conc. datalines data conc_310 input conc = 310 * define a variable containing the value of the nitrofen conc. datalines data set_all5 set conc_0 conc_80 conc_160 conc_235 conc_310 ods rtf bodytitle proc print data=set_all5 var conc total ods rtf close Display 2.22: Combined data set formed from concatenating the 5 concentration-specific data sets Obs conc total 13

14 Obs conc total Merging data sets/adding variables MERGE Display 2.23: Adding variables / "columns" merging data sets Observation ID MERGED WITH Observation ID

15 PRODUCES Observation ID Display 2.24: Merging using DATA step programming data SMSA_subset_weather length city $ 27 input city & JanTemp JulyTemp RelHum Rain datalines Akron, OH Albany-Schenectady-Troy, NY Baltimore, MD Allentown, Bethlehem, PA-NJ Atlanta, GA data SMSA_subset_demog length city $ 27 input city & Mortality Education PopDensity pct_nonwhite pct_wc pop pop_per_house income datalines Akron, OH Albany-Schenectady-Troy, NY Baltimore, MD Allentown, Bethlehem, PA-NJ Atlanta, GA data SMSA_subset_pollution length city $ 27 input city & HCPot NOxPot S02Pot NOx datalines Akron, OH Albany-Schenectady-Troy, NY Baltimore, MD Allentown, Bethlehem, PA-NJ Atlanta, GA proc sort data=smsa_subset_weather by city proc sort data=smsa_subset_demog by city proc sort data=smsa_subset_pollution by city 15

16 data all_subset merge SMSA_subset_weather SMSA_subset_demog SMSA_subset_pollution by city ods rtf bodytitle proc print data=all_subset var city JanTemp mortality NOx ods rtf close Display 2.25: Resulting common SMSA data file after the merging Obs city JanTemp Mortality NOx 1 Akron, OH Albany-Schenectady-Troy, NY Allentown, Bethlehem, PA-NJ Atlanta, GA Baltimore, MD Database processing with PROC SQL The big idea is that PROC SQL looks at data sets as tables that can be manipulated, processed and displayed as a result of command queries. The basic syntax, excerpted from the SAS help documents, includes: PROC SQL CREATE TABLE name SELECT variables FROM list-of-tables/dataset GROUP BY /* optional */ HAVING /* optional */ Display 2.26: Requesting that a simple SQL table be constructed from a SAS data set containing the highest nitrofen concentration data data conc_310 input conc = 310 * define a variable containing the value of the nitrofen conc. datalines ods rtf bodytitle proc sql select conc,total from conc_310 ods rtf close 16

17 Display 2.27: Table with the total number of young produced in the highest nitrofen concentration condition conc total The real power of PROC SQL begins to surface as you manipulate table relations. For example, we concatentate the 5 nitrofen concentration data sets using a union of tables operation in Display In the PROC SQL command, we construct a SAS data set all_sql as a result of the line create table all_sql as and select all variables from each data set as part of the select * from conc_0 command (the * is a wildcard representing the selection of all variables. The union option stacks the table into a resultant table while order by conc,id sorts the values by id within conc. Display 2.28: Containing data sets using union of tables in PROC SQL data conc_0 input conc = 0 * define a variable containing the value of the nitrofen conc. id=_n_ * define an animal ID corresponding the observation number datalines data conc_80 input conc = 80 * define a variable containing the value of the nitrofen conc. id=_n_ * define an animal ID corresponding the observation number datalines data conc_160 input 17

18 conc = 160* define a variable containing the value of the nitrofen conc. id=_n_ * define an animal ID corresponding the observation number datalines data conc_235 input conc = 235* define a variable containing the value of the nitrofen conc. id=_n_ * define an animal ID corresponding the observation number datalines data conc_310 input conc = 310* define a variable containing the value of the nitrofen conc. id=_n_ * define an animal ID corresponding the observation number datalines proc sql create table all_sql as select * from conc_0 union select * from conc_80 union select * from conc_160 union select * from conc_235 union select * from conc_310 order by conc,id ods rtf bodytitle proc print data=all_sql ods rtf close Display 2.29: Result of combining 5 nitrofen concentration-specific data sets / tables into a single data file using PROC SQL Obs total conc Id Display 2.30: An inner join/merge of the 3 SMSA subset data sets using PROC SQL 18

19 data SMSA_subset_weather length city $ 27 input city & JanTemp JulyTemp RelHum Rain datalines Akron, OH Albany-Schenectady-Troy, NY Baltimore, MD Allentown, Bethlehem, PA-NJ Atlanta, GA data SMSA_subset_demog length city $ 27 input city & Mortality Education PopDensity pct_nonwhite pct_wc pop pop_per_house income datalines Akron, OH Albany-Schenectady-Troy, NY Baltimore, MD Allentown, Bethlehem, PA-NJ Atlanta, GA data SMSA_subset_pollution length city $ 27 input city & HCPot NOxPot S02Pot NOx datalines Akron, OH Albany-Schenectady-Troy, NY Baltimore, MD Allentown, Bethlehem, PA-NJ Atlanta, GA proc sql create table SMSA_subset_sql as select * from SMSA_subset_weather w, SMSA_subset_demog d, SMSA_subset_pollution p where w.city=d.city and d.city=p.city ods rtf bodytitle proc print data=smsa_subset_sql var city JulyTemp education S02Pot ods rtf close Display 2.31: Table / data set produced by the inner join of the 3 SMSA subset data sets. Obs City JulyTemp Education S02Pot 1 Akron, OH Albany-Schenectady-Troy, NY Baltimore, MD

20 Obs City JulyTemp Education S02Pot 4 Allentown, Bethlehem, PA-NJ Atlanta, GA Display 2.32: Illustrating Left/Right/Full outer joins with a subset of the SMSA observations data SMSA_subset_weather2 length city $ 27 input city & JanTemp JulyTemp RelHum Rain datalines Akron, OH Baltimore, MD Allentown, Bethlehem, PA-NJ Atlanta, GA data SMSA_subset_demog2 length city $ 27 input city & Mortality Education PopDensity pct_nonwhite pct_wc pop pop_per_house income datalines Akron, OH Albany-Schenectady-Troy, NY Baltimore, MD Allentown, Bethlehem, PA-NJ ods rtf bodytitle /* inner join / conventional join */ proc sql title "inner join" select w.city,jantemp,julytemp,education,income from SMSA_subset_weather2 as w,smsa_subset_demog2 as d where w.city=d.city /* LEFT outer join - with duplicate columns */ proc sql title "LEFT outer join with duplicate columns" select * from SMSA_subset_weather2 as w left join SMSA_subset_demog2 as d on w.city=d.city /* LEFT outer join - eliminating duplicate columns using COALESCE */ proc sql title "LEFT outer join eliminating duplicate columns" select coalesce(w.city, d.city),jantemp,julytemp,education,income from SMSA_subset_weather2 as w left join SMSA_subset_demog2 as d on w.city=d.city 20

21 /* RIGHT outer join */ proc sql title "RIGHT outer join" select coalesce(w.city, d.city),jantemp,julytemp,education,income from SMSA_subset_weather2 as w right join SMSA_subset_demog2 as d on w.city=d.city /* FULL outer join */ proc sql title "FULL outer join" select coalesce(w.city, d.city),jantemp,julytemp,education,income from SMSA_subset_weather2 as w full join SMSA_subset_demog2 as d on w.city=d.city ods rtf close Display 2.33: Results from inner and left/right/full outer joins inner join City JanTemp JulyTemp Education Income Akron, OH Baltimore, MD Allentown, Bethlehem, PA-NJ LEFT outer join with duplicate columns (edited with particular columns deleted) City JanTemp JulyTemp Rain city Mortality Education income Akron, OH Akron, OH Allentown, Bethlehem, PA-NJ Atlanta, GA Baltimore, MD Allentown, Bethlehem, PA-NJ Baltimore, MD LEFT outer join eliminating duplicate columns

22 JanTemp JulyTemp Education income Akron, OH Allentown, Bethlehem, PA-NJ Atlanta, GA Baltimore, MD RIGHT outer join JanTemp JulyTemp Education income Akron, OH Albany-Schenectady-Troy, NY Allentown, Bethlehem, PA-NJ Baltimore, MD FULL outer join JanTemp JulyTemp Education income Akron, OH Albany-Schenectady-Troy, NY Allentown, Bethlehem, PA-NJ Atlanta, GA Baltimore, MD Display 2.34: Constructing the sample space based on tossing a coin and rolling a die. data coin_toss toss="heads" output toss="tails" output data die_roll face=1 output face=2 output face=3 output face=4 output face=5 output face=6 output proc sql create table roll_n_toss as select * from coin_toss,die_roll ods rtf bodytitle 22

23 proc print data=roll_n_toss ods rtf close Display 2.35: Data set constructed from the joining all rows from two tables Obs Toss face 1 Heads 1 2 Heads 2 3 Heads 3 4 Heads 4 5 Heads 5 6 Heads 6 7 Tails 1 8 Tails 2 9 Tails 3 10 Tails 4 11 Tails 5 12 Tails Next steps and a summary The chapter started with an emphasis on getting data into SAS from various sources and then moved into strategies for modifying data sets to add observations or variables. We introduced the SQL procedure for doing many of these manipulations from the perspective of manipulating tables using a structured query language. Consistent with the title of this book (the stat programming part), the goal of these manipulations was to produce a data set for analysis. Believe it or not: there are a few more topics associated with processing data in SAS that you might need to master. For example, we used the special variable FIRST.CONC in PUT illustrations. There are a number of other special internal variables such as those associated with sorting FIRST/ LAST and variables associated with variables being present in a data set such 23

24 as IN. There are a number of other procedures available for updating (PROC UPDATE), managing data sets efficiently (PROC COPY, PROC DATASETS), or reshaping datasets (PROC TRANSPOSE) and you are encouraged to explore these. Finally, the transporting of data sets between systems and software packages are facilitated by use of (PROC IMPORT, PROC EXPORT) while the movement of SAS catalogs between systems is facilitated by the use of (PROC CPORT, PROC CIMPORT). You are encouraged to dive into the help pages and other SAS resources to skim the overview and descriptions of these topics. Exercises 1. Generate a customized print out of the meat data from Ch. 5 (using PUT statements in a SAS data set). The report should look like Packaging Condition = Plastic Data Mean Std. Dev x.xx x.xx Packaging Condition = Vacuum Data Mean Std. Dev x.xx x.xx etc. raw data... logcount condition 7.66 Plastic 6.98 Plastic 7.80 Plastic 5.26 Vacuum 5.44 Vacuum 5.80 Vacuum 7.41 Mixed 7.33 Mixed 7.04 Mixed 3.51 Co Co2 24

25 3.66 Co2 2. Fifty animals were exposed to one of 5 concentration levels of nitrofen (10 animals per group but some observations may be missing in the data below). The data were recorded separately for three broods. Produce a combined data set containing observations that have data on all 3 broods. In addition, construct an additional variable corresponding to the total number of young produced in all three broods. Compare different joins for these data. Print out the results for the different combined data sets. Note that multiple observations are given on each line. Brood=1 data s: ID conc number of young Brood=2 data s: ID conc number of young Brood=3 data s: ID conc number of young

26

INTRODUCTION TO SAS HOW SAS WORKS READING RAW DATA INTO SAS

INTRODUCTION TO SAS HOW SAS WORKS READING RAW DATA INTO SAS TO SAS NEED FOR SAS WHO USES SAS WHAT IS SAS? OVERVIEW OF BASE SAS SOFTWARE DATA MANAGEMENT FACILITY STRUCTURE OF SAS DATASET SAS PROGRAM PROGRAMMING LANGUAGE ELEMENTS OF THE SAS LANGUAGE RULES FOR SAS

More information

Chapter 2: Getting Data Into SAS

Chapter 2: Getting Data Into SAS Chapter 2: Getting Data Into SAS Data stored in many different forms/formats. Four categories of ways to read in data. 1. Entering data directly through keyboard 2. Creating SAS data sets from raw data

More information

Stat 302 Statistical Software and Its Applications SAS: Data I/O

Stat 302 Statistical Software and Its Applications SAS: Data I/O Stat 302 Statistical Software and Its Applications SAS: Data I/O Yen-Chi Chen Department of Statistics, University of Washington Autumn 2016 1 / 33 Getting Data Files Get the following data sets from the

More information

SAS Online Training: Course contents: Agenda:

SAS Online Training: Course contents: Agenda: SAS Online Training: Course contents: Agenda: (1) Base SAS (6) Clinical SAS Online Training with Real time Projects (2) Advance SAS (7) Financial SAS Training Real time Projects (3) SQL (8) CV preparation

More information

Base and Advance SAS

Base and Advance SAS Base and Advance SAS BASE SAS INTRODUCTION An Overview of the SAS System SAS Tasks Output produced by the SAS System SAS Tools (SAS Program - Data step and Proc step) A sample SAS program Exploring SAS

More information

DSCI 325: Handout 2 Getting Data into SAS Spring 2017

DSCI 325: Handout 2 Getting Data into SAS Spring 2017 DSCI 325: Handout 2 Getting Data into SAS Spring 2017 Data sets come in many different formats. In some situations, data sets are stored on paper (e.g., surveys) and other times data are stored in huge

More information

BASICS BEFORE STARTING SAS DATAWAREHOSING Concepts What is ETL ETL Concepts What is OLAP SAS. What is SAS History of SAS Modules available SAS

BASICS BEFORE STARTING SAS DATAWAREHOSING Concepts What is ETL ETL Concepts What is OLAP SAS. What is SAS History of SAS Modules available SAS SAS COURSE CONTENT Course Duration - 40hrs BASICS BEFORE STARTING SAS DATAWAREHOSING Concepts What is ETL ETL Concepts What is OLAP SAS What is SAS History of SAS Modules available SAS GETTING STARTED

More information

Stat 302 Statistical Software and Its Applications SAS: Data I/O & Descriptive Statistics

Stat 302 Statistical Software and Its Applications SAS: Data I/O & Descriptive Statistics Stat 302 Statistical Software and Its Applications SAS: Data I/O & Descriptive Statistics Fritz Scholz Department of Statistics, University of Washington Winter Quarter 2015 February 19, 2015 2 Getting

More information

SAS 101. Based on Learning SAS by Example: A Programmer s Guide Chapter 21, 22, & 23. By Tasha Chapman, Oregon Health Authority

SAS 101. Based on Learning SAS by Example: A Programmer s Guide Chapter 21, 22, & 23. By Tasha Chapman, Oregon Health Authority SAS 101 Based on Learning SAS by Example: A Programmer s Guide Chapter 21, 22, & 23 By Tasha Chapman, Oregon Health Authority Topics covered All the leftovers! Infile options Missover LRECL=/Pad/Truncover

More information

Accessing Data and Creating Data Structures. SAS Global Certification Webinar Series

Accessing Data and Creating Data Structures. SAS Global Certification Webinar Series Accessing Data and Creating Data Structures SAS Global Certification Webinar Series Accessing Data and Creating Data Structures Becky Gray Certification Exam Developer SAS Global Certification Michele

More information

SAS CURRICULUM. BASE SAS Introduction

SAS CURRICULUM. BASE SAS Introduction SAS CURRICULUM BASE SAS Introduction Data Warehousing Concepts What is a Data Warehouse? What is a Data Mart? What is the difference between Relational Databases and the Data in Data Warehouse (OLTP versus

More information

SAS PROGRAMMING AND APPLICATIONS (STAT 5110/6110): FALL 2015 Module 2

SAS PROGRAMMING AND APPLICATIONS (STAT 5110/6110): FALL 2015 Module 2 SAS PROGRAMMING AND APPLICATIONS (STAT 5110/6110): FALL 2015 Department of MathemaGcs and StaGsGcs Phone: 4-3620 Office: Parker 364- A E- mail: carpedm@auburn.edu Web: hup://www.auburn.edu/~carpedm/stat6110

More information

Introductory SAS example

Introductory SAS example Introductory SAS example STAT:5201 1 Introduction SAS is a command-driven statistical package; you enter statements in SAS s language, submit them to SAS, and get output. A fairly friendly user interface

More information

SAS Graphics & Code. stat 480 Heike Hofmann

SAS Graphics & Code. stat 480 Heike Hofmann SAS Graphics & Code stat 480 Heike Hofmann Outline Data Exploration in SAS Data Management Subsetting Graphics Code in SAS Your turn Download FBI crime data fbi-crime-60-11.csv from the website, open in

More information

Exchanging data between SAS and Microsoft Excel

Exchanging data between SAS and Microsoft Excel Paper CC 011 Exchanging data between SAS and Microsoft Excel Yuqing Xiao, Southern Company, Atlanta, GA ABSTRACT Transferring data between SAS and Microsoft Excel has gained popularity over the years.

More information

Moving Data and Results Between SAS and Excel. Harry Droogendyk Stratia Consulting Inc.

Moving Data and Results Between SAS and Excel. Harry Droogendyk Stratia Consulting Inc. Moving Data and Results Between SAS and Excel Harry Droogendyk Stratia Consulting Inc. Introduction SAS can read ( and write ) anything Introduction In the end users want EVERYTHING in. Introduction SAS

More information

AURA ACADEMY SAS TRAINING. Opposite Hanuman Temple, Srinivasa Nagar East, Ameerpet,Hyderabad Page 1

AURA ACADEMY SAS TRAINING. Opposite Hanuman Temple, Srinivasa Nagar East, Ameerpet,Hyderabad Page 1 SAS TRAINING SAS/BASE BASIC THEORY & RULES ETC SAS WINDOWING ENVIRONMENT CREATION OF LIBRARIES SAS PROGRAMMING (BRIEFLY) - DATASTEP - PROC STEP WAYS TO READ DATA INTO SAS BACK END PROCESS OF DATASTEP INSTALLATION

More information

BUSINESS ANALYTICS. 96 HOURS Practical Learning. DexLab Certified. Training Module. Gurgaon (Head Office)

BUSINESS ANALYTICS. 96 HOURS Practical Learning. DexLab Certified. Training Module. Gurgaon (Head Office) SAS (Base & Advanced) Analytics & Predictive Modeling Tableau BI 96 HOURS Practical Learning WEEKDAY & WEEKEND BATCHES CLASSROOM & LIVE ONLINE DexLab Certified BUSINESS ANALYTICS Training Module Gurgaon

More information

An Introduction to SAS University Edition

An Introduction to SAS University Edition An Introduction to SAS University Edition Ron Cody From An Introduction to SAS University Edition. Full book available for purchase here. Contents List of Programs... xi About This Book... xvii About the

More information

Microsoft Access Illustrated. Unit B: Building and Using Queries

Microsoft Access Illustrated. Unit B: Building and Using Queries Microsoft Access 2010- Illustrated Unit B: Building and Using Queries Objectives Use the Query Wizard Work with data in a query Use Query Design View Sort and find data (continued) Microsoft Office 2010-Illustrated

More information

The housing crisis. Data challenges and opportunities. Hadley Wickham, Garret Grolemund, Dex Gannon, Gabi Quart, Barret Schloekre

The housing crisis. Data challenges and opportunities. Hadley Wickham, Garret Grolemund, Dex Gannon, Gabi Quart, Barret Schloekre The housing crisis Data challenges and opportunities Hadley Wickham, Garret Grolemund, Dex Gannon, Gabi Quart, Barret Schloekre Disclaimer Some statistics, but more of a focus on the data. What you need

More information

Other Data Sources SAS can read data from a variety of sources:

Other Data Sources SAS can read data from a variety of sources: Other Data Sources SAS can read data from a variety of sources: Plain text files, including delimited and fixed-column files Spreadsheets, such as Excel Databases XML Others Text Files Text files of various

More information

Dictionary.coumns is your friend while appending or moving data

Dictionary.coumns is your friend while appending or moving data ABSTRACT SESUG Paper CC-41-2017 Dictionary.coumns is your friend while appending or moving data Kiran Venna, Dataspace Inc. Dictionary.columns is a dictionary table, which gives metadata information of

More information

data Vote; /* Read a CSV file */ infile 'c:\users\yuen\documents\6250\homework\hw1\political.csv' dsd; input state $ Party $ Age; run;

data Vote; /* Read a CSV file */ infile 'c:\users\yuen\documents\6250\homework\hw1\political.csv' dsd; input state $ Party $ Age; run; Chapter 3 2. data Vote; /* Read a CSV file */ infile 'c:\users\yuen\documents\6250\homework\hw1\political.csv' dsd; input state $ Party $ Age; title "Listing of Vote data set"; /* compute frequencies for

More information

Taming a Spreadsheet Importation Monster

Taming a Spreadsheet Importation Monster SESUG 2013 Paper BtB-10 Taming a Spreadsheet Importation Monster Nat Wooding, J. Sargeant Reynolds Community College ABSTRACT As many programmers have learned to their chagrin, it can be easy to read Excel

More information

SAS Training BASE SAS CONCEPTS BASE SAS:

SAS Training BASE SAS CONCEPTS BASE SAS: SAS Training BASE SAS CONCEPTS BASE SAS: Dataset concept and creating a dataset from internal data Capturing data from external files (txt, CSV and tab) Capturing Non-Standard data (date, time and amounts)

More information

TIPS FROM THE TRENCHES

TIPS FROM THE TRENCHES TIPS FROM THE TRENCHES Christopher Bost MDRC SAS Users Group October 1, 2008 Recent user questions 2 How can I print long character values? How can I EXPORT formatted values to Excel? How can I check for

More information

EXST SAS Lab Lab #6: More DATA STEP tasks

EXST SAS Lab Lab #6: More DATA STEP tasks EXST SAS Lab Lab #6: More DATA STEP tasks Objectives 1. Working from an current folder 2. Naming the HTML output data file 3. Dealing with multiple observations on an input line 4. Creating two SAS work

More information

Data Manipulations Using Arrays and DO Loops Patricia Hall and Jennifer Waller, Medical College of Georgia, Augusta, GA

Data Manipulations Using Arrays and DO Loops Patricia Hall and Jennifer Waller, Medical College of Georgia, Augusta, GA Paper SBC-123 Data Manipulations Using Arrays and DO Loops Patricia Hall and Jennifer Waller, Medical College of Georgia, Augusta, GA ABSTRACT Using public databases for data analysis presents a unique

More information

Ten Great Reasons to Learn SAS Software's SQL Procedure

Ten Great Reasons to Learn SAS Software's SQL Procedure Ten Great Reasons to Learn SAS Software's SQL Procedure Kirk Paul Lafler, Software Intelligence Corporation ABSTRACT The SQL Procedure has so many great features for both end-users and programmers. It's

More information

Reading data in SAS and Descriptive Statistics

Reading data in SAS and Descriptive Statistics P8130 Recitation 1: Reading data in SAS and Descriptive Statistics Zilan Chai Sep. 18 th /20 th 2017 Outline Intro to SAS (windows, basic rules) Getting Data into SAS Descriptive Statistics SAS Windows

More information

Level I: Getting comfortable with my data in SAS. Descriptive Statistics

Level I: Getting comfortable with my data in SAS. Descriptive Statistics Level I: Getting comfortable with my data in SAS. Descriptive Statistics Quick Review of reading Data into SAS Preparing Data 1. Variable names in the first row make sure they are appropriate for the statistical

More information

Importing Excel into SAS: A Robust Approach for Difficult-To-Read Worksheets

Importing Excel into SAS: A Robust Approach for Difficult-To-Read Worksheets Importing Excel into SAS: A Robust Approach for Difficult-To-Read Worksheets Name of event: TASS Location of event: Toronto Presenter s name: Bill Sukloff Branch name: Science &Technology Date of event:

More information

INTRODUCTION TO PROC SQL JEFF SIMPSON SYSTEMS ENGINEER

INTRODUCTION TO PROC SQL JEFF SIMPSON SYSTEMS ENGINEER INTRODUCTION TO PROC SQL JEFF SIMPSON SYSTEMS ENGINEER THE SQL PROCEDURE The SQL procedure: enables the use of SQL in SAS is part of Base SAS software follows American National Standards Institute (ANSI)

More information

Merge Processing and Alternate Table Lookup Techniques Prepared by

Merge Processing and Alternate Table Lookup Techniques Prepared by Merge Processing and Alternate Table Lookup Techniques Prepared by The syntax for data step merging is as follows: International SAS Training and Consulting This assumes that the incoming data sets are

More information

Choosing the Right Tool from Your SAS and Microsoft Excel Tool Belt

Choosing the Right Tool from Your SAS and Microsoft Excel Tool Belt Choosing the Right Tool from Your SAS and Microsoft Excel Tool Belt 2997 Yarmouth Greenway Drive, Madison, WI 53711 Phone: (608) 278-9964 Web: www.sys-seminar.com 1 Choosing the Right Tool from Your SAS

More information

Introduction to SAS. Cristina Murray-Krezan Research Assistant Professor of Internal Medicine Biostatistician, CTSC

Introduction to SAS. Cristina Murray-Krezan Research Assistant Professor of Internal Medicine Biostatistician, CTSC Introduction to SAS Cristina Murray-Krezan Research Assistant Professor of Internal Medicine Biostatistician, CTSC cmurray-krezan@salud.unm.edu 20 August 2018 What is SAS? Statistical Analysis System,

More information

Introduction to SAS Procedures SAS Basics III. Susan J. Slaughter, Avocet Solutions

Introduction to SAS Procedures SAS Basics III. Susan J. Slaughter, Avocet Solutions Introduction to SAS Procedures SAS Basics III Susan J. Slaughter, Avocet Solutions DATA versus PROC steps Two basic parts of SAS programs DATA step PROC step Begin with DATA statement Begin with PROC statement

More information

Getting Started with the XML Engine

Getting Started with the XML Engine 3 CHAPTER 1 Getting Started with the XML Engine What Does the XML Engine Do? 3 Understanding How the XML Engine Works 3 Assigning a Libref to an XML Document 3 Importing an XML Document 4 Exporting an

More information

Using SAS Enterprise Guide to Coax Your Excel Data In To SAS

Using SAS Enterprise Guide to Coax Your Excel Data In To SAS Paper IT-01 Using SAS Enterprise Guide to Coax Your Excel Data In To SAS Mira Shapiro, Analytic Designers LLC, Bethesda, MD ABSTRACT Kirk Paul Lafler, Software Intelligence Corporation, Spring Valley,

More information

Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA

Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA ABSTRACT Ditch the Data Memo: Using Macro Variables and Outer Union Corresponding in PROC SQL to Create Data Set Summary Tables Andrea Shane MDRC, Oakland, CA Data set documentation is essential to good

More information

Importing CSV Data to All Character Variables Arthur L. Carpenter California Occidental Consultants, Anchorage, AK

Importing CSV Data to All Character Variables Arthur L. Carpenter California Occidental Consultants, Anchorage, AK PharmaSUG 2017 QT02 Importing CSV Data to All Character Variables Arthur L. Carpenter California Occidental Consultants, Anchorage, AK ABSTRACT Have you ever needed to import data from a CSV file and found

More information

Moving and Accessing SAS 9.2 Files

Moving and Accessing SAS 9.2 Files Moving and Accessing SAS 9.2 Files The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2008. Moving and Accessing SAS 9.2 Files. Cary, NC: SAS Institute Inc. Moving and

More information

An Introduction to SAS/FSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

An Introduction to SAS/FSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California An Introduction to SAS/FSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California ABSTRACT SAS/FSP is a set of procedures used to perform full-screen interactive

More information

Big Data Executive Program

Big Data Executive Program Big Data Executive Program Big Data Executive Program Business Visualization for Big Data (BV) SAS Visual Analytics help people see things that were not obvious to them before. Even when data volumes are

More information

3. Almost always use system options options compress =yes nocenter; /* mostly use */ options ps=9999 ls=200;

3. Almost always use system options options compress =yes nocenter; /* mostly use */ options ps=9999 ls=200; Randy s SAS hints, updated Feb 6, 2014 1. Always begin your programs with internal documentation. * ***************** * Program =test1, Randy Ellis, first version: March 8, 2013 ***************; 2. Don

More information

ssh tap sas913 sas

ssh tap sas913 sas Fall 2010, STAT 430 SAS Examples SAS9 ===================== ssh abc@glue.umd.edu tap sas913 sas https://www.statlab.umd.edu/sasdoc/sashtml/onldoc.htm a. Reading external files using INFILE and INPUT (Ch

More information

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

The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data Paper PO31 The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data MaryAnne DePesquo Hope, Health Services Advisory Group, Phoenix, Arizona Fen Fen Li, Health Services Advisory Group,

More information

Beginning Tutorials. Introduction to SAS/FSP in Version 8 Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

Beginning Tutorials. Introduction to SAS/FSP in Version 8 Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California Introduction to SAS/FSP in Version 8 Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California ABSTRACT SAS/FSP is a set of procedures used to perform full-screen interactive

More information

Microsoft Access 2016

Microsoft Access 2016 Access 2016 Instructor s Manual Page 1 of 10 Microsoft Access 2016 Module Two: Querying a Database A Guide to this Instructor s Manual: We have designed this Instructor s Manual to supplement and enhance

More information

Microsoft Access 2016

Microsoft Access 2016 Access 2016 Instructor s Manual Page 1 of 10 Microsoft Access 2016 Module Two: Querying a Database A Guide to this Instructor s Manual: We have designed this Instructor s Manual to supplement and enhance

More information

Chapter 6: Modifying and Combining Data Sets

Chapter 6: Modifying and Combining Data Sets Chapter 6: Modifying and Combining Data Sets The SET statement is a powerful statement in the DATA step. Its main use is to read in a previously created SAS data set which can be modified and saved as

More information

Objectives Reading SAS Data Sets and Creating Variables Reading a SAS Data Set Reading a SAS Data Set onboard ia.dfwlax FirstClass Economy

Objectives Reading SAS Data Sets and Creating Variables Reading a SAS Data Set Reading a SAS Data Set onboard ia.dfwlax FirstClass Economy Reading SAS Data Sets and Creating Variables Objectives Create a SAS data set using another SAS data set as input. Create SAS variables. Use operators and SAS functions to manipulate data values. Control

More information

From An Introduction to SAS University Edition. Full book available for purchase here.

From An Introduction to SAS University Edition. Full book available for purchase here. From An Introduction to SAS University Edition. Full book available for purchase here. Contents List of Programs... xi About This Book... xvii About the Author... xxi Acknowledgments... xxiii Part 1: Getting

More information

So, Your Data are in Excel! Ed Heaton, Westat

So, Your Data are in Excel! Ed Heaton, Westat Paper AD02_05 So, Your Data are in Excel! Ed Heaton, Westat Abstract You say your customer sent you the data in an Excel workbook. Well then, I guess you'll have to work with it. This paper will discuss

More information

Moving and Accessing SAS. 9.1 Files

Moving and Accessing SAS. 9.1 Files Moving and Accessing SAS 9.1 Files The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2004. Moving and Accessing SAS 9.1 Files. Cary, NC: SAS Institute Inc. Moving and

More information

Econ Stata Tutorial I: Reading, Organizing and Describing Data. Sanjaya DeSilva

Econ Stata Tutorial I: Reading, Organizing and Describing Data. Sanjaya DeSilva Econ 329 - Stata Tutorial I: Reading, Organizing and Describing Data Sanjaya DeSilva September 8, 2008 1 Basics When you open Stata, you will see four windows. 1. The Results window list all the commands

More information

Introduction to SAS Procedures SAS Basics III. Susan J. Slaughter, Avocet Solutions

Introduction to SAS Procedures SAS Basics III. Susan J. Slaughter, Avocet Solutions Introduction to SAS Procedures SAS Basics III Susan J. Slaughter, Avocet Solutions SAS Essentials Section for people new to SAS Core presentations 1. How SAS Thinks 2. Introduction to DATA Step Programming

More information

Use That SAP to Write Your Code Sandra Minjoe, Genentech, Inc., South San Francisco, CA

Use That SAP to Write Your Code Sandra Minjoe, Genentech, Inc., South San Francisco, CA Paper DM09 Use That SAP to Write Your Code Sandra Minjoe, Genentech, Inc., South San Francisco, CA ABSTRACT In this electronic age we live in, we usually receive the detailed specifications from our biostatistician

More information

SAS and Data Management Kim Magee. Department of Biostatistics College of Public Health

SAS and Data Management Kim Magee. Department of Biostatistics College of Public Health SAS and Data Management Kim Magee Department of Biostatistics College of Public Health Review of Previous Material Review INFILE statement data bp; infile c:\sas\bp.csv dlm=, ; input clinic $ dbp1 sbp1

More information

SAS Visual Analytics Environment Stood Up? Check! Data Automatically Loaded and Refreshed? Not Quite

SAS Visual Analytics Environment Stood Up? Check! Data Automatically Loaded and Refreshed? Not Quite Paper SAS1952-2015 SAS Visual Analytics Environment Stood Up? Check! Data Automatically Loaded and Refreshed? Not Quite Jason Shoffner, SAS Institute Inc., Cary, NC ABSTRACT Once you have a SAS Visual

More information

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

A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY PharmaSUG 2014 - Paper BB14 A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY ABSTRACT Clinical Study

More information

Contents of SAS Programming Techniques

Contents of SAS Programming Techniques Contents of SAS Programming Techniques Chapter 1 About SAS 1.1 Introduction 1.1.1 SAS modules 1.1.2 SAS module classification 1.1.3 SAS features 1.1.4 Three levels of SAS techniques 1.1.5 Chapter goal

More information

SAS/ACCESS Interface to PC Files for SAS Viya 3.2: Reference

SAS/ACCESS Interface to PC Files for SAS Viya 3.2: Reference SAS/ACCESS Interface to PC Files for SAS Viya 3.2: Reference SAS Documentation The correct bibliographic citation for this manual is as follows: SAS Institute Inc. 2017. SAS/ACCESS Interface to PC Files

More information

Techdata Solution. SAS Analytics (Clinical/Finance/Banking)

Techdata Solution. SAS Analytics (Clinical/Finance/Banking) +91-9702066624 Techdata Solution Training - Staffing - Consulting Mumbai & Pune SAS Analytics (Clinical/Finance/Banking) What is SAS SAS (pronounced "sass", originally Statistical Analysis System) is an

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 BB-02-2013 Same Data Different Attributes: Cloning Issues with Data Sets Brian Varney, Experis Business Analytics, Portage, MI ABSTRACT When dealing with data from multiple or unstructured data sources,

More information

ET01. LIBNAME libref <engine-name> <physical-file-name> <libname-options>; <SAS Code> LIBNAME libref CLEAR;

ET01. LIBNAME libref <engine-name> <physical-file-name> <libname-options>; <SAS Code> LIBNAME libref CLEAR; ET01 Demystifying the SAS Excel LIBNAME Engine - A Practical Guide Paul A. Choate, California State Developmental Services Carol A. Martell, UNC Highway Safety Research Center ABSTRACT This paper is a

More information

Week 1 [20-24 Aug 07] Class Activities. FILE: \\Muserver2\USERS\B\baileraj\Classes\sta402\handouts\week-01-22aug07.doc

Week 1 [20-24 Aug 07] Class Activities. FILE: \\Muserver2\USERS\B\baileraj\Classes\sta402\handouts\week-01-22aug07.doc Week 1 [20-24 Aug 07] Class Activities FILE: \\Muserver2\USERS\B\baileraj\Classes\sta402\handouts\week-01-22aug07.doc 0. Roster STA 402 (n=3) Menickelly,Matthew Mix, Nathan Weber, Madeline STA 502 (n=11)

More information

Certkiller.A QA

Certkiller.A QA Certkiller.A00-260.70.QA Number: A00-260 Passing Score: 800 Time Limit: 120 min File Version: 3.3 It is evident that study guide material is a victorious and is on the top in the exam tools market and

More information

Earthquake data in geonet.org.nz

Earthquake data in geonet.org.nz Earthquake data in geonet.org.nz There is are large gaps in the 2012 and 2013 data, so let s not use it. Instead we ll use a previous year. Go to http://http://quakesearch.geonet.org.nz/ At the screen,

More information

Microsoft Office Illustrated Introductory, Building and Using Queries

Microsoft Office Illustrated Introductory, Building and Using Queries Microsoft Office 2007- Illustrated Introductory, Building and Using Queries Creating a Query A query allows you to ask for only the information you want vs. navigating through all the fields and records

More information

Uncommon Techniques for Common Variables

Uncommon Techniques for Common Variables Paper 11863-2016 Uncommon Techniques for Common Variables Christopher J. Bost, MDRC, New York, NY ABSTRACT If a variable occurs in more than one data set being merged, the last value (from the variable

More information

2. Don t forget semicolons and RUN statements The two most common programming errors.

2. Don t forget semicolons and RUN statements The two most common programming errors. Randy s SAS hints March 7, 2013 1. Always begin your programs with internal documentation. * ***************** * Program =test1, Randy Ellis, March 8, 2013 ***************; 2. Don t forget semicolons and

More information

University of North Dakota PeopleSoft Finance Tip Sheets. Utilizing the Query Download Feature

University of North Dakota PeopleSoft Finance Tip Sheets. Utilizing the Query Download Feature There is a custom feature available in Query Viewer that allows files to be created from queries and copied to a user s PC. This feature doesn t have the same size limitations as running a query to HTML

More information

Biology 345: Biometry Fall 2005 SONOMA STATE UNIVERSITY Lab Exercise 2 Working with data in Excel and exporting to JMP Introduction

Biology 345: Biometry Fall 2005 SONOMA STATE UNIVERSITY Lab Exercise 2 Working with data in Excel and exporting to JMP Introduction Biology 345: Biometry Fall 2005 SONOMA STATE UNIVERSITY Lab Exercise 2 Working with data in Excel and exporting to JMP Introduction In this exercise, we will learn how to reorganize and reformat a data

More information

Innovative SAS Techniques

Innovative SAS Techniques Carpenter s Guide to Innovative SAS Techniques. ART CARPENTER Sample Text... is Professor of Statistics at Grinnell College in Grinnell, Iowa, where he teaches elementary statistics and experimental design.

More information

Intermediate SAS: Working with Data

Intermediate SAS: Working with Data Intermediate SAS: Working with Data OIT Technical Support Services 293-4444 oithelp@mail.wvu.edu oit.wvu.edu/training/classmat/sas/ Table of Contents Getting set up for the Intermediate SAS workshop:...

More information

A SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes

A SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes A SAS Macro for Producing Benchmarks for Interpreting School Effect Sizes Brian E. Lawton Curriculum Research & Development Group University of Hawaii at Manoa Honolulu, HI December 2012 Copyright 2012

More information

STAT:5400 Computing in Statistics

STAT:5400 Computing in Statistics STAT:5400 Computing in Statistics Introduction to SAS Lecture 18 Oct 12, 2015 Kate Cowles 374 SH, 335-0727 kate-cowles@uiowaedu SAS SAS is the statistical software package most commonly used in business,

More information

Interfacing with MS Office Conference 2017

Interfacing with MS Office Conference 2017 Conference 2017 Session Description: This session will detail procedures for importing/exporting data between AeriesSIS Web Version/AeriesSIS Client Version and other software packages, such as word processing

More information

Introduction to STATA 6.0 ECONOMICS 626

Introduction to STATA 6.0 ECONOMICS 626 Introduction to STATA 6.0 ECONOMICS 626 Bill Evans Fall 2001 This handout gives a very brief introduction to STATA 6.0 on the Economics Department Network. In a few short years, STATA has become one of

More information

EXST SAS Lab Lab #8: More data step and t-tests

EXST SAS Lab Lab #8: More data step and t-tests EXST SAS Lab Lab #8: More data step and t-tests Objectives 1. Input a text file in column input 2. Output two data files from a single input 3. Modify datasets with a KEEP statement or option 4. Prepare

More information

SAS (Statistical Analysis Software/System)

SAS (Statistical Analysis Software/System) SAS (Statistical Analysis Software/System) Clinical SAS:- Class Room: Training Fee & Duration : 23K & 3 Months Online: Training Fee & Duration : 25K & 3 Months Learning SAS: Getting Started with SAS Basic

More information

Ninth ARTNeT Capacity Building Workshop for Trade Research "Trade Flows and Trade Policy Analysis"

Ninth ARTNeT Capacity Building Workshop for Trade Research Trade Flows and Trade Policy Analysis Ninth ARTNeT Capacity Building Workshop for Trade Research "Trade Flows and Trade Policy Analysis" June 2013 Bangkok, Thailand Cosimo Beverelli and Rainer Lanz (World Trade Organization) 1 Introduction

More information

David Beam, Systems Seminar Consultants, Inc., Madison, WI

David Beam, Systems Seminar Consultants, Inc., Madison, WI Paper 150-26 INTRODUCTION TO PROC SQL David Beam, Systems Seminar Consultants, Inc., Madison, WI ABSTRACT PROC SQL is a powerful Base SAS Procedure that combines the functionality of DATA and PROC steps

More information

Using Dynamic Data Exchange

Using Dynamic Data Exchange 145 CHAPTER 8 Using Dynamic Data Exchange Overview of Dynamic Data Exchange 145 DDE Syntax within SAS 145 Referencing the DDE External File 146 Determining the DDE Triplet 146 Controlling Another Application

More information

The Programmer's Solution to the Import/Export Wizard

The Programmer's Solution to the Import/Export Wizard The Programmer's Solution to the Import/Export Wizard Lora D. Delwiche, University of California, Davis, CA Susan J. Slaughter, SAS Consultant, Davis, CA Abstract Do you like what the Import/Export Wizard

More information

Introduction to PROC SQL

Introduction to PROC SQL Introduction to PROC SQL Steven First, Systems Seminar Consultants, Madison, WI ABSTRACT PROC SQL is a powerful Base SAS Procedure that combines the functionality of DATA and PROC steps into a single step.

More information

SUGI 29 Data Warehousing, Management and Quality

SUGI 29 Data Warehousing, Management and Quality Building a Purchasing Data Warehouse for SRM from Disparate Procurement Systems Zeph Stemle, Qualex Consulting Services, Inc., Union, KY ABSTRACT SAS Supplier Relationship Management (SRM) solution offers

More information

STAT:5400 Computing in Statistics. Other software packages. Microsoft Excel spreadsheet very convenient for entering data in flatfile

STAT:5400 Computing in Statistics. Other software packages. Microsoft Excel spreadsheet very convenient for entering data in flatfile STAT:5400 Computing in Statistics Other Software Packages Proc import A bit on SAS macro language Lecture 26 ov 2, 2016 Kate Cowles 374 SH, 335-0727 kate-cowles@uiowaedu Other software packages Microsoft

More information

Final Stat 302, March 17, 2014

Final Stat 302, March 17, 2014 First Name Last Name Student ID Final Stat 302, March 17, 2014 Fritz Scholz Questions 1-15 count as 4 points each, the rest as 6 points each (180 total). 1. Could Y and y refer to different objects within

More information

EXCELLING WITH ANALYSIS AND VISUALIZATION

EXCELLING WITH ANALYSIS AND VISUALIZATION EXCELLING WITH ANALYSIS AND VISUALIZATION A PRACTICAL GUIDE FOR DEALING WITH DATA Prepared by Ann K. Emery July 2016 Ann K. Emery 1 Welcome Hello there! In July 2016, I led two workshops Excel Basics for

More information

USING PROC SQL EFFECTIVELY WITH SAS DATA SETS JIM DEFOOR LOCKHEED FORT WORTH COMPANY

USING PROC SQL EFFECTIVELY WITH SAS DATA SETS JIM DEFOOR LOCKHEED FORT WORTH COMPANY USING PROC SQL EFFECTIVELY WITH SAS DATA SETS JIM DEFOOR LOCKHEED FORT WORTH COMPANY INTRODUCTION This paper is a beginning tutorial on reading and reporting Indexed SAS Data Sets with PROC SQL. Its examples

More information

Integrating Large Datasets from Multiple Sources Calgary SAS Users Group (CSUG)

Integrating Large Datasets from Multiple Sources Calgary SAS Users Group (CSUG) Integrating Large Datasets from Multiple Sources Calgary SAS Users Group (CSUG) October 25, 2017 Hotel Le-Germain Outline About the AESO Large Datasets: AESO Context Usual Process Obtain data Connecting

More information

Group Administrator. ebills csv file formatting by class level. User Guide

Group Administrator. ebills csv file formatting by class level. User Guide Group Administrator ebills csv file formatting by class level User Guide Version 1.0 February 10, 2015 Table of Content Excel automated template... 3 Enable Macro setting in Microsoft Excel... 3 Extracting

More information

Exporting your Address Book from Despatch Manager Online & importing it into Click & Drop

Exporting your Address Book from Despatch Manager Online & importing it into Click & Drop Exporting your Address Book from Despatch Manager Online & importing it into Click & Drop How to export your Address Book from Despatch Manager Online (DMO) The process to export your Address Book from

More information

MARK CARPENTER, Ph.D.

MARK CARPENTER, Ph.D. MARK CARPENTER, Ph.D. Module 1 : THE DATA STEP (1, 2, 3) Keywords : DATA, INFILE, INPUT, FILENAME, DATALINES Procedures : PRINT Pre-Lecture Preparation: create directory on your local hard drive called

More information

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently.

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently. 255 APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software Introduction 255 Generating a QMF Export Procedure 255 Exporting Queries from QMF 257 Importing QMF Queries into Query and Reporting 257 Alternate

More information

Paper William E Benjamin Jr, Owl Computer Consultancy, LLC

Paper William E Benjamin Jr, Owl Computer Consultancy, LLC Paper 025-2009 So, You ve Got Data Enterprise Wide (SAS, ACCESS, EXCEL, MySQL, and Others); Well, Let SAS Enterprise Guide Software Point-n-Click Your Way to Using It William E Benjamin Jr, Owl Computer

More information

Using Databases with Dispersion Modeling: Putting It All Together

Using Databases with Dispersion Modeling: Putting It All Together Using Databases with Dispersion Modeling: Putting It All Together Introduction To take full advantage of the Unitized Emission Rate dispersion modeling technique using a database, there are a series of

More information