Architecting, installing and maintaining your SAS environment

How to read sas data set having date extentions

Reply
Contributor
Posts: 41

How to read sas data set having date extentions

Hi,

I need to read sas data sets having date extension like XYZ_01_01_14, XYZ_01_02_14, XYZ_01_03_14. every month data set name will change according date and month, I wan to read XYZ data set irrespective of date extension. I don't want hardcore data set name, give me sample code will read data set.

Super User
Posts: 5,256

Re: How to read sas data set having date extentions

You'll probably need some pre-code, perhaps macro-based based logic.

This is usually very customer dependant, so it's hard to share some code that could be useful for you. Typical part of a development project.

Data never sleeps
Respected Advisor
Posts: 3,777

Re: How to read sas data set having date extentions

set xyz: indsname=sas-variable-name;

Frequent Contributor
Posts: 106

Re: How to read sas data set having date extentions

Try this:

proc sql;

select memname into :tables separated by ' ' from

dictionary.tables where substr(memname,1,3) = "XYZ";

quit;

data test;

set &tables;

run;

Ask a Question
Discussion stats
  • 3 replies
  • 519 views
  • 4 likes
  • 4 in conversation