From the course: SAS® 9.4 Cert Prep: Part 14 Restructuring Tables
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Creating a wide table with the DATA step - SAS Tutorial
From the course: SAS® 9.4 Cert Prep: Part 14 Restructuring Tables
Creating a wide table with the DATA step
- [Instructor] What if you want to restructure a table from narrow to wide? This data has multiple rows for each student each representing a test score. We want to create a table with one row per student with test scores recorded in separate columns. To do this, you can use conditional processing in the data step to examine the value of TestSubject. If TestSubject is Math, then the value of TestScore, 82 for the first row, is assigned to the Math column. And if TestSubject is Reading, then the value of TestScore will be assigned to the Reading column. In the next activity, you'll learn about some other statements you need to create this table.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.