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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 866 views
  • 0 likes
  • 3 in conversation