Hello,
I need to create a table based on observation and keep the table name.
data test1;
input var1 $;
datalines;
a
b
c
;
run;
data test2;
input var1 $;
datalines;
a
b
c
d
;
run;
My output should be:
data test1;
input var1 $;
datalines;
a
b
c
;
run;
data test2;
input var1 $;
datalines;
a
b
c
d
;
run;
PROC SQL noprint;
create table work.wanted as
select memname , nobs
from dictionary.tables
where LIBNAME='WORK' and memname in ('TEST1','TEST2') and memtype='DATA';
QUIT;
/* end of program */
Koen
Huh?
Are you asking how to find out how many observations are in your datasets?
proc sql ;
create tables want as
select libname,memname,nobs from dictionary.tables
where libname='WORK'
;
quit;
proc print;
run;
data test1;
input var1 $;
datalines;
a
b
c
;
run;
data test2;
input var1 $;
datalines;
a
b
c
d
;
run;
PROC SQL noprint;
create table work.wanted as
select memname , nobs
from dictionary.tables
where LIBNAME='WORK' and memname in ('TEST1','TEST2') and memtype='DATA';
QUIT;
/* end of program */
Koen
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.