DATA Step, Macro, Functions and more

White space in file path using pipe

Reply
Regular Learner
Posts: 1

White space in file path using pipe

Hello,

 

I would like to unzip a file via

 

%let filename = file.bz2;

%let b = D:\rawdata\zipped\&filename;

filename pipedir pipe %sysfunc(quote(D:\7ZipStandalone\7za.exe e "&b" -y -so));

 

Data mydat;

Infile pipedir;

file "D:\rawdata\zipped\unzippedfile.log";

input;

put _infile_;

run;

 

This works so far. A problem arises, if the folder name contains white space.

 

So if the path changes to "D:\7Zip Standalone\7za.exe" the code no longer works.

 

I tried using the quote, unquote and str functions (also macro versions '%') so far without success.

 

Thanks for helping!

Trusted Advisor
Posts: 1,137

Re: White space in file path using pipe

could you please try to specify a single quote inside the double quotes of the file path, something like below

" 'D:\7Zip Standalone\7za.exe' "
Thanks,
Jag
Ask a Question
Discussion stats
  • 1 reply
  • 334 views
  • 0 likes
  • 2 in conversation