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
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.