Help using Base SAS procedures

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

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

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

libname ashish "/folders/myfolders";
proc import datafile="/folders/myfolders/Car_sales.csv" out=Car_sales dbms=csv replace;getnames=yes;
proc copy in=work out=ashish;
select Car_sales;
proc print data=ashish.Car_sales;
IF Price_in_thousands='.' then delete;
run;


Capture.JPG


Accepted Solutions
Solution
‎08-13-2016 04:04 AM
Super User
Posts: 19,815

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

[ Edited ]

If you want to modify the data set you need to use a data step. 

data filtered;
set ashish.car_sales;
where not missing(price_in_thousands);
run;

 

If you want to filter the results to display in Proc print then use a where. 

 

Where not missing(price_in_thousands );

 

 

 

 

View solution in original post


All Replies
Super User
Posts: 11,343

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

Proc print does not allow If or delete.

 

To show the records where a specific condition is needed use a WHERE clause:

 

WHERE Price_in_Thousands ne . ;

 

Solution
‎08-13-2016 04:04 AM
Super User
Posts: 19,815

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

[ Edited ]

If you want to modify the data set you need to use a data step. 

data filtered;
set ashish.car_sales;
where not missing(price_in_thousands);
run;

 

If you want to filter the results to display in Proc print then use a where. 

 

Where not missing(price_in_thousands );

 

 

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 729 views
  • 2 likes
  • 3 in conversation