<?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: how to character variable keep right side alignment in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622717#M183202</link>
    <description>&lt;P&gt;&lt;STRONG&gt;THEN WHAT IS YOUR "POINT OF VIEW"?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I have sufficiently proven that the contents are right-aligned, in the data and in LISTING output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Note tralaing.&lt;BR /&gt;There is no correct alignment as my point of view&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Feb 2020 14:19:39 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-02-06T14:19:39Z</dc:date>
    <item>
      <title>how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622684#M183191</link>
      <description>&lt;P&gt;data have ;&lt;/P&gt;
&lt;P&gt;input number ;&lt;/P&gt;
&lt;P&gt;cards ;&lt;/P&gt;
&lt;P&gt;22.34&lt;/P&gt;
&lt;P&gt;3.4&lt;/P&gt;
&lt;P&gt;33&lt;/P&gt;
&lt;P&gt;323.322&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;I have above data set Now how to keep right side alignment with data type is character .&lt;/P&gt;
&lt;P&gt;have...&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;want&lt;/P&gt;
&lt;P&gt;22.34&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;22.34&lt;/P&gt;
&lt;P&gt;3.4&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; &amp;nbsp;3.4&lt;/P&gt;
&lt;P&gt;33&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; &amp;nbsp; &amp;nbsp;33&lt;/P&gt;
&lt;P&gt;323.322&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;323.322&lt;/P&gt;
&lt;P&gt;How to create want variable?&lt;/P&gt;
&lt;P&gt;Note:Want is new character variable It should be in right side.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 12:22:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622684#M183191</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2020-02-06T12:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622693#M183192</link>
      <description>&lt;P&gt;Use the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=n0qscq9436n6xon1sthoejn7jpml.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;RIGHT()&lt;/A&gt; function to right-align character expressions:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
input number ;
cards ;
22.34
3.4
33
323.322
;

data want;
set have;
length char $8;
char = right(put(number,best8.));
run;

proc print data=want noobs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result (LISTING output):&lt;/P&gt;
&lt;PRE&gt;  number     char

  22.340      22.34
   3.400        3.4
  33.000         33
 323.322    323.322
&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622693#M183192</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-06T13:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622694#M183193</link>
      <description>Thanq for your reply.&lt;BR /&gt;However it is not working and then alignment not coming properly in dataset</description>
      <pubDate>Thu, 06 Feb 2020 13:22:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622694#M183193</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2020-02-06T13:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622695#M183194</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you want to right-align the text in the dataset or in a report using these data?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622695#M183194</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-06T13:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622697#M183195</link>
      <description>In dataset only....</description>
      <pubDate>Thu, 06 Feb 2020 13:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622697#M183195</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2020-02-06T13:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622698#M183196</link>
      <description>&lt;P&gt;It &lt;STRONG&gt;IS&lt;/STRONG&gt; right-aligned. Just take a short look at the result I posted. Note that most output destinations apart from LISTING will automatically left-align all character values, and discard any leading blanks. But that does NOT change the value stored in the variables. If you want further proof, run this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
length char $8;
char = right(put(number,best8.));
char_hex = put(char,$hex16.);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and you will see the blanks (hex 20) in the variable.&lt;/P&gt;
&lt;P&gt;Please state exactly what you are aiming for.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622698#M183196</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-06T13:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622700#M183197</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;In dataset only....&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Where it IS right-aligned, see my previous post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you see in the Table Viewer does not reflect the alignment correctly because it uses a proportional font (where the blanks are narrower than the characters).&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:33:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622700#M183197</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-06T13:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622701#M183198</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't rely on the viewer to assess the alignment (the font has not the same size for all characters : a dot is "smaller" than a digit, ..)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an alternative to the right function, you can also use the '-r' modifier in the put statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	char=put(number, best8. -r);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:37:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622701#M183198</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-06T13:37:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622703#M183199</link>
      <description>Thanq for your reply.&lt;BR /&gt;However coming tralaing spaces.&lt;BR /&gt;[image: image.png]</description>
      <pubDate>Thu, 06 Feb 2020 13:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622703#M183199</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2020-02-06T13:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622705#M183200</link>
      <description>&lt;P&gt;In the code example I gave you, you can see in the hex display that there are NO trailing spaces stored AT ALL.&lt;/P&gt;
&lt;P&gt;If you run different code, show us.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 13:45:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622705#M183200</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-06T13:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622711#M183201</link>
      <description>Note tralaing.&lt;BR /&gt;There is no correct alignment as my point of view</description>
      <pubDate>Thu, 06 Feb 2020 14:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622711#M183201</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2020-02-06T14:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622717#M183202</link>
      <description>&lt;P&gt;&lt;STRONG&gt;THEN WHAT IS YOUR "POINT OF VIEW"?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I have sufficiently proven that the contents are right-aligned, in the data and in LISTING output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Note tralaing.&lt;BR /&gt;There is no correct alignment as my point of view&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 14:19:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622717#M183202</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-06T14:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622720#M183203</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanq for your reply.&lt;BR /&gt;However coming tralaing spaces.&lt;BR /&gt;[image: image.png]&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you want to insert a picture use the Insert Photos icon on the forum editor.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 14:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622720#M183203</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-06T14:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to character variable keep right side alignment</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622751#M183213</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Note tralaing.&lt;BR /&gt;There is no correct alignment as my point of view&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my occasionally humble opinion the alignment of values in a data set is completely irrelevant.&lt;/P&gt;
&lt;P&gt;Since alignment really only affects people reading the data for most cases then when the data is written out in a report is when any alignment becomes important. And the reporting procedures have a number of methods to adjust alignment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of if the data is to be written to a text file read by another program then use appropriate syntax to align things at the time the text file is created.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 16:03:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-character-variable-keep-right-side-alignment/m-p/622751#M183213</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-02-06T16:03:17Z</dc:date>
    </item>
  </channel>
</rss>

