BookmarkSubscribeRSS Feed
chirumalla
Calcite | Level 5

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.

3 REPLIES 3
LinusH
Tourmaline | Level 20

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
data_null__
Jade | Level 19

set xyz: indsname=sas-variable-name;

pradeepalankar
Obsidian | Level 7

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;

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1223 views
  • 4 likes
  • 4 in conversation