Hello Fellow SAS Users
I am a new User from R to SAS. R studio has amazing cheat sheets for dplyl that does data wrangling.
Does SAS offers anywhere a one or two page cheat sheet that has functions for data wrangling (join merge tables etc) using PROC SQL?
Good question, @triunk! Welcome to SAS. I'm not sure about something so concise specifically about PROC SQL, but would be very interested if there is one. Here are a few things I do know about:
This sasCommunity.org page links to many resources on PROC SQL. If you're able to invest some time, there are some really interesting papers that delve into what you can all do with queries. This page is a "cheat sheet" on the various clauses you can use. I've been meaning to get around to improving the SQL joins page; I have an in progress outline, but need to spend more time to iron it out. If anybody wants to help, I'd be happy to discuss further.
There's also PROC SQL vs. DATA Step which links to several papers that talk about the differences and advantages/disadvantages of using SQL or a DATA step for processing data.
There is also this cheat sheet (not published by SAS), which doesn't mention PROC SQL, but has good tips about other SAS procedures and functions.
Good question, @triunk! Welcome to SAS. I'm not sure about something so concise specifically about PROC SQL, but would be very interested if there is one. Here are a few things I do know about:
This sasCommunity.org page links to many resources on PROC SQL. If you're able to invest some time, there are some really interesting papers that delve into what you can all do with queries. This page is a "cheat sheet" on the various clauses you can use. I've been meaning to get around to improving the SQL joins page; I have an in progress outline, but need to spend more time to iron it out. If anybody wants to help, I'd be happy to discuss further.
There's also PROC SQL vs. DATA Step which links to several papers that talk about the differences and advantages/disadvantages of using SQL or a DATA step for processing data.
There is also this cheat sheet (not published by SAS), which doesn't mention PROC SQL, but has good tips about other SAS procedures and functions.
SQL is not a SAS technology. SAS provides a function which implements ANSI SQL which is a separate language. You can learn, and get tips sheets from various places, one of the simplest is:
https://www.w3schools.com/sql/
They have a quick reference.
To add to that, you can also use SAS functions in the SQL code, but note that this is not compliant if moving the code to another database or passing through the SQL. Much the same, if you take SQL from a database that has functions/syntax not in ANSI SQL then it will not work without changes in proc sql unless you use pass through to the database in question.
This link is really cool! thank you!
One difference between an enterprise/proprietary product and R which is open source, is the documentation.
SAS documentation (not cheat sheets) is actually quite thorough on its coverage of topics and how things can be used. Additionally, there's a repository of user written papers/tutorials on LexJansen.com
I would highly, highly suggest understanding how the SAS documentation works. If you're looking for specifically on how to combine data, this section is helpful:
R package "dplyr" was written in SQL, I believe. I might be wrong. You can find a lot of SAS papers of Proc Sql at lexjansen.com. Here is the one for the beginners.
Here's a link to some Base SAS "tip sheets" published by SAS. Not PROC SQL, but very helpful for programming using various components of the SAS language.
@Yavuz are these eBooks? I'm always looking to grow my library, both digital and otherwise.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.