From the course: SAS® 9.4 Cert Prep: Part 02 Accessing Data

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Demo: Importing a comma-delimited (CSV) file

Demo: Importing a comma-delimited (CSV) file - SAS Tutorial

From the course: SAS® 9.4 Cert Prep: Part 02 Accessing Data

Demo: Importing a comma-delimited (CSV) file

- Let's write a proc import step, to import a comma delimited file and create a new SAS table. So in this comma delimited file, storm damage.csv you can see the first row contains what would be our column names. Each column name is separated with a comma. Then for the data values, again values are separated with commas and for that long description free storm values are quoted because it's possible, likely actually that we have commas within that string. So we want to write a SAS program that will give structure to this text file. So that we can create a SAS data set that can be used in our SAS program. I'll close that file and come to our demo program. I'll complete this PROC import step to read the comma delimited file and create a new SAS table. The first option we need is data file = and then in quotes we provide the full path and file name we want to read. Next I'll use the DBMS = option to specify the layout of…

Contents