SAS Tutorial | Using SAS Macro Variable Lists to Create Dynamic Data-Driven Programs

preview_player
Показать описание
The SAS® macro facility is an amazing tool for creating dynamic, flexible, reusable programs that can automatically adapt to change. In this presentation, you’ll learn how to create and use macro variable lists, a simple but powerful mechanism for creating data-driven programming logic. Don’t hardcode data values into your programs. Eliminate data dependencies forever and let the macro facility write your SAS code for you!

Content Outline
00:00:00 – Introduction
00:03:10 – Macro Language Review
00:14:51 – Exercise 1 Using Data Step
00:21:07 – Exercise 2 Using PROC SQL
00:24:53 – Creating Macro Variable Lists
00:28:16 – With PROC SQL – Horizontal list
00:32:26 – Exercise 3
00:35:18 – With PROC SQL – Vertical List
00:37:21 – Exercise 4
00:39:39 – With Data Step - Horizontal List
00:46:25 – Exercise 5
00:50:04 – With Data Step – Vertical List
00:53:07 – Exercise 6
00:56:00 – Using Macro Variable Lists
00:56:29 – Using Horizontal Macro Variable Lists
00:59:55 – Exercise 7
01:05:59 – Using Vertical Macro Variable Lists
01:09:22 – Exercise 8
01:13:46 – Conclusion

Session ID: N/A
Presenter: Joshua Horstman, Nested Loop
Topic: Programming
Industry: Non-Industry Specific
Audience: All
Level: All

Learn more about SAS Software

SUBSCRIBE TO THE SAS USERS YOUTUBE CHANNEL #SASUsers #LearnSAS #SASGF

ABOUT SAS
SAS is a trusted analytics powerhouse for organizations seeking immediate value from their data. A deep bench of analytics solutions and broad industry knowledge keep our customers coming back and feeling confident. With SAS®, you can discover insights from your data and make sense of it all. Identify what’s working and fix what isn’t. Make more intelligent decisions. And drive relevant change.

CONNECT WITH SAS
Рекомендации по теме
Комментарии
Автор

Hey Josh, I watched the rest of this video, and learned something I immediately incorporated into my SAS report (a "vertical list".) Great presentation - and thanks!

kentlewan
Автор

Great presentation, I've learned so much in a brief period of time. I'm relatively a beginner when it comes to SAS macro and I feel like a lot of the dots are connecting. Also, you're right about the Carpenter book. I've only read section one but I'm definitely ready to finish the book after watching this.

ashleymccook-veal
Автор

Great tutorial! A suggestion for this channel's moderators - Please include a link to the workshop files in the content description for this and any similar recording referencing provided files. I don't see it anywhere in the content description, so it's unclear where to get the files that Joshua has made available for viewers.

tamarabarker
Автор

I enjoyed this. proc sql is simply amazing

dominicmutiso
Автор

All the contents where really helpful thanks a lot.

nethajis
Автор

Thanks so much for posting - very helpful!

jessicasonbert
Автор

hey, I have a doubt in exercise 1. If i want the price of every individual model of acura to be stored in macro variable and then display it in new column. How is that possible. Do i have to declare seperate macros for evey model under acura.???

riteshchaudhary
Автор

Is this content thorough with everything offered in SAS Macro Language 1: Essentials or do I have to follow the SAS Macro Language 1: Essentials in SAS/Coursera platform?

dominicmutiso
Автор

Why just use 1 ampersand when you can use 3? :-)

kentlewan
Автор

how to save a filepath by macro variable??
is it like %let outpath(or any other name)="location" coz this code is not working, when I am using code ods excel file = "&otpath/xyz.xlsx" ; (and other codes after it) the excel file is not getting saved in location and I cannot export it.
Currently doing sas coursera course and Im stuck at this problem please reply...

rohitwalopkar
Автор

Hi SIr,

I have doubt in extracting the macro variables created. I am using the following code to populate new column using the vertical macro list created for class. but in the logs i can see each name is being taken but in the output column only the last name is displayed in every record. Kindly help.
Also tell the use of %macro name you are using after we end the macros.Thanks

%macro rts;
proc sql ;
select distinct name into :name1-
from sashelp.class;
%let observations= &sqlobs;
quit;

%do i=1 %to &observations;
data class_names;
set sashelp.class;
newname="&&name&i";
%put &name1;
run;
%end;
%mend rts;
%rts;

riteshchaudhary
Автор

can you please zoom the code from next time, please?

priyap
Автор

Not to be an ass but SAS reduce your licensing fees man. My firm is forcing everyone to learn "R" and "Python" and slowly reducing the dependence on SAS.

Either lower your fees or do something that "R" and "Python" can't do

iamrichie
visit shbcf.ru