BookmarkSubscribeRSS Feed
trb
Calcite | Level 5 trb
Calcite | Level 5
I am a student and new to SAS. I have a pretty large dataset in Excel and I am trying to duplicate some analyses my advisor ran after typing her dataset right into excel.

This is how I imported my data from Excel:
PROC IMPORT OUT= WORK.dissertation
DATAFILE = "C:\Documents and Settings\Me\My Documents\dissertation.xls"
DBMS=EXCEL REPLACE; stopover;
SHEET="Sheet1;
GETNAMES=YES;
MIXED=NO;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;


This is her data statements that she ran before doing ANOVAS:
DATA rate0 ;
INFILE 'H:\Data\ms-ratings-dats.TXT'' ;
INPUT var1 1-3 var2 5 var3 7-8 var4 10-12 var5 14 var6 16 var7 18 var8 20;


From there, it looks like she sets the value of some of the variables and then runs the ANOVA.

Is there a comparable INFILE statement I should be running with my Excel data that would make my data ready for analysis?



eta: when I just replace the TXT file name with my excel file, I get errors; it reads none of the variables. Message was edited by: trb
4 REPLIES 4
Reeza
Super User
That infile statement is reading a data set from a text file.

If you're trying to use the data you imported instead of the text file, use the line
set dissertation;

instead of the infile and input lines. You'll probably have to rename variables as well.

I'll also mention I haven't seen a stopover option before in proc import...I'll have to google that one.

You might want to review some sas basics before playing around with this stuff though. I highly recommend the SAS UCLA tutorials online for beginners.
trb
Calcite | Level 5 trb
Calcite | Level 5
Thank you! I was able to run my ANOVAS with your help. And thanks for referring me to the user-friendly tutorials!
trb
Calcite | Level 5 trb
Calcite | Level 5
Thank you! I was able to run my ANOVAS with your help. And thanks for referring me to the user-friendly tutorials!
piggy
Fluorite | Level 6
you can save your Excel file in csv format, then use the INFILE.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 987 views
  • 0 likes
  • 3 in conversation