Hi, I would like to use a macrovariable in filename in a macro, but it gives error NOTE: Argument 1 to function DNUM(0) at line 41 column 69 is invalid. ERROR: Invalid DO loop control information, either the INITIAL or TO expression is missing or the BY expression is missing, zero, or invalid. File doesn't seem to open. pathname is created earlier as C:\Users\ydang\OneDrive - Prinses Maxima Centrum\CDM_share\Briga share\ %macro basefile2 (pathname, haveseq ); %let path=cats(strip("&studypath"),strip("&pathname")); data have1; rc=filename('xx','&path'); did=dopen('xx'); do i=1 to dnum(did); fname=dread(did,i); output; end; rc=dclose(did); run; %put path; %mend basefile2; %basefile2 (01 Source\20230609,1); It works fine if I use: rc=filename('xx',C:\Users\ydang\OneDrive - Prinses Maxima Centrum\CDM_share\Briga share\01 Source\20230609
... View more