DATA Step, Macro, Functions and more

Will %superq also mask quotes ?

Accepted Solution Solved
Reply
Contributor
Posts: 55
Accepted Solution

Will %superq also mask quotes ?

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


Accepted Solutions
Solution
‎01-23-2018 07:41 AM
PROC Star
Posts: 275

Re: Will %superq also mask quotes ?

Posted in reply to Billybob73

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


All Replies
Solution
‎01-23-2018 07:41 AM
PROC Star
Posts: 275

Re: Will %superq also mask quotes ?

Posted in reply to Billybob73

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
Super User
Super User
Posts: 9,840

Re: Will %superq also mask quotes ?

Posted in reply to Billybob73

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.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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