<?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: proc format PICTURE statement: to add a prefix to only certain values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-format-PICTURE-statement-to-add-a-prefix-to-only-certain/m-p/440062#M109872</link>
    <description>&lt;P&gt;PICTURE formats support the NOEDIT option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=p0n990vq8gxca6n1vnsracr6jp2c.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p178ak2xepxr20n1302iaaxmkjgi" target="_blank"&gt;http://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=p0n990vq8gxca6n1vnsracr6jp2c.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p178ak2xepxr20n1302iaaxmkjgi&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you could code your format in this (untested) fashion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc format;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;picture numbers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;low-&amp;lt;.001 = '&amp;lt;.001' (noedit)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.001-high = '000009.999'(prefix='=' mult=1000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You may need to play with the spacing to get all values to line up properly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 25 Feb 2018 19:43:23 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-02-25T19:43:23Z</dc:date>
    <item>
      <title>proc format PICTURE statement: to add a prefix to only certain values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-PICTURE-statement-to-add-a-prefix-to-only-certain/m-p/440055#M109868</link>
      <description>&lt;P&gt;I want to display a simple pre-fix for decimal numbers contained within a variable based on the value of those decimal numbers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a series of numbers on [0,1). if the numbers are less than 0.001, then I want the number to display as '&amp;lt;.001'.&amp;nbsp; Otherwise, I want to display the original value with an equal sign in front of it ('=[original number]');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I provide a sample dataset as well as the code that I used to try to accomplish this task.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The PRINT procedure output shows that I am partly there, but not quite.&amp;nbsp; Basically, to get what I am after, the output would need to&amp;nbsp;&amp;nbsp; display '&amp;lt;0.001' instead of '&amp;lt;0.000' for the first 2 observations. The last 3 observations output the way I want them to.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope some one can help me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;picture numbers&lt;BR /&gt;low-&amp;lt;.001 = '000009.999'(prefix='&amp;lt;' mult=1000)&lt;BR /&gt;.001-high = '000009.999'(prefix='=' mult=1000);&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data have;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; input numbers;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; datalines;&lt;BR /&gt;0.0000&lt;BR /&gt;0.0001&lt;BR /&gt;0.0010&lt;BR /&gt;0.0200&lt;BR /&gt;0.0500&lt;BR /&gt;;&lt;BR /&gt;&lt;BR /&gt;proc print data=have;&lt;BR /&gt;format numbers numbers.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Feb 2018 18:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-PICTURE-statement-to-add-a-prefix-to-only-certain/m-p/440055#M109868</guid>
      <dc:creator>Varrelle</dc:creator>
      <dc:date>2018-02-25T18:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: proc format PICTURE statement: to add a prefix to only certain values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-PICTURE-statement-to-add-a-prefix-to-only-certain/m-p/440062#M109872</link>
      <description>&lt;P&gt;PICTURE formats support the NOEDIT option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=p0n990vq8gxca6n1vnsracr6jp2c.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p178ak2xepxr20n1302iaaxmkjgi" target="_blank"&gt;http://documentation.sas.com/?docsetId=proc&amp;amp;docsetTarget=p0n990vq8gxca6n1vnsracr6jp2c.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p178ak2xepxr20n1302iaaxmkjgi&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you could code your format in this (untested) fashion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc format;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;picture numbers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;low-&amp;lt;.001 = '&amp;lt;.001' (noedit)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.001-high = '000009.999'(prefix='=' mult=1000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You may need to play with the spacing to get all values to line up properly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Feb 2018 19:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-PICTURE-statement-to-add-a-prefix-to-only-certain/m-p/440062#M109872</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-25T19:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: proc format PICTURE statement: to add a prefix to only certain values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-format-PICTURE-statement-to-add-a-prefix-to-only-certain/m-p/440066#M109873</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help -- your solution worked perfectly for me.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Feb 2018 20:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-format-PICTURE-statement-to-add-a-prefix-to-only-certain/m-p/440066#M109873</guid>
      <dc:creator>Varrelle</dc:creator>
      <dc:date>2018-02-25T20:03:05Z</dc:date>
    </item>
  </channel>
</rss>

