<?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: % STR Left align in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/STR-Left-align/m-p/297519#M62490</link>
    <description>&lt;P&gt;Yes, please show more of your macro.&amp;nbsp; Or show a simplified version that can replicate the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know ODS Report Writing Inteface, but I don't think the problem is the macro language.&amp;nbsp; For example, this works fine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    %macro table(x,y,z,var,a);
2      %put text text text &amp;amp;var;
3    %mend table;
4    %table(x,y,z, %STR( , age group (&amp;lt;16 years or &amp;gt;=16 years), gender (Male or Female).), a);
text text text  , age group (&amp;lt;16 years or &amp;gt;=16 years), gender (Male or Female).
&lt;/PRE&gt;
&lt;P&gt;I would back out of the macro, and instead try a RWI&amp;nbsp;step where you just hardcode the long text string.&amp;nbsp; And see how it &amp;nbsp;wraps, etc.&amp;nbsp;Could be some sort of hanging indent or tab or whatever.&amp;nbsp;&amp;nbsp;Try to get a simple data step&amp;nbsp;example working without macro code, then once you've done that, come back to the macro language to generate &amp;nbsp;the data step code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the data step code works like you want but the macro language generates data step code that does not work the same way, that would be surprising (and interesting).&amp;nbsp; If that happens, please post the example of the working data step code and the non-working macro code, and more folks will be able to help you investigate potential causes.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Sep 2016 01:57:23 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2016-09-10T01:57:23Z</dc:date>
    <item>
      <title>% STR Left align</title>
      <link>https://communities.sas.com/t5/SAS-Programming/STR-Left-align/m-p/297414#M62446</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a macro call where I use the %STR option. This call corresponds to a macro variable that&amp;nbsp;I use with t.format_text in RWI. When I get the output in pdf, the start of the text is left aligned but the macro call reolves to be center aligned. How do I overcome this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My code looks like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;t.format_text (&lt;FONT face="Verdana" size="2"&gt;text: &lt;/FONT&gt;&lt;FONT color="#800080" face="Verdana" size="2"&gt;"^{super[3]}&amp;nbsp;text text text&amp;nbsp;&amp;amp;var"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;, style_attr: &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color="#800080" face="Verdana" size="2"&gt;&lt;FONT color="#800080" face="Verdana" size="2"&gt;&lt;FONT color="#800080" face="Verdana" size="2"&gt;"font_size=10pt font_style=roman just=left font_weight=medium");&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;run;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800080" face="Verdana" size="2"&gt;&lt;FONT color="#800080" face="Verdana" size="2"&gt;&lt;FONT color="#800080" face="Verdana" size="2"&gt;The &lt;FONT color="#000000"&gt;macro call looks like this: &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;%&lt;STRONG&gt;&lt;I&gt;table&lt;/I&gt;&lt;/STRONG&gt;(x,y,z, &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Verdana" size="2"&gt;%STR&lt;/FONT&gt;&lt;FONT face="Verdana" size="2"&gt;( , age group (&amp;lt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;16&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt; years or &amp;gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;16&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt; years), gender (Male or Female)&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;), a); &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;The output looks like:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT color="#800080" face="Verdana" size="2"&gt;[3]&lt;/FONT&gt;text text text text ........................... text, age&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group (&amp;lt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;16&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt; years or &amp;gt;=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;16&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Verdana" size="2"&gt; years), gender (Male or Female)&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;&lt;FONT color="#008080" face="Verdana" size="2"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;How do I get rid of the space on the left in the second line of text?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;&lt;FONT face="Verdana" size="2"&gt;Thanks.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 15:00:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/STR-Left-align/m-p/297414#M62446</guid>
      <dc:creator>analyst_work</dc:creator>
      <dc:date>2016-09-09T15:00:27Z</dc:date>
    </item>
    <item>
      <title>Re: % STR Left align</title>
      <link>https://communities.sas.com/t5/SAS-Programming/STR-Left-align/m-p/297501#M62480</link>
      <description>&lt;P&gt;Can you show more of what your %table macro does? Is there anyplace before the displayed text that the macro language manipulates the variable &amp;amp;var? And is there any&amp;nbsp; chance&amp;nbsp;one or more TAB characters&amp;nbsp;are embedded in the call to %table?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 21:57:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/STR-Left-align/m-p/297501#M62480</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-09T21:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: % STR Left align</title>
      <link>https://communities.sas.com/t5/SAS-Programming/STR-Left-align/m-p/297519#M62490</link>
      <description>&lt;P&gt;Yes, please show more of your macro.&amp;nbsp; Or show a simplified version that can replicate the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know ODS Report Writing Inteface, but I don't think the problem is the macro language.&amp;nbsp; For example, this works fine:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    %macro table(x,y,z,var,a);
2      %put text text text &amp;amp;var;
3    %mend table;
4    %table(x,y,z, %STR( , age group (&amp;lt;16 years or &amp;gt;=16 years), gender (Male or Female).), a);
text text text  , age group (&amp;lt;16 years or &amp;gt;=16 years), gender (Male or Female).
&lt;/PRE&gt;
&lt;P&gt;I would back out of the macro, and instead try a RWI&amp;nbsp;step where you just hardcode the long text string.&amp;nbsp; And see how it &amp;nbsp;wraps, etc.&amp;nbsp;Could be some sort of hanging indent or tab or whatever.&amp;nbsp;&amp;nbsp;Try to get a simple data step&amp;nbsp;example working without macro code, then once you've done that, come back to the macro language to generate &amp;nbsp;the data step code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the data step code works like you want but the macro language generates data step code that does not work the same way, that would be surprising (and interesting).&amp;nbsp; If that happens, please post the example of the working data step code and the non-working macro code, and more folks will be able to help you investigate potential causes.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2016 01:57:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/STR-Left-align/m-p/297519#M62490</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2016-09-10T01:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: % STR Left align</title>
      <link>https://communities.sas.com/t5/SAS-Programming/STR-Left-align/m-p/297537#M62495</link>
      <description>&lt;P&gt;Since &amp;nbsp;&lt;FONT face="courier new,courier"&gt;,age&lt;/FONT&gt; &amp;nbsp;is at the right place, the justification from %str is fine.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So something else is wrong in your text string&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2016 10:17:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/STR-Left-align/m-p/297537#M62495</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-09-10T10:17:12Z</dc:date>
    </item>
  </channel>
</rss>

