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
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.