Dear experts, First of all, I'm not a great expert on the program. I am an actuary who tries to improve processes through Sas. explanation: I am working with another program called Moses and for shortening running times I split the run into several computers . The result is multiple .csv files in the local of multiple computers. I have to group them back into one file (apend) and then continue to work with a unified aggregat file. I can determine the names according to my convenience under the constraint of Quarter and Year. The problem: There are several runs in each of the folders and I have to choose each time a specific run. This means that each time I have to see the file names before importing and then choose who to import and group according to the conditions I set. Before that I used Excel to consolidate the files and I could use a "flag"\"pointer" for the run I wanted to consolidate. Hope I've been able to explain myself properly. Thank you in advance for your help! That's what I've collected so far from the forum but I get an error while creating files. %let path1=\\ayl-celerra-new\work\li\Moses\2017\Output\Check\; data filelist; keep i dnum filename; length fref $8 filename $300; rc = filename(fref,"&path1"); if rc = 0 then do; did = dopen(fref); rc = filename(fref); end; else do; length msg $200.; msg = sysmsg(); put msg=; did = .; end; if did <= 0 then putlog 'ERR' 'OR: Unable to open directory.'; dnum = dnum(did); do i = 1 to dnum; filename = dread(did, i); /* If this entry is a file, then output. */ fid = mopen(did, filename); if fid > 0 then output; end; rc = dclose(did); run; data one; set filelist; infile dummy filevar=fil2read end=done; do while(not done); input a b c; output; end; run; and I get this ERROR: 60 data one; 61 set filelist; 62 infile dummy filevar=fil2read end=done; 63 do while(not done); 64 input a b c; 65 output; 66 end; 67 run; ERROR: Invalid physical name. filename=EV0_IF2016Q4_16f_BE16.csv dnum=3 i=1 fil2read= done=0 a=. b=. c=. _ERROR_=1 _N_=1 NOTE: The SAS System stopped processing this step because of errors. NOTE: There were 1 observations read from the data set WORK.FILELIST. WARNING: The data set WORK.ONE may be incomplete. When this step was stopped there were 0 observations and 6 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds user cpu time 0.01 seconds system cpu time 0.01 seconds memory 1053.46k OS Memory 23132.00k Timestamp 03/22/2018 02:31:40 PM Step Count 3 Switch Count 57
... View more