I am using the following code to create a dataset of the file names for all SAS datasets within a specified folder (I then trim part of the filename in the second step). I want to add a second field, one that includes the number of observations in each of the named datasets. Thoughts? Thanks in advance.
proc sql;
CREATE TABLE CULL AS
select catx('.',libname,memname) into :setnames separated by ' '
from dictionary.tables
where libname = 'RESULTS';
quit;
DATA Cull ;
SET CULL;
_TEMA001=tranwrd(_TEMA001,"RESULTS.TARGETS_","");
RUN;
proc sql;
CREATE TABLE CULL AS
select catx('.',libname,memname) ,nobs into :setnames,:nobs separated by ' '
from dictionary.tables
where libname = 'RESULTS';
quit;
Like this?
proc sql;
CREATE TABLE CULL AS
select catx('.',libname,memname) ,nobs into :setnames,:nobs separated by ' '
from dictionary.tables
where libname = 'RESULTS';
quit;
Like this?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.