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,500 courses taught by industry experts.
Demo: Creating a narrow table with the DATA step - SAS Tutorial
From the course: SAS® 9.4 Cert Prep: Part 14 Restructuring Tables
Demo: Creating a narrow table with the DATA step
- [Instructor] We'll use the Data Step Debugger and enterprise guide to examine a Data Step that creates a narrow table from a wide table. So, let's start with the input table. So, we're looking at Class Test Wide. You can see we have one row per name or per student and then two columns representing test scores for either math or reading. I would like to create a narrow table that will have one row per score. So, in other words, each name or student would have two rows, one for the math score and one for the reading score. We can use the Data Step to accomplish this. So, we'll start with this program and I'll walk through each statement with the Data Step Debugger. Before we start execution, let's take a look at our PDV; name, math and reading are all columns that were read from the Class Test Wide table. I want to create two new columns, one named Subject. You can see it in line number five as well as line number…
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.