Learning SAS? Welcome to the exclusive online community for all SAS learners.

ERROR 180-322: Statement is not valid or it is used out of proper order.

Reply
Occasional Contributor
Posts: 18

ERROR 180-322: Statement is not valid or it is used out of proper order.

I am trying to import an excel file into SAS but I am surprised to see this error.

 

This is my code.

Proc import out= Death.affidavit Datafile= "C:\SAS University Edition\myfolder\Affidavitdeath2016_Fullerton.csv" Dbms= csv replace;
sheet= "Affidavitdeath2016_Fullerton";
GETNAMES= YES;
RUN;

 

The log says ERROR 180-322: Statement is not valid or it is used out of proper order.

Super User
Posts: 19,770

Re: ERROR 180-322: Statement is not valid or it is used out of proper order.

Posted in reply to ayushupadhyay22

Include the full log. It should also say something about valid paths.

Importing data in SAS UE requires that you move the file to the shared folder myfolders or map a custom folder.

 

See the instructions here:

https://support.sas.com/software/products/university-edition/faq/SAS_accessdata_Excel.htm

Super User
Posts: 11,343

Re: ERROR 180-322: Statement is not valid or it is used out of proper order.

Posted in reply to ayushupadhyay22

I don't believe that CSV supports the sheet option because CSV files are only one "flat" file.

 

Copy from the log file the code and any error messages. Then paste into the code box opened with the {i} icon in this forum. The error messages will include underscore characters that help diagnose issues and the code box will retain the formatting to show where SAS is indicating the issue.

Ask a Question
Discussion stats
  • 2 replies
  • 267 views
  • 5 likes
  • 3 in conversation