<?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 on character variables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598541#M16304</link>
    <description>The format is CHAR,&lt;BR /&gt;and there are too many values under the variable. I need to narrow it down. Hence trying to figure out how to use PROC Format on CHAR variables.</description>
    <pubDate>Tue, 22 Oct 2019 21:52:28 GMT</pubDate>
    <dc:creator>haider_imam</dc:creator>
    <dc:date>2019-10-22T21:52:28Z</dc:date>
    <item>
      <title>proc format on character variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598539#M16302</link>
      <description>&lt;P&gt;hello I have a variable which is in character format for e.g.&amp;nbsp; var PPP&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PPP&lt;/P&gt;&lt;P&gt;400&lt;/P&gt;&lt;P&gt;401&lt;/P&gt;&lt;P&gt;402&lt;/P&gt;&lt;P&gt;403&lt;/P&gt;&lt;P&gt;404&lt;/P&gt;&lt;P&gt;405&lt;/P&gt;&lt;P&gt;406&lt;/P&gt;&lt;P&gt;407&lt;/P&gt;&lt;P&gt;408&lt;/P&gt;&lt;P&gt;409&lt;/P&gt;&lt;P&gt;410&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to take everything from 400 to 405 and make it 405 and for 406 to 410 make it 410. This is what I tried&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&amp;nbsp;&lt;/P&gt;&lt;P&gt;value pppfmt&lt;/P&gt;&lt;P&gt;400 -&amp;lt; 405 = 405&lt;/P&gt;&lt;P&gt;406 -&amp;lt; 410 = 410;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data table1;&amp;nbsp;&lt;/P&gt;&lt;P&gt;set table;&amp;nbsp;&lt;/P&gt;&lt;P&gt;format ppp pppfmt.;&lt;/P&gt;&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I get an error in the data step saying the format could not be uploaded, I think it has to do with the fact I am using the technique used for formatting numbers on characters.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 21:46:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598539#M16302</guid>
      <dc:creator>haider_imam</dc:creator>
      <dc:date>2019-10-22T21:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: proc format on character variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598540#M16303</link>
      <description>&lt;P&gt;If they're numbers you could just round it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PPP_CAT = round(input(PPP, 8.) +2.5, 5);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Adding 2.5 ensures it will always round correctly to the value of interest. Make sure to test the boundaries though, ie 400, 405.&amp;nbsp;&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/261224"&gt;@haider_imam&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;hello I have a variable which is in character format for e.g.&amp;nbsp; var PPP&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PPP&lt;/P&gt;
&lt;P&gt;400&lt;/P&gt;
&lt;P&gt;401&lt;/P&gt;
&lt;P&gt;402&lt;/P&gt;
&lt;P&gt;403&lt;/P&gt;
&lt;P&gt;404&lt;/P&gt;
&lt;P&gt;405&lt;/P&gt;
&lt;P&gt;406&lt;/P&gt;
&lt;P&gt;407&lt;/P&gt;
&lt;P&gt;408&lt;/P&gt;
&lt;P&gt;409&lt;/P&gt;
&lt;P&gt;410&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to take everything from 400 to 405 and make it 405 and for 406 to 410 make it 410. This is what I tried&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc format;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;value pppfmt&lt;/P&gt;
&lt;P&gt;400 -&amp;lt; 405 = 405&lt;/P&gt;
&lt;P&gt;406 -&amp;lt; 410 = 410;&lt;/P&gt;
&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data table1;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set table;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;format ppp pppfmt.;&lt;/P&gt;
&lt;P&gt;run;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but I get an error in the data step saying the format could not be uploaded, I think it has to do with the fact I am using the technique used for formatting numbers on characters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 21:49:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598540#M16303</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-22T21:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: proc format on character variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598541#M16304</link>
      <description>The format is CHAR,&lt;BR /&gt;and there are too many values under the variable. I need to narrow it down. Hence trying to figure out how to use PROC Format on CHAR variables.</description>
      <pubDate>Tue, 22 Oct 2019 21:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598541#M16304</guid>
      <dc:creator>haider_imam</dc:creator>
      <dc:date>2019-10-22T21:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc format on character variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598542#M16305</link>
      <description>&lt;P&gt;You need a character format to format character variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format; 
   value $pppfmt
      '400'-'405'='405'
      '406'-'410'='410'
   ;
   quit; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Oct 2019 21:54:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598542#M16305</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2019-10-22T21:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: proc format on character variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598545#M16306</link>
      <description>Yeah, but you can convert it to numeric and convert it back to character, I forgot that part. As long as the rule is as originally indicated it would work fine. &lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;PPP_CAT = put(round(input(PPP, 8.) +2.5, 5), 8. -l);&lt;BR /&gt;&lt;BR /&gt;Otherwise data null has provided a character format. Be careful with order though for character, because the order is character based. So 1, 10, 100 is less than 2, 20, 200 in character forms.</description>
      <pubDate>Tue, 22 Oct 2019 21:59:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598545#M16306</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-22T21:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc format on character variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598551#M16308</link>
      <description>Any chance these are ICD codes?</description>
      <pubDate>Tue, 22 Oct 2019 22:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/proc-format-on-character-variables/m-p/598551#M16308</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-22T22:16:47Z</dc:date>
    </item>
  </channel>
</rss>

