Hi Tom, Right now I have it set up to import any number of raw data files in a directory into their own respestive datasets. Hopefully the code below will show what I'm doing: %macro import_all; data file_list; length fname $45.; infile indata truncover; input fname $45.; call symput ('num_files',_n_); run; data file_list; set file_list; fname = compress(trim(fname)); sasname = scan(tranwrd(fname,"-","_"),1,'.'); %if &n_change = 1 %then %do; sasname = compress(tranwrd(sasname,&find., &replace.)); %end; run; %macro read_in; %do j = 1 %to &num_files.; data _null_; set file_list; if _n_ = &j. then do; call symput ('filein',fname); call symput ('name', sasname); end; run; %put &filein.; %put &name.; %if &state. = 1 %then %do; proc import datafile = "&filepath.\&filein." out = data.&name. dbms = dlm replace; delimiter = &delim.; getnames = yes; guessingrows = 32767; run; %end; %if &state. = 2 %then %do; proc import datafile = "&filepath.\&filein." out = data.&name. dbms = &delim. replace; getnames = yes; guessingrows = 32767; run; %end; %end; %mend read_in; There are quite a few delimited raw data files (~90) so manual operations aren't really an option. Really what a I need is a way to tell proc import to import all variables in file as say $20. I can't list the variables because they change from file to file...I messed around with a few ways to grab the variable names fro the raw files and list them in the import statement, but they have special charecters so that was giving me trouble. Obviously <getnames = yes> solves this issue for the import. I may have just thought of a way to do this, but if you have any thoughts let me know.
... View more