<?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: Add string with Proc Format in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411924#M67370</link>
    <description>&lt;P&gt;Add more 0s.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data numbers;
input values;
cards;
0.1119
0.2119
0.57119
-0.5134
2
40
-5
;
run;
proc format;
picture advperc
low - -1 = '0000000 %' (prefix='-/- ' mult=10000)
-1&amp;lt; -&amp;lt; 0 = '00.00 %' (prefix='-/- ' mult=10000)
0 - &amp;lt; 1  = '00.00 %' (prefix='+/+ ' mult=10000)
1 - high = '0000000 %' (prefix='+/+ ' mult=10000);
run;
proc print data = numbers;
format values advperc.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 09 Nov 2017 13:52:40 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-11-09T13:52:40Z</dc:date>
    <item>
      <title>Add string with Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411905#M67367</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need a user defined format and I never used PROC Format before and I am a bit lost here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a format like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input Value: 0.571&lt;/P&gt;&lt;P&gt;Output Value: +/+ 57,1%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Input Value: -1.3&lt;/P&gt;&lt;P&gt;Output Value: -/- 130%&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I got so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data numbers;&lt;BR /&gt;input values;&lt;BR /&gt;cards;&lt;BR /&gt;0.1119&lt;BR /&gt;0.2119&lt;BR /&gt;0.57119&lt;BR /&gt;-0.5134&lt;BR /&gt;2&lt;BR /&gt;40&lt;BR /&gt;-5&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;picture advperc&lt;BR /&gt;low -&amp;lt; 0 = '99.99 %' (prefix='-/- ' mult=10000)&lt;BR /&gt;0 - high = '99.99 %' (prefix='+/+ ' mult=10000);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print data = numbers;&lt;BR /&gt;format values advperc.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I m not quite there yet. The last 3 lines are not right.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;P&gt;Dirk&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 13:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411905#M67367</guid>
      <dc:creator>dirks</dc:creator>
      <dc:date>2017-11-09T13:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Add string with Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411919#M67368</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data numbers;
input values;
cards;
0.1119
0.2119
0.57119
-0.5134
2
40
-5
;
run;
proc format;
picture advperc
low - -1 = '00000 %' (prefix='+/+ ' mult=10000)
-1&amp;lt; -&amp;lt; 0 = '00.00 %' (prefix='-/- ' mult=10000)
0 - &amp;lt; 1 = '00.00 %' (prefix='+/+ ' mult=10000)
1 - high = '00000 %' (prefix='+/+ ' mult=10000);

run;
proc print data = numbers;
format values advperc.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Nov 2017 13:39:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411919#M67368</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-11-09T13:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Add string with Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411921#M67369</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had to add another 0 and it is working now:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 - high = '000000 %' (prefix='+/+ ' mult=10000);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Dirk&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 13:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411921#M67369</guid>
      <dc:creator>dirks</dc:creator>
      <dc:date>2017-11-09T13:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Add string with Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411924#M67370</link>
      <description>&lt;P&gt;Add more 0s.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data numbers;
input values;
cards;
0.1119
0.2119
0.57119
-0.5134
2
40
-5
;
run;
proc format;
picture advperc
low - -1 = '0000000 %' (prefix='-/- ' mult=10000)
-1&amp;lt; -&amp;lt; 0 = '00.00 %' (prefix='-/- ' mult=10000)
0 - &amp;lt; 1  = '00.00 %' (prefix='+/+ ' mult=10000)
1 - high = '0000000 %' (prefix='+/+ ' mult=10000);
run;
proc print data = numbers;
format values advperc.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Nov 2017 13:52:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411924#M67370</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-11-09T13:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Add string with Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411928#M67372</link>
      <description>&lt;P&gt;Actually this could be more simple.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data numbers;
input values;
cards;
0.1119
0.2119
0.57119
-0.5134
2
40
-5
;
run;
proc format;
picture advperc
low -&amp;lt; 0 = '0000000000.00 %' (prefix='-/- ' mult=10000)
0 - &amp;lt; high  = '0000000000.00 %' (prefix='+/+ ' mult=10000) ;
run;
proc print data = numbers;
format values advperc.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Nov 2017 13:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411928#M67372</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-11-09T13:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Add string with Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411933#M67373</link>
      <description>I just noticed that the positive numbers arent correct.&lt;BR /&gt;&lt;BR /&gt;2 should be 200, 40 is 40000 and so on.</description>
      <pubDate>Thu, 09 Nov 2017 14:03:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411933#M67373</guid>
      <dc:creator>dirks</dc:creator>
      <dc:date>2017-11-09T14:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Add string with Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411936#M67374</link>
      <description>&lt;P&gt;I don't understand.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;200=2*100&amp;nbsp; &amp;nbsp; ,whereas&amp;nbsp; &amp;nbsp; 40000=40*1000&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 14:12:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411936#M67374</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-11-09T14:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Add string with Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411937#M67375</link>
      <description>&lt;P&gt;I ve got this working now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data numbers;
input values;
cards;
 0.1119
 0.2119
 0.57119
 -0.5134
 2
 40
 -5
 ;
run; 

proc format;

picture advperc 
		low  -&amp;lt; 0		    = 	'0000.99 %' (prefix='-/- ' mult=10000)
		0   - high			=	'0000.99 %' (prefix='+/+ ' mult=10000);
run;

proc print data = numbers;
format values advperc.;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Nov 2017 14:15:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411937#M67375</guid>
      <dc:creator>dirks</dc:creator>
      <dc:date>2017-11-09T14:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Add string with Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411938#M67376</link>
      <description>&lt;P&gt;I had a typo,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 = 200, 40 = 4000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your first output gave me&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS Output&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV&gt;&lt;DIV align="center"&gt;Obs values1234567 &lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;+/+ 11.19 %&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;+/+ 21.19 %&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;+/+ 57.11 %&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-/- 51.34 %&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;+/+ 20000 %&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;+/+ 400000 %&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;-/- 50000 %&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Nov 2017 14:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411938#M67376</guid>
      <dc:creator>dirks</dc:creator>
      <dc:date>2017-11-09T14:17:31Z</dc:date>
    </item>
    <item>
      <title>Re: Add string with Proc Format</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411942#M67378</link>
      <description>&lt;P&gt;I think you should multiply 100 not 10000.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data numbers;
input values;
cards;
0.1119
0.2119
0.57119
-0.5134
2
40
-5
;
run;
proc format;
picture advperc
low -&amp;lt; 0 = '0000000000.99 %' (prefix='-/- ' mult=100)
0 - &amp;lt; high  = '0000000000.99 %' (prefix='+/+ ' mult=100) ;
run;
proc print data = numbers;
format values advperc.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Nov 2017 14:24:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Add-string-with-Proc-Format/m-p/411942#M67378</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-11-09T14:24:30Z</dc:date>
    </item>
  </channel>
</rss>

