<?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: right/left  justified variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/right-left-justified-variables/m-p/149556#M39458</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Haikuo!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Sep 2014 23:57:14 GMT</pubDate>
    <dc:creator>Tal</dc:creator>
    <dc:date>2014-09-17T23:57:14Z</dc:date>
    <item>
      <title>right/left  justified variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/right-left-justified-variables/m-p/149554#M39456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;i have a char variable that need to be filled with |||| to the left and 2 zeros to the right&lt;/P&gt;&lt;P&gt;and write to an output file with&amp;nbsp; a length of 19 (pos 2 to position 20)&lt;/P&gt;&lt;P&gt;so if the variable is "aaaaaaaaaa"&lt;/P&gt;&lt;P&gt;then it needs to be displayed as&amp;nbsp;&amp;nbsp;&amp;nbsp; |||||||aaaaaaaaaa00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The zeros&amp;nbsp; are easy to be added&amp;nbsp; but the ||| no clue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also another char var (length=16) that needs to be right justified with zeros&lt;/P&gt;&lt;P&gt;so it the var is bbbbbbbbbb it will be 000000bbbbbbbbbb&amp;nbsp; in the&amp;nbsp; output&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;anyone please &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 20:34:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/right-left-justified-variables/m-p/149554#M39456</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2014-09-17T20:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: right/left  justified variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/right-left-justified-variables/m-p/149555#M39457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sure there will be many solutions, here is two of them, _var1--tranwrd() and _var2--substr()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; _var1 var1 _var2 $ &lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;19&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;var=&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;"aaaaaaaaaa"&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;var1=cats(var,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'00'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;_var1=tranwrd(right(var1),&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'|'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;_var2=repeat(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'|'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;18&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;substr(_var2,&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;19&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;-length(var)-&lt;/SPAN&gt;&lt;SPAN style="color: teal; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;)=cats(var,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'00'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Or _var3:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;_var3=cats(repeat('|',19-length(var)-3),var,'00');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 21:05:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/right-left-justified-variables/m-p/149555#M39457</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-09-17T21:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: right/left  justified variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/right-left-justified-variables/m-p/149556#M39458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Haikuo!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Sep 2014 23:57:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/right-left-justified-variables/m-p/149556#M39458</guid>
      <dc:creator>Tal</dc:creator>
      <dc:date>2014-09-17T23:57:14Z</dc:date>
    </item>
  </channel>
</rss>

