BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
triunk
Obsidian | Level 7

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?

1 ACCEPTED SOLUTION

Accepted Solutions
paulkaefer
Lapis Lazuli | Level 10

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.

View solution in original post

11 REPLIES 11
paulkaefer
Lapis Lazuli | Level 10

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.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

triunk
Obsidian | Level 7

This link is really cool! thank you!

Reeza
Super User

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:

http://documentation.sas.com/?docsetId=lrcon&docsetTarget=p15jvywi5avt3cn1bee8r6c33ux1.htm&docsetVer...

 

 

 

 

SAS_inquisitive
Lapis Lazuli | Level 10

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.

 

http://www2.sas.com/proceedings/sugi30/257-30.pdf

paulkaefer
Lapis Lazuli | Level 10

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.

triunk
Obsidian | Level 7
I wanted to thank all the people who responded so quickly! This seems to be a fun community Thank you!
Yavuz
Quartz | Level 8
There are many ways to reach your target. You can use which is easy for you. For example in banks or financial institutions SAS is very common. But i see many of users dont use SAS in efficient ways.
You can create or join many tables by data/set statement easly.
If you interest i can send some books which i read and not using at all.

Data want;
Set table_1 table_2 table_n;
Run;

This is the easiest way for join many tables which i saw.
paulkaefer
Lapis Lazuli | Level 10

@Yavuz are these eBooks? I'm always looking to grow my library, both digital and otherwise.

Yavuz
Quartz | Level 8
i mean physical real books for thesas new comer. But also tons of sas educational pdfs are in web.
triunk
Obsidian | Level 7
Hi Yavuz I am interested to see which books you read and never used....s

SAS Innovate 2025: Register Now

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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 11 replies
  • 12825 views
  • 11 likes
  • 6 in conversation