The main advantages of data step are:
- Drop keyword. Let's imagine that you want to remove one column from a table with 2000 columns. In SQL you would have to name all columns you want to keep. But in data step it is enough to just name the column you don't want to include. Awesome.
- Wildcards. If you want to select all columns beginning with "pred_", all you have to do in data step is to write "pred_:" (note the column). In SQL you would have to write name of each predictor.
- Speed. SQL in SAS is not implemented overly effectively.
- LAG command. In SQL you have to perform a slow and cumbersome join to get the corresponding functionality.
The main advantages of SQL:
- Group by command. Simply because data step doesn't offer such functionality.
- Order by command. Again you can't sort directly in data step.
- Metadata. Queries on the metadata are so addictive!