If they're just merges it's pretty straightforward.
If there's functions in the SQL as well (data transformation) or other functions it can get more complicated.
This book is a good reference:
https://support.sas.com/en/books/authors/kirk-paul-lafler.html
Or try W3 school:
https://www.w3schools.com/sql/
Note that not all data step merges can be replicated in SQL, many to many merges in a data step will not align with a SQL merge for example.
Does that mean I will have to write in SQL from sketch the logic of SAS merge on a case by case basis?
@HeatherNewton wrote:
Does that mean I will have to write in SQL from sketch the logic of SAS merge on a case by case basis?
Yes!
And some of the additional sequential logic normally also being part of a SAS data step will be hard to translate into SQL / will require some PL/SQL or similar depending on the database you want to run your code.
It depends on the complexity of your queries. If they're merges without anything it's pretty straightforward.
But other data step logic, like FIRST/LAST/BY group processing can be difficult to replicate in SQL. Lag is also typically a pain.
Typically DataStage uses other relational databases for data storage. Which one will you be using? You will need to write SQL compatible with that database.
Here a SAS Docu link that might be useful to you.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.