From the course: SAS® 9.4 Cert Prep: Part 04 Preparing Data

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

DATA step processing

DATA step processing

- [Narrator] Let's take a quick look at how the DATA step works behind the scenes. When you run a DATA step, there are two phases, compilation and execution. In the compilation phase, SAS checks for syntax errors in the program and establishes the table metadata, including the column attributes. In the execution phase, SAS reads the table, processes it, and writes it to the output table one row at a time. DATA step execution is like an automatic loop, the first time through the DATA step, the SET statement reads row number one from the input table and then processes any other statements in sequence, manipulating the values within that row. When SAS reaches the end of DATA step, there's an implied output action, and the new row is written to the output table. The DATA step then automatically loops back to the top and executes the statements in order again, this time reading, manipulating, and outputting the second row.…

Contents