Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lib dir '.../folder';
- #iterate through all files of dir and extract first five letters of file name;
- #open files and do some processesing, aka data steps proc steps;
- %macro get_filenames(location);
- filename _dir_ "%bquote(&location.)";
- data filenames(keep=fname);
- handle=dopen( '_dir_' );
- if handle > 0 then do;
- count=dnum(handle);
- do i=1 to count;
- fname=subpad(dread(handle,i),1,5);/* extract first five letters */
- output filenames;
- end;
- end;
- rc=dclose(handle);
- run;
- filename _dir_ clear;
- %mend;
- %get_filenames("c:temp");
- proc sql;
- create table datasets as
- select substr(memname,1,5) as dataset
- from dictionary.tables
- where libname='LIB'; /* must be uppercase */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement