Error 180-322

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Error 180-322

Hey this might be be a simple error to fix, however I am new to SAS. Its a simple if/else statement which is trying to separate the variable assign.

My code is:

DATA = stats20x.stats20x2;

SET =  stats20x.stats20x;

IF assign >= 10 THEN pass_assign =1;

ELSE pass_assign = 0;

RUN;

stats20x.stats20x is the original data set and assign is a variable in that data set.

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


I keep getting this for the data, if and else commands.


Accepted Solutions
Solution
‎01-08-2015 09:19 PM
Super User
Posts: 19,157

Re: Error 180-322

Look at the code I suggested. The unnecessary  '=' sign are on the DATA and SET statements, your if statement is fine.

View solution in original post


All Replies
Super User
Posts: 19,157

Re: Error 180-322

You have some = signs that aren't required and are missing semi-colons.

DATA  stats20x.stats20x2;

SET  stats20x.stats20x;

IF assign >= 10 THEN pass_assign =1;

ELSE pass_assign = 0;

RUN;

New Contributor
Posts: 3

Re: Error 180-322

Hey sorry i fixed the semi colons, sorry i am using sas on a different computer that im typing this on. I thought >= means greater than equal to?

Solution
‎01-08-2015 09:19 PM
Super User
Posts: 19,157

Re: Error 180-322

Look at the code I suggested. The unnecessary  '=' sign are on the DATA and SET statements, your if statement is fine.

New Contributor
Posts: 3

Re: Error 180-322

Ohh thx dude u are a legend!!!!!

Respected Advisor
Posts: 3,156

Re: Error 180-322

She is Not a Dude Smiley Wink

Super User
Posts: 19,157

Re: Error 180-322

Dudette Smiley Wink

🔒 This topic is solved and locked.

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

Discussion stats
  • 6 replies
  • 228 views
  • 5 likes
  • 3 in conversation