<?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 How to put '0' in format '0.00' and '0.000' in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-0-in-format-0-00-and-0-000/m-p/408748#M99824</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some '0' values in my table. When I put it in character format :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put (x,best.)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then list in&amp;nbsp;the table using &lt;U&gt;&lt;STRONG&gt;Proc Report:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define var2 / " Column_name " style(header)=[cellwidth=10.5%] style(column)=[just=d posttext='    '] ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I receive the following issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The column where I have just zero values&lt;U&gt;&lt;STRONG&gt; and values without decimal&lt;/STRONG&gt; &lt;/U&gt;are shifted right (&amp;nbsp;I marked green the line that should be shifted left ). I think that put '0' in the view' '0.000' will be enough to align the figures to the center. Have you ever faced the issue and what could be a solution for the case?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16311i811AD772F724EF55/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.jpg" alt="2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Oct 2017 15:40:02 GMT</pubDate>
    <dc:creator>DmytroYermak</dc:creator>
    <dc:date>2017-10-30T15:40:02Z</dc:date>
    <item>
      <title>How to put '0' in format '0.00' and '0.000'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-0-in-format-0-00-and-0-000/m-p/408748#M99824</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some '0' values in my table. When I put it in character format :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put (x,best.)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then list in&amp;nbsp;the table using &lt;U&gt;&lt;STRONG&gt;Proc Report:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define var2 / " Column_name " style(header)=[cellwidth=10.5%] style(column)=[just=d posttext='    '] ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I receive the following issue:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The column where I have just zero values&lt;U&gt;&lt;STRONG&gt; and values without decimal&lt;/STRONG&gt; &lt;/U&gt;are shifted right (&amp;nbsp;I marked green the line that should be shifted left ). I think that put '0' in the view' '0.000' will be enough to align the figures to the center. Have you ever faced the issue and what could be a solution for the case?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2.jpg" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/16311i811AD772F724EF55/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.jpg" alt="2.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 15:40:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-0-in-format-0-00-and-0-000/m-p/408748#M99824</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-10-30T15:40:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to put '0' in format '0.00' and '0.000'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-0-in-format-0-00-and-0-000/m-p/408784#M99835</link>
      <description>Well put using a different format, like 4.2 or 5.3.&lt;BR /&gt;Even though I'm a bit allergic about storing continues numerical values as strings, buti assume that you have very specific display requirements.</description>
      <pubDate>Mon, 30 Oct 2017 16:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-0-in-format-0-00-and-0-000/m-p/408784#M99835</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-10-30T16:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to put '0' in format '0.00' and '0.000'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-0-in-format-0-00-and-0-000/m-p/409191#M99959</link>
      <description>&lt;P&gt;Are you attempting to align decimal points in character values? I don't think that is what the decimal align expects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also creating a character value&amp;nbsp;with Put can create leading spaces which are significant when it comes to attempting to align anything.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please look at this code:&lt;/P&gt;
&lt;PRE&gt;data junk;
   x=0;
   y1= quote( put(x,best.) );
   y2= quote( put(x,best3.) );
   y3= quote( put(x,best5.) );
   y4= quote( put(x,best. -L) );
run;&lt;/PRE&gt;
&lt;P&gt;The quotes in the various Y values are to outline the resulting blanks in the created variable. Any format length longer than the value needs, except the Z format for leading 0's, will create leading blanks unless the -L option (to left justify the result)&amp;nbsp;on the Put function is used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 15:58:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-0-in-format-0-00-and-0-000/m-p/409191#M99959</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-10-31T15:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to put '0' in format '0.00' and '0.000'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-0-in-format-0-00-and-0-000/m-p/409900#M100180</link>
      <description>&lt;P&gt;The solution was offered by one kind colleague:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;define var2 / "Cohort XXXX" style(header)=[cellwidth=11.5%] style(column)=[just=c protectspecialchars=off pretext="\qj\tqdec\tx800 "] ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thus special 'report' code was used:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;[just=c protectspecialchars=off pretext="\qj\tqdec\tx800 "] &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where 800 can vary to shift the text. It is important to keep space after 800.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 16:01:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-0-in-format-0-00-and-0-000/m-p/409900#M100180</guid>
      <dc:creator>DmytroYermak</dc:creator>
      <dc:date>2017-11-02T16:01:41Z</dc:date>
    </item>
  </channel>
</rss>

