SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Debugging and Testing DATA Steps
Understanding DATA Step Processing


At the end of the first iteration of the DATA step, three default actions occur. First, the values in the program data vector are written to the new data set as the first observation.


PDV writes to new data set

Second, control returns to the top of the DATA step. Third, SAS retains the values of variables that were read from a SAS data set with the SET statement, or that were created by a sum statement. All other variable values, such as the variable Interest, are set to missing.


Control returns to top of the Data Step.

NOTE: When SAS reads raw data, the situation is different. In that case, SAS sets the value of each variable in the DATA step to missing at the beginning of each iteration, with these exceptions:
  • variables named in a RETAIN statement
  • variables created in a sum statement
  • data elements in a _TEMPORARY_ array
  • any variables created by using options in the FILE or INFILE statements
  • automatic variables.

back||next


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

Terms of Use & Legal Information | Privacy Statement