DATA Step, Macro, Functions and more

PROC SQL cheat sheet

Accepted Solution Solved
Reply
Contributor
Posts: 20
Accepted Solution

PROC SQL cheat sheet

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?


Accepted Solutions
Solution
‎11-08-2017 12:02 PM
Regular Contributor
Posts: 213

Re: PROC SQL cheat sheet

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


All Replies
Solution
‎11-08-2017 12:02 PM
Regular Contributor
Posts: 213

Re: PROC SQL cheat sheet

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.

Super User
Super User
Posts: 9,211

Re: PROC SQL cheat sheet

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.

Contributor
Posts: 20

Re: PROC SQL cheat sheet

This link is really cool! thank you!

Super User
Posts: 22,845

Re: PROC SQL cheat sheet

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...

 

 

 

 

Super Contributor
Posts: 284

Re: PROC SQL cheat sheet

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

Regular Contributor
Posts: 213

Re: PROC SQL cheat sheet

Posted in reply to SAS_inquisitive

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.

Contributor
Posts: 20

Re: PROC SQL cheat sheet

I wanted to thank all the people who responded so quickly! This seems to be a fun community Thank you!
Contributor
Posts: 54

Re: PROC SQL cheat sheet

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.
Regular Contributor
Posts: 213

Re: PROC SQL cheat sheet

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

Contributor
Posts: 54

Re: PROC SQL cheat sheet

i mean physical real books for thesas new comer. But also tons of sas educational pdfs are in web.
Contributor
Posts: 20

Re: PROC SQL cheat sheet

Hi Yavuz I am interested to see which books you read and never used....s
☑ This topic is solved.

Need further help from the community? Please ask a new question.

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