September 2019
Beginner to intermediate
346 pages
7h 35m
English
We know that our Dealership_Looped table has 36 million observations. What if we wanted to store this value in a macro variable? Based on our understanding of macros from previous chapters, we will write the following command to create a macro variable with the value:
%Let n = 36000000;
In Proc SQL, the alternative is as follows:
Proc SQL; Select Count(*) Into: n_sql From Dealership_Looped;Quit;
If we run the preceding commands, then the value is 36 million:
%Put n_sql is &n_sql;n_sql is 36000000
The INTO clause is quite helpful because, without prior information on the row count, we could still create a macro variable that holds the value of the row count. This clause comes in handy when we are writing ...
Read now
Unlock full access