The SAS Output Delivery System and reporting techniques

How to include a leading blank in a macro variable ?

Accepted Solution Solved
Reply
Regular Contributor
Posts: 173
Accepted Solution

How to include a leading blank in a macro variable ?


Hello everyone,

I would like to create a macro variable for a texted value such as ' in July'.  Notice there is a leading blank ahead of the word 'in'.  Here is how i define the macro variable:

%let month =  in July;  (there is a leading blank to the left of the word 'in')

SAS automatically removes the leading and training blanks for a macro variable and as a result the leading blank is removed.  How can I include the leading blank for a macro variable?

Thank you very much Smiley Happy


Accepted Solutions
Solution
‎07-23-2014 11:47 AM
Trusted Advisor
Posts: 1,203

Re: How to include a leading blank in a macro variable ?

%let month =%str(  in July);

View solution in original post


All Replies
Solution
‎07-23-2014 11:47 AM
Trusted Advisor
Posts: 1,203

Re: How to include a leading blank in a macro variable ?

%let month =%str(  in July);

Regular Contributor
Posts: 173

Re: How to include a leading blank in a macro variable ?

Thank you stat@sas!  That worked beautifully.  Smiley Happy

☑ This topic is SOLVED.

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

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