BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Sassy_lady
Obsidian | Level 7

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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;

 

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

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;

 

Sassy_lady
Obsidian | Level 7
Ok thank you.
brzcol
SAS Employee

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  :

 

brzcol_1-1664224365834.png

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 3 replies
  • 2076 views
  • 2 likes
  • 3 in conversation