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