05-13-2017 09:12 AM
I did numerous google seraches but could not find an answer. What is the syntax, if I have several statements in the if and the then part of an if the statement? This is some pseudo code:
if /* some condition */ then do; /* statements */ end; else do /* statements */ end;
The if part is fine but I am not sure about the then part.
05-13-2017 09:36 AM
You're missing a semicolon after the second DO statement.
See the examples in the documentation
Google seems broken these days. Consider searching directly at either lexjansen.com, communities.sas.com or support.sas.com
05-13-2017 10:15 AM
05-13-2017 10:22 AM
This one has a fourth example that is interesting, I wouldn't have expected that to work.
if x=0 then if y ne 0 then put 'X ZERO, Y NONZERO'; else put 'X ZERO, Y ZERO'; else put 'X NONZERO';
Need further help from the community? Please ask a new question.