<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Incorporating &amp;quot;%&amp;quot; in SAS variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536787#M147561</link>
    <description>&lt;P&gt;No, there is nothing wrong with the shell, these kind of summary statistics are something quite generic.&amp;nbsp; However I have never put the statistic text in a macro variable.&amp;nbsp; Take a means output:&lt;/P&gt;
&lt;PRE&gt;proc means...;
  ...
  output out=stats n=n mean=mean stddev=stddev...;
run;

data want (keep=col1 ord trt1);
  set stats;
  length col1 trt1 $50;
  ord=1;
  col1="N";
  trt1=strip(put(n,best.));
  output;
  ord=2;
  col1="Mean (SD)";
  trt1=strip(put(mean,8.3))||" ("||strip(put(stddev,8.4))||")";
  output;
...
run;&lt;/PRE&gt;
&lt;P&gt;Shows one simple manual datastep where values are transposed out into their correct pieces (formatted as text to get %'s and other symbols in), with the stats column being put in.&amp;nbsp; You can simplify it a bit, and a lot of companies have macros to o these kind of things already.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Feb 2019 15:39:41 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2019-02-19T15:39:41Z</dc:date>
    <item>
      <title>Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536766#M147550</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a variable which will have value like "ABZ%ABZ". How can I create a variable which will contain this variable without the warning that Apparent invocation of macro ABZ nor resolved. Can somebody Guide?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinny&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 16:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536766#M147550</guid>
      <dc:creator>VinnyR</dc:creator>
      <dc:date>2019-02-19T16:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536768#M147552</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let var=%nrstr(ABZ%ABZ);

%put &amp;amp;=var;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;%put &amp;amp;=var;&lt;BR /&gt;VAR=ABZ%ABZ&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 15:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536768#M147552</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-02-19T15:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536771#M147554</link>
      <description>&lt;P&gt;The question would be why?&amp;nbsp; % is a macro trigger language, so its really not a good idea to put it in there, or you will just need to keep superquoting or wrapping it to make it work.&amp;nbsp; I can guarentee there are better methods to achieve whatever your outcome is.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 15:17:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536771#M147554</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-19T15:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536777#M147557</link>
      <description>&lt;P&gt;Thanks for your replies. Please check the shell Extract that I am supposed to present the data in with the expected naming. DO you think it's unreasonable? and why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 15:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536777#M147557</guid>
      <dc:creator>VinnyR</dc:creator>
      <dc:date>2019-02-19T15:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536778#M147558</link>
      <description>Thanks Novinosrin</description>
      <pubDate>Tue, 19 Feb 2019 15:30:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536778#M147558</guid>
      <dc:creator>VinnyR</dc:creator>
      <dc:date>2019-02-19T15:30:02Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536787#M147561</link>
      <description>&lt;P&gt;No, there is nothing wrong with the shell, these kind of summary statistics are something quite generic.&amp;nbsp; However I have never put the statistic text in a macro variable.&amp;nbsp; Take a means output:&lt;/P&gt;
&lt;PRE&gt;proc means...;
  ...
  output out=stats n=n mean=mean stddev=stddev...;
run;

data want (keep=col1 ord trt1);
  set stats;
  length col1 trt1 $50;
  ord=1;
  col1="N";
  trt1=strip(put(n,best.));
  output;
  ord=2;
  col1="Mean (SD)";
  trt1=strip(put(mean,8.3))||" ("||strip(put(stddev,8.4))||")";
  output;
...
run;&lt;/PRE&gt;
&lt;P&gt;Shows one simple manual datastep where values are transposed out into their correct pieces (formatted as text to get %'s and other symbols in), with the stats column being put in.&amp;nbsp; You can simplify it a bit, and a lot of companies have macros to o these kind of things already.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 15:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536787#M147561</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-19T15:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536792#M147564</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/158682"&gt;@VinnyR&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for your replies. Please check the shell Extract that I am supposed to present the data in with the expected naming. DO you think it's unreasonable? and why?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Maybe it is to late, but why do you need that in a macro-variable? Please post more information, preferable not as attachments.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 15:41:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536792#M147564</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-02-19T15:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536800#M147568</link>
      <description>&lt;P&gt;To produce text output, use a data step.&lt;/P&gt;
&lt;P&gt;In a data step, you can easily take precautions against unwanted resolution of macro triggers.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 16:02:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536800#M147568</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-19T16:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536801#M147569</link>
      <description>I did use data step</description>
      <pubDate>Tue, 19 Feb 2019 16:04:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536801#M147569</guid>
      <dc:creator>VinnyR</dc:creator>
      <dc:date>2019-02-19T16:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536802#M147570</link>
      <description>Sorry, that was a mistake, rectified!</description>
      <pubDate>Tue, 19 Feb 2019 16:04:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536802#M147570</guid>
      <dc:creator>VinnyR</dc:creator>
      <dc:date>2019-02-19T16:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536803#M147571</link>
      <description>&lt;P&gt;Then why do you store data in macro variables instead of a dataset or a text file?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/158682"&gt;@VinnyR&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I did use data step&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 16:06:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536803#M147571</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-19T16:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536804#M147572</link>
      <description>That was a mistake, I have edited the initial post</description>
      <pubDate>Tue, 19 Feb 2019 16:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536804#M147572</guid>
      <dc:creator>VinnyR</dc:creator>
      <dc:date>2019-02-19T16:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536806#M147573</link>
      <description>&lt;P&gt;Use single quotes instead of double quotes. The macro processor does not resolve macro triggers inside of single quotes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ....;
  ...
  myvar =  'ABZ%ABZ';
  ....
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Feb 2019 16:18:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536806#M147573</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-02-19T16:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536807#M147574</link>
      <description>Just use single instead of double/normal quotes.</description>
      <pubDate>Tue, 19 Feb 2019 16:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536807#M147574</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-02-19T16:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: Incorporating "%" in SAS variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536822#M147577</link>
      <description>&lt;P&gt;Thanks all for your contributions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vinny&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 17:05:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Incorporating-quot-quot-in-SAS-variable/m-p/536822#M147577</guid>
      <dc:creator>VinnyR</dc:creator>
      <dc:date>2019-02-19T17:05:19Z</dc:date>
    </item>
  </channel>
</rss>

