Import txt file into SAS Web Editor

Reply
New Contributor
Posts: 4

Import txt file into SAS Web Editor

I cannot figure out why my code isn't working. I want to use a txt file that is saved on my computer as my data set. This is my code:

data water;

infile 'C:\Users\Laura\Desktop\Household_Consumption.txt'

DLM='09'x;

input #1 address $

  persons

  housetype $

   #2 poweruse

   #3 wateruse;

run;

The error that keeps popping up is "Physical file does not exist, /pbr/biconfig/930/Lev1/SASApp/C:\Users\Laura\Desktop\Household_Consumption.txt.

Do I have to save my data set within SAS Web Editor? How?_

Super User
Posts: 17,750

Re: Import txt file into SAS Web Editor

You say web editor. Can you clarify what type of SAS you're using? Is the the SAS University Edition?

Or are you on a server somewhere?

New Contributor
Posts: 4

Re: Import txt file into SAS Web Editor

I'm using SAS On Demand for Academics Web Editor

Valued Guide
Posts: 3,208

Re: Import txt file into SAS Web Editor

See all other posts on this as you are using Unix not Windows and must definine a connection in your virtual machine to Windows while using in SAS Unix naming.

---->-- ja karman --<-----
Super User
Posts: 10,466

Re: Import txt file into SAS Web Editor

Yet another server related issue. The path

/pbr/biconfig/930/Lev1/SASApp/C:\Users\Laura\Desktop\Household_Consumption.txt

tells you that it is looking at the SERVER which is UNIX of some flavor and not your

windows machine.

You need to tell the server to look at your drive not its.

New Contributor
Posts: 4

Re: Import txt file into SAS Web Editor

How do I change my code in order to tell the server to look at my drive?

Super User
Posts: 17,750

Re: Import txt file into SAS Web Editor

I believe you need to upload your file to the server instead.

New Contributor
Posts: 4

Re: Import txt file into SAS Web Editor

That's what I suspected I would need to do, but I am not sure how to do it. Do I need to upload the txt file via code?

Super User
Posts: 17,750

Re: Import txt file into SAS Web Editor

Valued Guide
Posts: 3,208

Re: Import txt file into SAS Web Editor

The SAS on demand for academics is a closed environment for students. Only an instructor, the person setting up your course, is allowed to do some uploads (limited space).
You could possible store some data in a location like your Unix-homedir (aside SASUSER).  In all cases any  Windows naming like your desktop will work.

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 9 replies
  • 307 views
  • 3 likes
  • 4 in conversation