If else sas data step

I need to write the logic

If y=1 then y=1;
else y=y+x and z=5;

Everything is normal but the second part of statement (and x=5) does not working.

Upvotes: 0

Views: 184

Answers (1)

Tom
Tom

Reputation: 51611

Sounds like you want to do this:

if y^=1 then do;
  y=y+x;
  z=5;
end;

Upvotes: 3

Related Questions