BookmarkSubscribeRSS Feed
vteitler
Fluorite | Level 6

Hi SAS Community,

 

I have a class where I have an assignment to complete and I'm not able to figure out what to do. Unfortunately, I don't have anyone who I can go and ask since this is not a traditional professor/student setting. Please note that this assignment is due by Sunday 05/01/2022 and so the request for assistance is fairly urgent. Any assistance would be greatly appreciated.

 
We have been asked to import a data file and then produce summary statistics with that data file. I have successfully imported the data file, but there I'm stuck. I know that I'm supposed to go to Tasks Utilities > Tasks > Statistics, and if I understand correctly I have to use the WORK.IMPORT file, but I'm getting an error. I'm not sure what I'm doing wrong. At this point, I'm stuck and I'm not sure how to proceed so that I can get the summary statistics that are being asked in my assignment.
If anyone can help with step by step instructions, or direct me to somewhere that can help, I would be so grateful!
Thanks!
Vanessa
 
 
 
 
 
 
 
18 REPLIES 18
PaigeMiller
Diamond | Level 26

@vteitler wrote:

Hi SAS Community,

 

I have a class where I have an assignment to complete and I'm not able to figure out what to do. Unfortunately, I don't have anyone who I can go and ask since this is not a traditional professor/student setting. Please note that this assignment is due by Sunday 05/01/2022 and so the request for assistance is fairly urgent. Any assistance would be greatly appreciated.

 
We have been asked to import a data file and then produce summary statistics with that data file. I have successfully imported the data file, but there I'm stuck. I know that I'm supposed to go to Tasks Utilities > Tasks > Statistics, and if I understand correctly I have to use the WORK.IMPORT file, but I'm getting an error. I'm not sure what I'm doing wrong. 

What error? Be specific, give us the exact words, or show us. Many of us (including me) will not download Microsoft Office documents as they are security risks. Please include any screen captures in your reply by clicking on the "Insert Photos" icon.

--
Paige Miller
vteitler
Fluorite | Level 6
Hi Paige,
Thank you for your response. I followed up with a reply and screenshots.

-Vanessa
Reeza
Super User

Here's a video explaining the Summary Task:

https://video.sas.com/detail/video/5537540644001/the-summary-statistics-task-in-sas%C2%AE-studio

 

It looks like you didn't add any variables for it to analyze but watch the video tutorial to understand it better. 

 

Or the documentation which doesn't seem overly helpful. 

https://documentation.sas.com/doc/en/webeditorcdc/5.2/webeditorref/p1bw6kcwu848eun10iikeygzwrab.htm

 

 

Reeza
Super User
And you should have run the IMPORT task first to import the Excel workbook. In that step you can assign a name, that name is what you would use in the Summary Task.

https://video.sas.com/detail/video/4664358166001/using-the-import-data-utility-in-sas-studio
BrianGaines
SAS Employee

Hi @vteitler,

 

Could you please include the code you are using to import the data, and the error message you receive when you run the task?

 

Thanks,

 

-Brian

vteitler
Fluorite | Level 6
Hi Brian,
Thank you for your response. I followed up with a reply and screenshots.

-Vanessa
vteitler
Fluorite | Level 6

Hi,

 I was able to successfully import the data file. I'm trying to product summary statistics, but I'm not sure how to do that. Through some research I see that I was supposed to select WORK.IMPORT, but when I try and select it, it says "The dataset WORK.IMPORT does not exist. Please select an existing dataset."

I realize that this is user error as this is my first time ever working with SAS.Screenshot_1.jpgDataFile.pngAssignment.png

BrianGaines
SAS Employee

Hi @vteitler,

 

In the navigation pane on the left hand side within SAS Studio, if you go to Libraries --> My Libraries --> Work, do you see the IMPORT data set there? Such as in the following screenshot:

BrianGaines_0-1651172440837.png

 

vteitler
Fluorite | Level 6

Hi,
After seeing one of the other replies, I realized that I had to re-run the IMPORT. I did that and now the IMPORT file is there under WORK. This is great because now I don't have the error I had before, but for some reason there are no columns in the Analysis Variables. Could there have been an issue with the data file?

vteitler_0-1651175289473.png

 

BrianGaines
SAS Employee

The Analysis Variables role in the task is only for numeric columns, but from your screenshot, it looks like WORK.IMPORT contains only 2 columns ("B" & "FRED Graph Observations"), and those are both character columns.

 

What does the underlying data file, MIS445FRED-realGDP.xlsx, look like? 

 

In the Libraries section, if you double click on IMPORT under WORK to view the data set, does the data set look like what you would expect?

vteitler
Fluorite | Level 6

Thank you so much Brian, for trying to help me 🙂

 

When I double click on IMPORT, I think it is what it's supposed to be, here's a screenshot:

vteitler_0-1651176641562.png

 

The XLSX file looks like this:

vteitler_1-1651176705513.png

 

Do I need to go into the original XLSX file and change to numeric values?

 

 

Tom
Super User Tom
Super User

See if the Import Wizard has a way for you to tell it where the data area in that sheet starts.  The default is to assume that the first row has the variable names and the rest of the rows has the data.  But your sheet has a bunch of stuff at the top that will want to skip over.

vteitler
Fluorite | Level 6
Hi Tom,
I don't see an Import Wizard where I can check that. Are you saying that the data for import should start on row 11? Can I just delete the rows and re-import?

BrianGaines
SAS Employee

Yes, one option is that you could delete rows 1-10 in the underlying MIS445FRED-realGDP.xlsx data set and re-import it.

 

Another option is to modify the PROC IMPORT code to disable the GETNAMES option. If I do that, then the data set does import successfully, because you want the SAS data set to look like the following, in which there are two columns and the data values are in row 1:

BrianGaines_0-1651178412648.png

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 18 replies
  • 1730 views
  • 1 like
  • 5 in conversation