Search code examples
sasdatastep

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.


Solution

  • Sounds like you want to do this:

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