SQL introduced with SAS after version 5. It was introduced to use some of the
powerful fuctionality of SQL. There is difference between these two methods like their terminology, process or functionality. In some cases, one is better than other.
Data sets Tables
Reading Data Sets
There is difference is how data step and proc sql works with datasets. Data step reads record sequentially to program data vector, then does some processing with it and outputs it to data set whereas proc sql puts everything in memory and does all the calculations. After that it writes all the data to data set.
Differences between these methods
Create Multiple Data sets:- DATA Step can create multiple data sets in one step whereas PROC SQL requires several SELECT clauses to create multiple data sets.
Reading Text File: In Data step, you can read text file where as PROC SQL can’t.
**Joining Table:**PROC SQL can join multiple tables those don’t have key variables in common where as Data step requires common named key of same format columns to merge. Data step can not provide cartesian product.
You can also refer below link:-