SAS OnlineTutorback||next

Try It!
Conditionally execute several SAS statements.

Creating HTML output? Read this first.

  1. Copy the program below and paste it into the Program Editor window (or issue the command copy sashelp.oltutor..source).
    data finance.totals;
       set finance.credit;
       length Label $ 6;
       if type='D' then DTotal+transaction;
       else CTotal+transaction;
       if type='D' then label='Debit';
       else label='Credit';
    run;
    Modify the DATA step by combining the statements in the two sets of IF-THEN and ELSE statements into one set of IF-THEN and ELSE statements.

  2. Submit the DATA step and correct any errors, and then print the data set.

    Return here and select Next.

Solution

back||next

Copyright © 2002 SAS Institute Inc., Cary, NC, USA.
All rights reserved.

Terms of Use & Legal Information | Privacy Statement