Hi Community,
I would like to see if there are variables in the dataset that have a birthday or dob information in them. The input datasets are in CSV and there are more than 100K files. The following code seems fine if the input filename has no space or special character in it. However, there are many original filenames with space or special characters as the example below, fij k-1, so the code cannot work. I need help to tackle it as the original names in CSV don't allow to alter.
Thank you for your help.
%Macro CSV(filename); options obs=5; options validvarname=any; options validmemname=extend; proc import out=&filename datafile="&dir\&filename..csv" dbms=csv; run;
proc sql; create table keep as select memname, name ,format from dictionary.columns where libname='WORK' and ( (index(upcase(name),'BIRTH')>0) or (index(upcase(name),'DOB')>0))
AND
((index(format, 'MMDDYY')>0) or (index(format, 'DATE')>0))
; quit;
data list; set keep; Directoryname="&dir"; rename memname=Filename name=Variable; run;
%Mend CSV;
%let dir=C:\abc\ef g ;
%CSV(fij k-1)
... View more