☑ This topic is solved.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 12-16-2022 10:14 AM
(917 views)
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:
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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