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?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.