x
Get Certified as a SAS Base Programmer
28
Training Modules |
200+
Exam Questions |
100%
Instructor Support |
100%
Pass Guarantee |
|
Lesson 3.3: Importing data from text file
IMPORTANT! This tutorial is updated on March 9, 2017. See the latest training on importing text files into SAS. This lesson will explain how to import data from a tap-delimited text file. This can be done using the ‘infile’ statement we learned from the previous section. 3. TEXT
Example Below is the text file that I am going to read into SAS: DATA SASCrunch; INFILE "C:\test.txt" DELIMITER = "09"x MISSOVER DSD FIRSTOBS=2 LRECL=32767; INPUT Name $ Score; RUN; Again, this is nearly the same as the codes we used when importing a csv file. What you need to pay attention here is the delimiter statement:
‘09’x here is the code for tap delimiter. The common delimiters used are Comma ( , ), Tilda (~) and Tap (‘09’x). DONE! You have learned how to import data from a text file. |
|