SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Understanding DATA Step Processing
Execution Phase


After the DATA step is compiled, it is ready for execution. During the execution phase, the data portion of the data set is created. The data portion contains the data values.


Descriptor and Data Portions of Data Set

During execution, each observation in the input data set is processed, stored in the program data vector, and then written to the new data set as an observation, unless otherwise directed. The DATA step executes once for each observation in the input data set, unless otherwise directed. For example, this DATA step reads values from the file Invent and executes nine times because there are nine records in the file.
     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---+-
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 



back||next


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

Terms of Use & Legal Information | Privacy Statement