BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Billybob73
Quartz | Level 8

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

1 ACCEPTED SOLUTION

Accepted Solutions
s_lassen
Meteorite | Level 14

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

View solution in original post

2 REPLIES 2
s_lassen
Meteorite | Level 14

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
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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-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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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