Тёмный

SAS Tutorial | Combining Data in SAS: DATA Step Versus SQL 

SAS Users
Подписаться 33 тыс.
Просмотров 22 тыс.
50% 1

Опубликовано:

 

29 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 66   
@dominiqueweatherspoon473
@dominiqueweatherspoon473 4 года назад
Hey everyone! Thank you for watching! Leave a comment if you have any questions :)
@sydznl
@sydznl 4 года назад
Gotta love the energy you gave for this video!
@SASUsers
@SASUsers 4 года назад
We appreciate the feedback and hope you enjoyed!
@aswinip7579
@aswinip7579 4 года назад
Can you please make a video on proc template.
@qismatkamara
@qismatkamara 3 года назад
I'm trying to convert a .SQL file to SAS. How can I do it?
@SASUsers
@SASUsers 3 года назад
Thanks for your question, Qismatkamara. We're checking on it, and will get back to you soon!
@ericelkin2498
@ericelkin2498 4 года назад
Dominique, thank you for an entertaining and educational discussion of one of the greatest philosophical debates of our time (at least for us SAS nerds). I am only saddened that Angelica Schuyler is not invited to the party. She can be my +1. :-)
@dominiqueweatherspoon473
@dominiqueweatherspoon473 4 года назад
Haha I totally agree. It's an error in the data :)
@rogerward8047
@rogerward8047 4 года назад
I didn't know there was a data step debugger! Too bad I don't use IG!
@staceysyphus8238
@staceysyphus8238 4 года назад
The DATA step debugger is the best! Besides being in SAS Enterprise Guide, it's also in SAS Studio for Viya (version 5.2 or later).
@Jay-ue2ic
@Jay-ue2ic 4 года назад
I love the energy. You made a stale topic feel fresh. More videos, please!!!
@SASUsers
@SASUsers 4 года назад
Awesome! Thanks so much for the feedback!
@MrBharathbadboy
@MrBharathbadboy 4 года назад
Hi Dominique, It was a worth watching presentation and refreshed my basics. Can you please share the more details about SAS Datastep Debugger.
@SASUsers
@SASUsers 4 года назад
Hi Bharath! So glad you found the tutorial helpful! Here are some resources on the SAS Datastep Debugger that might be helpful: 2.sas.com/6059GLY2D and 2.sas.com/6050GLY2E
@himself9278
@himself9278 4 года назад
Hi Dominique, i have always been asking my self the following question, why is it that so many companies do not encourage sas programmers employees to use Proc sql?
@SASUsers
@SASUsers 4 года назад
Thanks for asking! It's hard to know for sure why an employer might do that. In some cases it could be that they are not familiar with it.
@djrisks
@djrisks 4 года назад
Great presentation Dominique! I was wondering why are you using the retain and keep statement in the DS_MERGE data set. Is the retain statement used to order the variables? Thanks.
@dominiqueweatherspoon473
@dominiqueweatherspoon473 4 года назад
Hi Kriss! Great question. Yes, the RETAIN statement is being used to order the variables. The KEEP statement is used to select variables, but not their order. So I included both statements to have the same affect as the SELECT clause in PROC SQL.
@djrisks
@djrisks 4 года назад
@@dominiqueweatherspoon473 Great, thank you for answering this!
@srinubabu1871
@srinubabu1871 3 года назад
Nice Explanation
@SASUsers
@SASUsers 3 года назад
Glad you liked the video! 👍
@JohnJones-rp2wz
@JohnJones-rp2wz 4 года назад
Awesome explanation 🙂
@SASUsers
@SASUsers 4 года назад
Glad it was helpful!
@dsingh8104
@dsingh8104 4 года назад
👏👏
@somcana
@somcana 2 года назад
Is what you call right or left table relative to how see in the screen.
@SASUsers
@SASUsers 2 года назад
Hi Somcana! We're checking on this for you, and will follow back up with more info! 👍
@SASUsers
@SASUsers 2 года назад
Hi! When you code a JOIN in SQL and explicitly use "left join" or "right join" the first table you specify in the join clause is the LEFT table and the second table you list in the join clause is the RIGHT table. For a more in-depth class on using PROC SQL for joins, you might be interested in our SQL 1 class: 2.sas.com/6056KvsFa ; for more in-depth coverage of using a DATA step MERGE, you might be interested in our Programming 2 class: 2.sas.com/6057KvsFx . Hope that information helps!
@hkia7893
@hkia7893 4 года назад
love the energy
@SGH-rt6ci
@SGH-rt6ci 2 года назад
Ms Weatherspoon - please keep up your work ! I did not know that I can use SAS On demand for FREE !!!! There are so little tutorials on SAS, please share your knowledge. THank you ! Greetings from Poland
@SASUsers
@SASUsers 2 года назад
We do offer some free e-learning and tutorials to help you #LearnSAS Register for our SAS Starter Kit to find out more information 2.sas.com/6053MkGsv
@m1cannas
@m1cannas 3 года назад
Fantastic as the topic is explained.
@SASUsers
@SASUsers 3 года назад
We're glad you enjoyed it!
@gustavvanoythen4839
@gustavvanoythen4839 2 года назад
Best explanation ever found so far Beautiful teacher Thanks you so much From germany
@SASUsers
@SASUsers 2 года назад
You're very welcome! We're so glad you enjoyed the content!
@thepineweaver
@thepineweaver 3 года назад
Great explanation!
@SASUsers
@SASUsers 3 года назад
So glad you found it helpful!
@swetathakur6708
@swetathakur6708 3 года назад
🌟 awesome
@SASUsers
@SASUsers 3 года назад
Thanks 🤗
@MohdMuddasser
@MohdMuddasser 3 года назад
Very well explained.. Would like to know more about datastep debugger
@SASUsers
@SASUsers 3 года назад
We are so glad you found the tutorial helpful! Here are some resources on the SAS Datastep Debugger that might be helpful: 2.sas.com/6059GLY2D and 2.sas.com/6050GLY2E
@michaeltuchman9656
@michaeltuchman9656 4 года назад
Great presentation. Loved the illustration and coherent organization. My question regards the use case where both input data sets are already SAS data sets, or DATA step syntax is available for an in-database calculation. For these situations, is using SQL with non-sorted data more efficient than pre-sorting data using a PROC SORT on each data step? Or, perhaps, the data are sorted, but on a different key and we don't want to re-sort. I mean, doesn't SQL internally sort if the data is not sorted on the JOIN variables? In asking this question, I am addressing those people who reflexively avoid using the SORT procedure. For the use case where both input data sets are already SAS data sets. Is using SQL with non-sorted data more efficient than pre-sorting data using a PROC SORT on each data step. Or, perhaps, the data are sorted, but on a different key and we don't want to re-sort. I mean, doesn't SQL internally sort if the data is not sorted on the JOIN variables? What about if you have three tables? btw: I used to get through what I thought was a beautiful report, only to be stopped by somebody saying a label or title was wrong. Check the spelling of the word 'diffrent' on one of your TITLE statements.
@SASUsers
@SASUsers 4 года назад
Thanks for your comments, Michael! We're checking on your questions, and will get back to you soon!
@SASUsers
@SASUsers 4 года назад
Hello again, Michael! Thanks for your thought-provoking questions, and also for pointing out the typo in the TITLE statement at time stamp 13:40. We asked SAS instructors about your efficiency questions, and they pointed out that the focus of this video is not efficiency, but a simple overview of the SQL versus DATA step approach. If you're suggesting that all SAS programmers should consider efficiency when deciding on an SQL versus a DATA step solution to a merge/join need, we agree! As you probably already know, a full discussion of efficiency techniques is well outside the scope of what can be covered here in the comments. Our instructors also said when they discuss efficiency in our advanced SAS Training classes, one possible answer to every efficiency question is always "it depends"! As we're sure you know, a diligent SAS programmer should always benchmark different techniques using the actual data or a representative sample of the actual data, and make sure they run the "competing" code on the same machine, with the same memory, and perform benchmarking to decide which method is more efficient before committing to one method over the other. If you have a specific efficiency question on your data for your production work, the best way to get an answer is by working with SAS Technical Support. We're happy to open a support track for you - please send your contact information, site number, and any other details to us at SAS_Cares@sas.com if you'd like us to do that! You're correct that there are reasons a programmer might choose using SQL over DATA step, and you've outlined some of them. If you click "Show More" to see the whole description below the video, you'll find many links to other helpful resources, including: 1) Our on-demand webinar, "What are 10 Ways to Make My SAS Code Run More Efficiently?" 2) A conference paper: "Using DATA Step MERGE and PROC SQL JOIN to Combine SAS® Datasets". This is on 2.sas.com/6050GFvWi, which indexes papers/proceedings from all the SAS regional user group conferences. If you search that site for "efficiency sql", you'll find over 2000 results! A good way to generate some thoughtful discussion on this question would be to open a thread on the SAS Programming forum in our SAS Communities: 2.sas.com/6051GFvWc. Thanks again for your comment and questions, and please let us know if we can help you with anything else!
@vincenthansa183
@vincenthansa183 4 года назад
Excellent
@prashantjain00
@prashantjain00 2 года назад
Please advice dataset debugger I am a beiginner
@SASUsers
@SASUsers 2 года назад
Hi! Let us know if this helps: 2.sas.com/6055JerTB
@laurenbutler7295
@laurenbutler7295 3 года назад
Hi Dominique, can you send a link that shows me how to make tables from my data set so I can then combine my tables to create one large table? Thanks!
@SASUsers
@SASUsers 3 года назад
Checking on this for you!
@SASUsers
@SASUsers 3 года назад
Circling back with you, Lauren! Your SAS data set is already in a table structure of rows and columns, so we're not exactly sure what you mean when you ask "how to make tables from my data set so I can then combine my tables to create one large table". If you already have a SAS table, then you would use either PROC SQL or the SAS DATA step program to combine your tables. You can combine your tables vertically, such as making a QUARTER1 table or dataset from the JANSALES, FEBSALES and MARSALES individual tables. Or you can combine your table horizontally, such as joining or merging an EMPLOYEE master file with an ORDER file to get a final table that shows which employees worked on which orders. Without knowing more about your SAS background and your data and how you envision joining the tables together, it's hard to point you to resources. The best reference would be the combination of our Programming 1 and Programming 2 classes. This SAS Community Forum posting by one of our instructors illustrates both the SET and MERGE for joining tables, with screen shots: 2.sas.com/6052H1bNM look at the 5-19-2018 posting. If you have specific questions with your data and how to combine the tables, you can send your question to Tech Support by filling out the form at this link: 2.sas.com/6053H1bN3 . Or, for some suggestions from other SAS users on links they have found useful, you might consider posting your question in the SAS Community Forum for SAS Programming questions: 2.sas.com/6054H1bNO . Happy programming!
@srinubabu1871
@srinubabu1871 3 года назад
"ELse" statement in SAS Similar to which statement in Proc SQL?
@SASUsers
@SASUsers 3 года назад
Srinu, thank you for your inquiry! We are checking on this for you!
@SASUsers
@SASUsers 3 года назад
If you are indicating, to mean which statement in SQL is equivalent to the IF/THEN/ELSE conditional logic in the DATA step. In which case it would bet SQL CASE Expression. Here is a link to the documentation that might be helpful to the customer from the SAS SQL Procedure User's Guide: Case Expression
@srinubabu1871
@srinubabu1871 3 года назад
@@SASUsers Thank you for your Prompt Response.
@thkaboutlaassa1156
@thkaboutlaassa1156 4 года назад
Could we have the data you use in the video? thank you so much.
@SASUsers
@SASUsers 4 года назад
Hi there! We're looking into this for you and will get back to you!
@SASUsers
@SASUsers 4 года назад
Thanks for your patience while we checked with our Training team on this! We do not provide the data for our tutorials. Most of our tutorial videos use data that the instructor created for the video or got from the documentation samples, used from SASHELP library, or used from one of our classes. If you take our free Programming 1 class, you would learn how to create your own test datasets such as the ones the instructor is demoing in the video. Our intent with these free tutorials is for students to watch the free tutorials and then use their own data. The SASHELP data library, which is part of every SAS installation contains over 200 datasets that you can use to practice. Here's a useful document that describes the SASHELP data 2.sas.com/6051GxiLt. Or, you look in the SAS documentation for sample data. For example, on the site for this PROC SQL example: 2.sas.com/6052GxiLQ and you will find a link to download the programs that make the STAFF file and the PAYROLL file to practice the join in the example. In addition, if you activate the free learning subscription (link below the video), you would have 30 days to practice with our SQL 1 class and in the class you would find the program that makes the data we use to teach the class. You could practice with that data. We hope that information helps!
@MasterofPlay7
@MasterofPlay7 4 года назад
can proc sql output multiple datasets just like data step or it can just create one table at a time? Thanks!
@SASUsers
@SASUsers 4 года назад
Thank you for your inquiry! We are checking on this for you!
@SASUsers
@SASUsers 3 года назад
After researching further, see if this code looks helpful: PROC SQL creates one table at a time. proc sql; create table CarsAsia as select DriveTrain, count(*) as Number, mean(MSRP) as AvgMSRP format=comma10. from 2.sas.com/6054GAHb8 where Origin='Asia' group by DriveTrain ; create table CarsEurope as select Type, count(*) as Number, mean(Invoice) as AvgInvoice format=comma10. from 2.sas.com/6054GAHb8 where Origin='Europe' group by Type ; create table CarsUSA as select * from 2.sas.com/6054GAHb8 where Origin='USA' ; quit;
@MasterofPlay7
@MasterofPlay7 3 года назад
@@SASUsers neat, didn't know you can create multiple tables within one query
Далее
SAS Tutorial | 3 Steps to Build a SAS Macro Program
14:24
SAS PROC SQL CRASH COURSE (PART 1): SQL for Beginners
25:56
Witch changes monster hair color 👻🤣 #shorts
00:51
КВН 2024 Встреча выпускников
2:00:41
ПОЮ ВЖИВУЮ🎙
3:19:12
Просмотров 879 тыс.
Катаю тележки  🛒
08:48
Просмотров 534 тыс.
SAS Tutorial | 5 Ways to Make Your SAS Code Run Faster
17:58
The Power of SAS SQL
1:05:34
Просмотров 10 тыс.
The Battle of SAS R and Python in Banking
12:32
Просмотров 13 тыс.
Solving one of PostgreSQL's biggest weaknesses.
17:12
Просмотров 197 тыс.
SAS Tutorial | Step-by-Step PROC SQL
50:29
Просмотров 76 тыс.
What does a Data Analyst actually do? (in 2024) Q&A
14:27
SAS DATA STEP Crash Course:  Learn SAS in Under an Hour!
55:42
Witch changes monster hair color 👻🤣 #shorts
00:51