BookmarkSubscribeRSS Feed
max101
Calcite | Level 5

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!

2 REPLIES 2
Jagadishkatam
Amethyst | Level 16
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
KevinViel
Pyrite | Level 9

This caused issues for me.  I had IT create a environmental variable (with no spaces).  A colleague suggested that I use PROGRA~1 instead of writing the full path: https://communities.sas.com/t5/SAS-Programming/Windows-and-pipe-with-spaces-in-the-path-file-name/m-....

 

HTH,

 

Kevin

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2237 views
  • 0 likes
  • 3 in conversation