datastep - Set multiple datasets with similar names in sas -


suppose have varying number of datasets in work environment, of start similar name: name_abc, name_efg, name_1ky, etc. datasets have same variables , characteristics, , want set them 1 dataset.

data bigdataset;     set [all datasets begin name_]; run; 

is there way can in sas without typing datasets? need flexible number of datasets available in work environment.

use variable name wildcard :

data bigdataset;  set name_:; run; 

a colon following variable name prefix selects variable name starts prefix. ability of colon along simple naming standards enables programmer manage temporary variables better, format many variables quicker, determine unknown number of variables, clean macro generated datasets, , shorten code variety of procs. example

data adlb; set  lb:; 

this data step reads data sets in work library begin lb. also, when programmer coded step, he/she did not need know how many dataset read, he/she wants read of dataset particular prefix. both colon , dash lists work merge statement.

quoted using sas colon effectively


Popular posts from this blog