SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Understanding DATA Step Processing
Execution Phase


Next, the value for Total is calculated based on the current values for InStock and BackOrd. The RUN statement indicates the end of the DATA step.
     data perm.update;
        infile invent;
        input Item $ 1-13 IDnum $ 15-19
              Instock 21-22 BackOrd 24-25;
        Total=instock+backord;
     run;

Raw Data File Invent
1---+----10---+----20---+V
Bird Feeder   LG088  3 20 
6 Glass Mugs  SB082  6 12
Glass Tray    BQ049 12  6 
Padded Hangrs MN256 15 20 
Jewelry Box   AJ498 23  0 
Red Apron     AQ072  9 12 
Crystal Vase  AQ672 27  0 
Picnic Basket LS930 21  0 
Brass Clock   AN910  2 10 


Assignment Statement Executes

SAS Data Set Perm.Update
Item IDnum InStock BackOrd Total
Bird Feeder LG088 3 20 23



back||next


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

Terms of Use & Legal Information | Privacy Statement