BookmarkSubscribeRSS Feed
hartillm
Calcite | Level 5

Hi there!

I'm new to SAS and am using the SAS OnDemand for Academics program. I have an assignment where I need to do a correlation analysis. We got the data from the professor and were told to make it a table on excel and then import it into SAS. I created the folder and library, imported the data, and hit the runner guy button and it looks like I did everything correct (2 columns and 10 rows of data). However, when I go to make the correlation analysis and select the analysis variables and correlate with, it says "no columns are available". I'm not sure how to fix this... any ideas? I reached out to the professor too, just seeing if anyone else can help in the meantime. I attached some screenshots below.

Thanks!

MaggieScreenshot (107).pngScreenshot (108).png

1 REPLY 1
PaigeMiller
Diamond | Level 26

When you import the data from Excel, you need to tell SAS that the variable (or column) names are in the first row of the Excel file. Otherwise, SAS thinks the first row of Excel contains data (and it is not data) and so the variables all show up as character to account for the column name in the first row. You can't create correlations of character strings.

 

I am not familiar enough with SAS On Demand to explain exactly how to do this, but you need to look for options in the Import process, and then select the correct one to treat the first row of the Excel file as containing column names.

--
Paige Miller

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 329 views
  • 0 likes
  • 2 in conversation