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?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.