Controlling Program Flow |
The IF-THEN/ELSE statement executes a statement or group of statements based on a condition that you specify.
IF expression THEN statement; |
<ELSE statement;> |
if (exist(table)) then _msg_='SAS table already exists.'; else do; call new(table,'',1,'y'); _msg_='Table has been created.'; end;
Suppose your application is designed to run in batch mode and you do not want to generate any messages. You could use a null statement after THEN:
if (exist(table)) then; else call new(table,'',1,'y');
For more information, refer to SAS Language Reference: Dictionary.
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.