Of files used with sas 10 turning data into

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: tion Raw Data Raw Data Files SAS DATA Sets SAS Program Files DATA Step SAS Data Sets PROC Steps Information 11 12 3 Raw Data Files Raw Data Files SAS Data Sets • are nonsoftware-specific files that contain records and fields • can be created by a variety of software products • can be read by a variety of software products • consist of no special attributes, such as field headings, page breaks, or titles • are not reports. SAS Data Sets • are files specific to SAS that contain variables and observations • can be created only by SAS • can be read only by SAS • consist of a descriptor portion and a data portion 13 SAS Program Files SAS Program Files 14 Components of a SAS Program • A SAS program is a sequence of steps. • There are only two kinds of steps: • contain SAS program code • can be saved and reused • file extension is .sas – DATA steps – PROC steps. A SAS Program DATA step(s) PROC step(s) 15 16 4 DATA Step(s) SAS Programs A SAS program is a sequence of steps that the user submits for execution. Raw Data SAS Data Set Raw Data File Descriptor DATA Step SAS Data Set • Typically, DATA steps read data, such as raw data files, to create SAS data sets. DATA steps are typically used to create SAS data sets. SAS Data Set PROC Step Report DATA Step PROC steps are typically used to process SAS data sets (that is, generate reports and graphs, edit data, and sort data). 17 18 DATA Step(s) PROC Step(s) • In addition, DATA steps can modify existing variables or create new variables as necessary. • PROC steps typically read SAS data sets to create reports. SAS Data Set SAS Data Set Descriptor Raw Data File Descriptor DATA Step Report PROC Step 19 20 5 PROC Step(s) Components of a Step • There are many different types of PROC steps. • A SAS program is a sequence of steps: – DATA steps – PROC steps. PROC Step(s) PRINT • A step is a sequence of one or more statements. ... MEANS MEANS FREQ 21 Components of a Step 22 Components of a DATA Step • A statement usually starts with a keyword and always ends in a semicolon (;) • A DATA step starts with a DATA statement and ends with a RUN statement. Start data _______________ ; KEYWORD . . . ; _______________ ; . . . _______________ ; End 23 run; 24 6 SAS Programs Components of a PROC Step • A PROC step starts with a PROC statement and ends with a RUN statement. Start _______________ ; . proc means data=work.staff; class JobTitle; var Salary; run; . _______________ ; End DATA Step proc print data=work.staff; run; proc _______________ ; . data work.staff; infile 'raw-data-file'; input LastName $ 1-20 FirstName $ 21-30 JobTitle $ 36-43 Salary 54-59; run; PROC Steps run; 25 26 Step Boundaries Step Boundaries data work.staff; infile 'raw-data-file'; input LastName $ 1-20 FirstName $ 21-30 JobTitle $ 36-43 Salary 54-59; run; SAS steps begin with a DATA statement PROC statement. proc print data=work.staff; SAS detects the end of a step when it encounters a RUN statement (for most...
View Full Document

Ask a homework question - tutors are online