SASCRUNCH TRAINING
  • Home
  • Online Courses
    • Practical SAS Training Course for Beginners
    • SAS Base Certification Training Course
    • Proc SQL Course
    • SAS Project Training Course
    • Logistic Regression (Credit Scoring) Modeling using SAS
  • Services
    • The Ultimate Job Search Automation Services
    • Statistical Consulting
    • SAS Assignment Help
    • Data Import Services
    • Data Manipulation and Reporting Services
  • Articles
    • Get Started >
      • 18 Free Resources to Help You Learn SAS
      • How to Install SAS Studio
      • How to Learn SAS Fast
    • Data Import >
      • Importing Excel Spreadsheet
      • Importing CSV Files
      • Importing Text Files
    • SAS Functions >
      • CAT, CATT, CATS, CATX Functions
      • If-Then-Else statement
      • TRIM Function
      • STRIP Function
      • YEAR, MONTH, DAY Functions
      • Compress Function
      • Do-Loop
      • SCAN Function
      • LIKE Operator
      • INDEX Function
    • Data Manipulations >
      • The Ultimate Guide to Proc SQL
      • Proc Datasets
      • Dictionary Tables
      • Dealing with Missing Values
      • Proc Compare
      • Proc Transpose
      • RETAIN Statement
      • SAS Formats
      • SAS Arrays
    • Statistical Analysis >
      • Proc Means
      • Proc Freq
      • Proc Tabulate
    • Informational Interviews >
      • Senior Recruiter at a Fortune 500 Retail Company
      • Manager, Non-profit Health Services Research
      • HR Manager
      • Quantitative Analyst
  • In-class Training
    • SAS Training for Job Seekers
  • Toronto Meetup
  • Guest Lecture
  • Sample Resume
  • About us
  • Contact Us
Master SAS
​in 30 Days
Start your Free training now!
x
Get Certified as a SAS Base Programmer
28
Training Modules
200+
Exam Questions
100%
Instructor Support
100%
Pass
​Guarantee
Start your free training now
 
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:
Picture


DATA SASCrunch;
    INFILE "C:\test.txt" 
    DELIMITER = "09"x
    MISSOVER DSD 
    FIRSTOBS=2 
    LRECL=32767;

    INPUT Name $ Score;

RUN;
Picture
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.
Previous
Next

    Have a Question?

Submit
 

Master SAS in 30 Days

Start your Free training now!
Copyright © 2012-2017 SASCrunch.com All rights reserved.
  • Home
  • Online Courses
    • Practical SAS Training Course for Beginners
    • SAS Base Certification Training Course
    • Proc SQL Course
    • SAS Project Training Course
    • Logistic Regression (Credit Scoring) Modeling using SAS
  • Services
    • The Ultimate Job Search Automation Services
    • Statistical Consulting
    • SAS Assignment Help
    • Data Import Services
    • Data Manipulation and Reporting Services
  • Articles
    • Get Started >
      • 18 Free Resources to Help You Learn SAS
      • How to Install SAS Studio
      • How to Learn SAS Fast
    • Data Import >
      • Importing Excel Spreadsheet
      • Importing CSV Files
      • Importing Text Files
    • SAS Functions >
      • CAT, CATT, CATS, CATX Functions
      • If-Then-Else statement
      • TRIM Function
      • STRIP Function
      • YEAR, MONTH, DAY Functions
      • Compress Function
      • Do-Loop
      • SCAN Function
      • LIKE Operator
      • INDEX Function
    • Data Manipulations >
      • The Ultimate Guide to Proc SQL
      • Proc Datasets
      • Dictionary Tables
      • Dealing with Missing Values
      • Proc Compare
      • Proc Transpose
      • RETAIN Statement
      • SAS Formats
      • SAS Arrays
    • Statistical Analysis >
      • Proc Means
      • Proc Freq
      • Proc Tabulate
    • Informational Interviews >
      • Senior Recruiter at a Fortune 500 Retail Company
      • Manager, Non-profit Health Services Research
      • HR Manager
      • Quantitative Analyst
  • In-class Training
    • SAS Training for Job Seekers
  • Toronto Meetup
  • Guest Lecture
  • Sample Resume
  • About us
  • Contact Us
✕