Using SAS Macro to pipe a list of filenames from a Windows directory

前端 未结 8 2183
独厮守ぢ
独厮守ぢ 2020-12-03 12:13

I am trying to amend the macro below to accept a macro parameter as the \'location\' argument for a dir command. However I cannot get it to resolve correctly due to the nes

8条回答
  •  失恋的感觉
    2020-12-03 12:56

    Based on the last sample on this page, instead of the filename statement, try

    %let filrf=pipedir;
    %let rc=%sysfunc(filename(filrf,%bquote(dir "&location" /b),pipe));
    

    and call the macro without using quotes:

    %get_filenames(c:\temp\with spaces);
    

    I also tried macro quoting, but couldn't get it to work.

提交回复
热议问题