<?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: Not able to assign format in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258884#M268999</link>
    <description>&lt;P&gt;That code you have posted works fine for me in a clean SAS session, and I get the correct results. &amp;nbsp;Therefore I would suggest that either 1) Your data does not actually look like the example you give - maybe you have a space before the value? or 2) your format is not being written to the file, or loaded correctly, maybe there is already a format called that existing and you can't overwrite. &amp;nbsp;I would suggest starting a fresh session, pasting the code you present here into your new session and running it, as it looks fine to me, so something else is at fault.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Mar 2016 17:19:42 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-03-24T17:19:42Z</dc:date>
    <item>
      <title>Not able to assign format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258866#M268995</link>
      <description>&lt;P&gt;Data Practice_PFormat;&lt;BR /&gt;Input Fname $ Lname $ Title Salary grade $;&lt;BR /&gt;cards4;&lt;BR /&gt;Henry Ford 1 25000 A&lt;BR /&gt;Greg Robert 2 35000 B&lt;BR /&gt;John Smith 3 40000 D&lt;BR /&gt;Henry Will 4 45000 F&lt;BR /&gt;Kile Jason 5 50000 I&lt;BR /&gt;;;;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;value NTitle&lt;BR /&gt;1='AM'&lt;BR /&gt;2='M'&lt;BR /&gt;3-5='SM';&lt;/P&gt;&lt;P&gt;value $Ngrade&lt;BR /&gt;'A'='Good'&lt;BR /&gt;'B'='Fair'&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data practice_pformat;&lt;BR /&gt;set practice_pformat;&lt;BR /&gt;format title ntitle. grade ngrade.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After writing the code above, i am not able to assign grades to my table&amp;nbsp;&lt;SPAN&gt;Practice_PFormat&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 16:27:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258866#M268995</guid>
      <dc:creator>saurabhvrm</dc:creator>
      <dc:date>2016-03-24T16:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to assign format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258868#M268996</link>
      <description>&lt;P&gt;How are you attempting to assign grades to the table? Do you get an error or unexpected results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, your format statement should be:&lt;/P&gt;
&lt;P&gt;format title ntitle. grade &lt;STRONG&gt;$&lt;/STRONG&gt;ngrade.;&lt;/P&gt;
&lt;P&gt;as you have declared the format to be character. This could be an issue if you ever have character and numeric formats with the same name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 16:38:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258868#M268996</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-03-24T16:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to assign format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258875#M268997</link>
      <description>&lt;PRE&gt;Data Practice_PFormat;
Input Fname $ Lname $ Title Salary grade $;
cards4;
Henry Ford 1 25000 A
Greg Robert 2 35000 B
John Smith 3 40000 D
Henry Will 4 45000 F
Kile Jason 5 50000 I
;;;;	
run;

proc format;
value NTitle
1='AM'
2='M'
3-5='SM';

value $Ngrade
'A'='Good'
'B'='Fair'
'C'-'F'='Poor'
'I'='Fail'
;
run;

data practice_pformat;
set practice_pformat;
format title ntitle. grade $ ngrade.;
run;&lt;/PRE&gt;&lt;P&gt;I have updated the code above, for anyone getting a grade from 'c' to 'f' the grade should get get updated to "Poor", but after running the code, the output&amp;nbsp;still shows the grade as d,f,i for john,henry,kyle respectively. Snapshot attached&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12403i083A62DAEF9D8344/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;</description>
      <pubDate>Thu, 24 Mar 2016 17:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258875#M268997</guid>
      <dc:creator>saurabhvrm</dc:creator>
      <dc:date>2016-03-24T17:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to assign format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258882#M268998</link>
      <description>&lt;P&gt;Are you using SAS UE? Check the forum for a note, I think there's some know issues with formats within SAS UE and they provide the workarounds. It was posted this week.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It works fine on my machine (SAS 9.3 Base).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 17:18:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258882#M268998</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-03-24T17:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to assign format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258884#M268999</link>
      <description>&lt;P&gt;That code you have posted works fine for me in a clean SAS session, and I get the correct results. &amp;nbsp;Therefore I would suggest that either 1) Your data does not actually look like the example you give - maybe you have a space before the value? or 2) your format is not being written to the file, or loaded correctly, maybe there is already a format called that existing and you can't overwrite. &amp;nbsp;I would suggest starting a fresh session, pasting the code you present here into your new session and running it, as it looks fine to me, so something else is at fault.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 17:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258884#M268999</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-24T17:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to assign format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258886#M269000</link>
      <description>&lt;P&gt;It really looks like the bug described in &lt;A href="http://support.sas.com/kb/57/730.html" target="_blank"&gt;Problem Note 57730&lt;/A&gt;. (Cf. also &lt;A href="https://communities.sas.com/t5/SAS-Studio/Workaround-available-for-bug-in-SAS-Studio-3-4-and-3-5/m-p/258252/highlight/true#M324" target="_blank"&gt;this recent post&lt;/A&gt;.)&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 17:21:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258886#M269000</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-03-24T17:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to assign format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258889#M269001</link>
      <description>&lt;P&gt;thank you so much everyone, it was a problem of format existing already, i thought it should be overwritten when i run the code again.&lt;/P&gt;&lt;P&gt;worked correctly in a new session.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 17:32:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258889#M269001</guid>
      <dc:creator>saurabhvrm</dc:creator>
      <dc:date>2016-03-24T17:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to assign format</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258890#M269002</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/77264"&gt;@saurabhvrm&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;...&amp;nbsp;i thought it should be overwritten when i run the code again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Indeed, it should be overwritten. That's what the bug Reeza and I mentioned consists in.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Mar 2016 17:36:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Not-able-to-assign-format/m-p/258890#M269002</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-03-24T17:36:16Z</dc:date>
    </item>
  </channel>
</rss>

