SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating Variables
Assigning Values Conditionally


Question: Write a statement to create the variable AllSales when the condition in the IF-THEN statement that is shown below is false. Specify that AllSales accumulate values of the variable Sales down all observations.
     data income.qtr1rpt;
        set region.revenue;
        if sales=. then Tag='Check missing value.';
        
     run;

           

  back||next

 

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

Terms of Use & Legal Information | Privacy Statement