From the course: SAS Programming for R Users, Part 1
Unlock this course with a free trial
Join today to access over 22,600 courses taught by industry experts.
Demo: Importing data - SAS Tutorial
From the course: SAS Programming for R Users, Part 1
Demo: Importing data
- [Instructor] In this section, I'll read in delimited raw data files with both DATA and PROC steps. Here, I'm creating a new data set called all_names in my sp4r library. The names are going to be the same names as before. First name, last name, and also, I'm going to read in age and height. I'll change the length of the first name and last name variables as well because they're a character. In my infile statement, I'll specify the path to the data file, and I want to read in the allnames.csv data file. And the dlm= option, I'll specify the comma for the CSV file type. The allnames.csv file has the original five names to be read in from the previous demonstration, as well as 195 other names. So of course, I wouldn't want to type those out by hand, so I'll just save those in my CSV and read them in with a data step. So let's run this. And again, we have 200 observations and the same 4 columns. Here are the first five names from before, and my 195 other ones that you can scroll…
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.
Contents
-
-
-
-
Creating datasets manually in the DATA step2m 39s
-
(Locked)
Demo: Creating and viewing the data table2m 40s
-
(Locked)
Importing raw data files4m 41s
-
(Locked)
Demo: Importing data5m 9s
-
(Locked)
Reporting data6m
-
(Locked)
Enhanced reporting: Labels and formats4m 54s
-
(Locked)
The FORMAT statement2m 54s
-
(Locked)
Demo: Labels, formats, and informats3m
-
-