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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.