hello all sas experts:
i have a folder that stored a lot of datasets from different years. the dataset are: Cinfo2004 to Cinfo2021, Ginfo2006 to Ginfo2021, Ginfo_Geocode2010 to Ginfo_Geocode2021.
I would like to create a sas code to list all data files in the directory by providing the earliest and latest years for each type of the dataset. for example Cinfo’s earliest year is 2004 and the latest is 2021 and Ginfo's earliest year is 2006 and the latest is 2021.
i know there is a way to write a sas code to pull out these information but don't know how to do it.
Are these SAS data sets or some other file type?
You can read all the file names in a folder into a SAS data set.
https://communities.sas.com/t5/SAS-Programming/How-to-List-all-the-files-in-a-folder/td-p/674065
From there you can pick the ones you want.
Thank you
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.