Is there an easy way to create a dataset with one observation and one variable, where the value is the number of obs in another dataset?
Thanks
@Kurt_Bremser wrote an SQL query not a DATA step statement:
proc sql;
create table want as
select nobs
from dictionary.tables
where libname = "XXXXXXX" and memname = "YYYYYY";
quit;
select nobs from dictionary.tables
where libname = "XXXXXXX" and memname = "YYYYYY";
@Kurt_Bremser wrote an SQL query not a DATA step statement:
proc sql;
create table want as
select nobs
from dictionary.tables
where libname = "XXXXXXX" and memname = "YYYYYY";
quit;
Hi @texasmfp If you are comfortable using Datastep, you could use SASHELP views that basically executes the SQL query demonstrated by @SASKiwi
So the query would look something like
data want;
set sashelp.vtable;
where libname = "XXXXXXX" and memname = "YYYYYY";
run;
SASHELP.VTABLE is a view of DICTIONARY.TABLES
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.