Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

SAS Data Manipulation & Analysis: Reading, Importing Data & Data Step vs Proc Step - Prof., Exams of Biostatistics

Instructions on how to read and import various types of data files (ascii, excel, csv, spss portable files, sas transport files) into sas using different methods. It also covers rules for sas statements and names, as well as an overview of sas data step and proc step. Additionally, it introduces procs for working with categorical and continuous data.

Typology: Exams

Pre 2010

Uploaded on 09/17/2009

koofers-user-ix2-1
koofers-user-ix2-1 🇺🇸

10 documents

1 / 4

Toggle sidebar

Related documents


Partial preview of the text

Download SAS Data Manipulation & Analysis: Reading, Importing Data & Data Step vs Proc Step - Prof. and more Exams Biostatistics in PDF only on Docsity! Fast Facts for SAS Biostat 510 1. Read in raw data from an ASCII file using an infile statement. data march; infile "marflt.dat"; input flight 1-3 @4 date mmddyy6. @10 time time5. orig $ 15-17 dest $ 18-20 @21 miles comma5. mail 26-29 freight 30-33 boarded 34-36 transfer 37-39 nonrev 40-42 deplane 43-45 capacity 46-48; format date mmddyy10. time time5. miles comma5.; label flight="Flight number" orig ="Origination City" dest ="Destination City"; run; 2. Import an Excel File using Proc Import (alternatively, use the Import Wizard): PROC IMPORT OUT= WORK.MARCH DATAFILE= "MARCH.XLS" DBMS=EXCEL REPLACE; SHEET="march$"; GETNAMES=YES; MIXED=NO; SCANTEXT=YES; USEDATE=YES; SCANTIME=YES; RUN; 3. Read in raw data from a CSV (comma separated values) file. data pulse; infile "pulse.csv" firstobs=2 delimiter="," missover; input pulse1 pulse2 ran smokes sex height weight activity; run; 1 4. Alternatively, use the import wizard to read a .csv file. PROC IMPORT OUT= WORK.pulse DATAFILE= "PULSE.CSV" DBMS=CSV REPLACE; GETNAMES=YES; DATAROW=2; RUN; 5. Convert an SPSS portable file into a SAS data set: filename file1 "cars.por"; proc convert spss=file1 out=cars; run; 6. Alternatively, read an SPSS data set directly into SAS, using the import wizard: PROC IMPORT OUT= WORK.breast_ca_survival DATAFILE= "C:\Program Files\SPSS15\Breast cancer survival.sav" DBMS=SAV REPLACE; RUN; 7. Read in a Permanent SAS data set, and create a temporary data set: libname sasdata2 "C:\Documents and Settings\kwelch\Desktop\sasdata2"; data bank; set sasdata2.bank; run; Or, to use the permanent SAS data set for analysis directly: libname sasdata2 "C:\Documents and Settings\kwelch\Desktop\sasdata2"; proc means data=sasdata2.bank; run; Another way to use the permanent SAS data set directly, without setting up a libname statement: proc means data="C:\Documents and Settings\kwelch\Desktop\sasdata2\bank.sas7bdat"; run; Or: proc means data="C:\Documents and Settings\kwelch\Desktop\sasdata2\bank"; run; 8. Read a SAS transport file into a regular SAS data set: libname trans xport "c:\temp\sasdata2\bank.xpt"; proc copy in=trans out=sasdata2; run; 2
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved