Write and run SAS programs in your web browser

how to import txt extn file in SAS Stuidio

Occasional Contributor
Posts: 7

how to import txt extn file in SAS Stuidio



I am new to SAS and learning SAS.


I am trying to work on thsi example to import this txt file which i created in notepad and its saved as txt file.


when i try to import file it says physical file doesnt exist , please advise.

i have just typed this data in notepad to create this raw data :


RANCH,1250,2,1,Sheppard Avenue,"$64,000"
SPLIT,1190,1,1,Rand Street,"$65,850"
CONDO,1400,2,1.5,Market Street,"80,050"
TWOSTORY,1810,4,3,Garris Street,"$107,250"
RANCH,1500,3,3,Kemble Avenue,"$86,650"
SPLIT,1615,4,3,West Drive,"94,450"
SPLIT,1305,3,1.5,Graham Avenue,"$73,650"


saved this file as location.txt in note pad


now tried to import it :


data location1;
infile 'C:\Users\tauqe\Documents\myfolders\location.txt' ;
input style $ @;
if style = 'CONDO' or style = 'RANCH';
input sqfeet bedrooms baths street $ price : dollar10.;


error message:

ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/C:\Users\tauqe\Documents\myfolders\location.txt.

NOTE: The SAS System stopped processing this step because of errors
please advise.
Super Contributor
Posts: 409

Re: how to import txt extn file in SAS Stuidio

An often seen mistake where you confuse the local Windows environment of your pc or laptop with the Linux environment of the server. The SAS server session that your Studio is connected to and that executes the code is not directly aware of the files on your Windows drives. You can use the file upload task or drag and drop in the files tree to move your data from Widows to Linux (or more prcisely: from client to server) to make your code run.


The giveaway here is the filename in the message that has a Linux part (/opt/sasinside/SASConfig/Lev1/SASApp) and a Windows part (C:\Users\tauqe\Documents\myfolders\location.txt).


Hope this helps.

- Jan.

Super User
Posts: 18,603

Re: how to import txt extn file in SAS Stuidio

If you're using SAS UE refer to the set up instruction for the book or course you're using to set it up in SAS UE. 


Or check the Analytics U forum for many questions like this. 


Or search the SAS University Edition Help Centre on how to access your files. 


Or see the intro videos for SAS UE on videos.sas.com under How To tutorials. 

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation