Hi there
I would like to consolidate datasets from a library where all the datasets are stacked. I would only like to select certain columns from the dataset to be consolidated.
Hi there I would like to consolidate datasets from a library where all the datasets are stacked. I would only like to select certain columns from the dataset to be consolidated.
Note: duplicate posts combined.
You may have to provide an example of what you mean by "consolidate" and "stacked" in this context.
I would typically think "stacked" meant two or more data sets had already by appended or "consolidated" into a single set.
You may be better off leaving your data as needed and just use a WHERE statement or clause to select the variables for use at any given time than to make subsets of data.
If the tables in your source library follow a naming convention like have_1, have_2, have_3, .... then you can use the column modifier as a wildcard to address them all.
data want;
set have_:(keep=col1 col2);
run;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.