Hi,
I'm reading zipfiles in a looped macro. I'm using this right now. It works.
But can I omit the %bquote to prevent the code from giving error messages on quotes ?
In other words : Does %superq also mask quotes ?
filename targzip ZIP "%bquote(%superq(targdir)/%superq(zname&i))";
Thanks
B
Yes, as it says in the manual:
The %SUPERQ function returns the value of a macro variable without attempting to resolve any macros or macro variable references in the value. %SUPERQ masks the following special characters and mnemonic operators:
& % ' " ( ) + − * / < > = ¬ ^ ~ ; , # blank AND OR NOT EQ NE LE LT GE GT IN
Yes, as it says in the manual:
The %SUPERQ function returns the value of a macro variable without attempting to resolve any macros or macro variable references in the value. %SUPERQ masks the following special characters and mnemonic operators:
& % ' " ( ) + − * / < > = ¬ ^ ~ ; , # blank AND OR NOT EQ NE LE LT GE GT IN
Why would you need to do any of that? The only reason I can think of is that your filenames contain special characters such as quotes, which is really bad practice on any system. Following some simple naming convention:
filename tagzip zip "targdir/&name&i.";
Should be sufficient. Also note, you can get rid of the whole macro looping part you have around this code by using a datastep:
data _null_; set loop; /* This is the dataset with all the names of the zips */ call execute(cats('filename targzip zip "targdir/',name,'";')); run;
You can put other call executes on there to do further processing too. This is far simpler than lists of values and do loops and all that.
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.
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.