%STR

Accepted Solution Solved
Reply
Super Contributor
Posts: 1,040
Accepted Solution

%STR

Hi Team,

In the code below I am curious to know the function of %str( )

The meaning of it.

%macro dothis;

%let varnames=APPLE BAT CAT DOG ;

ods pdf file='yourfile.pdf";

%do ii=1 %to %sysfunc(countw(&varnames));

     %let thisvar=%scan(&varnames,&ii,%str( ));

Regards


Accepted Solutions
Solution
‎10-17-2012 10:38 AM
Super User
Posts: 17,912

Re: %STR

See the example in the SAS DOCS with the heading below:

http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#z3514str.htm

Example 2: Protecting a Blank So That It Will Be Compiled As Text

Basically if you weren't using macro code it would be equivalent to using a " " or saying the separator is a space.

View solution in original post


All Replies
Solution
‎10-17-2012 10:38 AM
Super User
Posts: 17,912

Re: %STR

See the example in the SAS DOCS with the heading below:

http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#z3514str.htm

Example 2: Protecting a Blank So That It Will Be Compiled As Text

Basically if you weren't using macro code it would be equivalent to using a " " or saying the separator is a space.

Super Contributor
Posts: 1,040

Re: %STR

Hi,

Thanks for the reply. I was trying to use the Macro u gave for a different shell but confused on the way how to use it. I will input my ideas on what I have to do . Could you please correct me if I am wrong?

☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 219 views
  • 0 likes
  • 2 in conversation