- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I am learning the SAS Studio Programming 1 Essentials and I'm currently on lesson 2 practicing proc import statements. I was able to successfully run a few before, but when I logged in today and retried an exercise I received the error message below.
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 70 71 proc import datafile="~/EPG1V2/data/eu_sports_trade.xlsx" ; ERROR: Output SAS data set must be provided. NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE IMPORT used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 182.37k OS Memory 28072.00k Timestamp 09/26/2022 08:00:06 PM Step Count 78 Switch Count 0 Page Faults 0 Page Reclaims 18 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0 72 73 dbms=xlsx out=work.eu_sports_trade_import replace; 74 sheet = eu_sports_trade; 75 76 run; 77 78 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 89 User: u60771588
Any help would be appreciated.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You inserted a semi-colon into the middle of the PROC statement.
If you get in the habit of placing the ending semi-colon for a multiple line statement on its own line you can reduce the number of times you will make this mistake. Then it will be more obvious when you scan your code that all those options are part of the single PROC statement.
proc import datafile="~/EPG1V2/data/eu_sports_trade.xlsx"
dbms=xlsx out=work.eu_sports_trade_import replace
;
sheet = eu_sports_trade;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You inserted a semi-colon into the middle of the PROC statement.
If you get in the habit of placing the ending semi-colon for a multiple line statement on its own line you can reduce the number of times you will make this mistake. Then it will be more obvious when you scan your code that all those options are part of the single PROC statement.
proc import datafile="~/EPG1V2/data/eu_sports_trade.xlsx"
dbms=xlsx out=work.eu_sports_trade_import replace
;
sheet = eu_sports_trade;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You do not need a semicolon after the datafile= portion in your code. That seems to be the issue. By adding in the extra semicolon, that creates an incomplete proc import statement that technically wouldn't have an out= option. Hopefully that makes sense.
See below for the basic syntax :