BookmarkSubscribeRSS Feed

[디렉토리] 공백이 포함된 디렉토리 읽기

Started ‎06-15-2020 by
Modified ‎06-15-2020 by
Views 123

* 출처 : https://amadeus.co.uk/sas-tips/reading-a-file-list-into-a-data-set/;

* Reading a File List into a Data Set; 

 

%macro read_data;

data dirlist;

  infile dirlist missover pad;

  input filename $255.;

run;

%mend;

 

* 공백이 포함된 디렉토리를 읽는 경우 일반적으로 따옴표를 사용;

filename dirlist PIPE 'dir "D:\SAS DATA" /B';

%read_data;

 

 

%let file_path= D:\SAS DATA;

 

%macro read_data;

data dirlist;

  infile dirlist missover pad;

  input filename $255.;

run;

%mend;

 

* Macro 변수를 활용한 경우 반복된 쌍따옴표를 사용;

filename dirlist PIPE "dir ""&file_path"" /b";

%read_data;

Version history
Last update:
‎06-15-2020 02:15 AM
Updated by:
Contributors

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Article Labels
Article Tags