Write and run SAS programs in your web browser

importing excel.csv data to sas

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

importing excel.csv data to sas

help! my excel file is on a flash drive known to my computer as the e:\ drive. SAS says the physical file is missing. what am i missing? thank you, folks!


Accepted Solutions
Solution
‎04-25-2016 03:47 PM
Occasional Contributor
Posts: 6

Re: importing excel.csv data to sas

gave up and bought stata

View solution in original post


All Replies
Super User
Posts: 19,145

Re: importing excel.csv data to sas

What's your question? What's the issue your having with import and how are you doing it? How is your SAS set up?

 

FYI CSV are text files that Excel knows how to read, they are not Excel files. 

Occasional Contributor
Posts: 6

Re: importing excel.csv data to sas

Thank you for anwering! I am following the tutorial as closely as I can but the tutorial seems to assume that the excel SS is already resident within SAS. My data are in a flash drive as e:



Here are my code lines



data opeb;

infile 'E:\000000pensionopeb\april19small.csv' DLM=',' firstobs=2;

input GFOA lopeb lpop nuobs1 logliab mc urate ustat logplus1 yr lav st$ name$ posnad;


Super User
Posts: 19,145

Re: importing excel.csv data to sas

Please answer my initial questions. 

Occasional Contributor
Posts: 6

Re: importing excel.csv data to sas

What's your question? how do i import excel data to SAS studio? What's the issue your having with import

i get this error:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
55
56 data opeb;
57 infile 'E:\000000pensionopeb\april19small.csv' DLM=',' firstobs=2;
58 input GFOA lopeb lpop nuobs1 logliab mc urate ustat logplus1 yr lav st$ name$ posnad;
59
60 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
ERROR: Physical file does not exist, /pbr/biconfig/940/Lev1/SASApp/E:\000000pensionopeb\april19small.csv.
WARNING: The data set WORK.OPEB may be incomplete. When this step was stopped there were 0 observations and 14 variables.
WARNING: Data set WORK.OPEB was not replaced because this step was stopped.
72

 

 

 

and how are you doing it? typing the code as per above

 

 

 

How is your SAS set up? I am using SAS studio.

 

FYI CSV are text files that Excel knows how to read, they are not Excel files. The SAS tutorial video emphasized the need to use csv format.

 

thank you for help

Super User
Posts: 11,129

Re: importing excel.csv data to sas

SAS Studio has some rules about files:

 /pbr/biconfig/940/Lev1/SASApp/E:\000000pensionopeb​\april19small.csv.

The change from / to \ tells you that SAS is running in (most likely) a Unix/Linux server mode and cannot see the flash drive attached to your computer as your machine is not the server.

 

You MAY be able to use an import task and navigate to that location but the code won't work.

If you could connect the thumb drive to the server, OR move a copy of the file to a location that the SERVER sees, then the code would run with the appropriate path.

Occasional Contributor
Posts: 6

Re: importing excel.csv data to sas

thank you . . . looks like SAS Studio is worthless to me since i have no idea where the server is. Ordinarily I use LIMDEP and Eviews for my statistical analysis but they are coming up short with a regression diagnostic I need.  I will investigate SAS on campus a bit more before checking out SPSS. 

Super User
Posts: 19,145

Re: importing excel.csv data to sas


eljay wrote:

thank you . . . looks like SAS Studio is worthless to me since i have no idea where the server is. Ordinarily I use LIMDEP and Eviews for my statistical analysis but they are coming up short with a regression diagnostic I need.  I will investigate SAS on campus a bit more before checking out SPSS. 




Are you not using University Edition? If you're a student it is an option, it's installed locally, there is no server, its on a Virtual Machine that runs on your desktop. And it's free and you can download and install at your convenience.

 

http://www.sas.com/en_us/software/university-edition.html

 

Super User
Posts: 19,145

Re: importing excel.csv data to sas

I'm going to assume SAS University Edition that you've downloaded to your machine.

 

1. Make sure you've set up shared folder, myfolders. See installation instructions on how that should have been done.

2. Move your CSV file to the myfolders location.

3. Reference it as '/folders/myfolders/yourfilename.csv'

 

If you're not using UE this doesn't apply.

Occasional Contributor
Posts: 6

Re: importing excel.csv data to sas

No, I was not using the university edition . . . my previous efforts led me to SAS Studio. Thank you for this link; I'm in process of installing it now. Regards, eljay


Super User
Posts: 19,145

Re: importing excel.csv data to sas

SAS Studio is a type of SAS, but there are several different installation types. 

 

One is University Edition, another links to SAS servers and called Academic On Demand, and a third allows a company to install Studio to connect to their own  SAS Server. My point being that SAS Studio is not specific enough to provide information on what you're working on Smiley Happy

 

Good Luck with UE. 

I should mention that it has SAS/STAT but not many of the SAS/ETS (time series) procs. So depending on what you're doing it may not be suitable either. 

Solution
‎04-25-2016 03:47 PM
Occasional Contributor
Posts: 6

Re: importing excel.csv data to sas

gave up and bought stata

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 11 replies
  • 545 views
  • 0 likes
  • 3 in conversation