<?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 - similar value and formatted values in Programming 1 and 2</title>
    <link>https://communities.sas.com/t5/Programming-1-and-2/proc-format-similar-value-and-formatted-values/m-p/787041#M1013</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/405901"&gt;@mlm155&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks. Just to make it clear: if the FORMAT is being applied in a DATA STEP, that would change the internal value, isn't it?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, it would not. A format is really only changing how a value gets written not how it's stored.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Dec 2021 01:47:29 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2021-12-22T01:47:29Z</dc:date>
    <item>
      <title>proc format - similar value and formatted values</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/proc-format-similar-value-and-formatted-values/m-p/787038#M1010</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Just wondering how the following proc format will work;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc format;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;value myFormat 1 = 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2 = 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 = 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 = 1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Let the data be like:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Grade (original values)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;DEF&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;GHI&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JKL&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just came across something like this where the value and the formatted_value have same numbers (1 and 2).&amp;nbsp;&lt;/P&gt;&lt;P&gt;When myFormat is applied to Grade, it gives correct results as:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Grade (formatted values)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;DEF&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;GHI&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JKL&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why doesn't this change the 2nd and 3rd row grades as shown below?&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Name&lt;/TD&gt;&lt;TD&gt;Grade (formatted values)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;DEF&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;GHI&lt;/FONT&gt;&lt;/TD&gt;&lt;TD&gt;&lt;FONT color="#FF0000"&gt;2&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;JKL&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 01:20:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/proc-format-similar-value-and-formatted-values/m-p/787038#M1010</guid>
      <dc:creator>mlm155</dc:creator>
      <dc:date>2021-12-22T01:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: proc format - similar value and formatted values</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/proc-format-similar-value-and-formatted-values/m-p/787039#M1011</link>
      <description>&lt;P&gt;Bit guessing what you're asking but....&lt;/P&gt;
&lt;P&gt;A format applied to a variable with change how the variable values get WRITTEN. The format does not change the value stored in the variable.&lt;/P&gt;
&lt;P&gt;For this reason applying the format "twice" will give you twice the same result - because the internal value of the variable hasn't changed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IF you want to change the internal value then you need to assign the formatted value to the variable. Something like:&lt;/P&gt;
&lt;P&gt;new_var=put(var, myformat.);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note: A format will always return a string and though always be character. If you want to get numerical values then use the input function - input(put(var,myformat.),best32.) - or even better define and use an informat (done via Proc Format INVALUE).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 01:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/proc-format-similar-value-and-formatted-values/m-p/787039#M1011</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-12-22T01:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: proc format - similar value and formatted values</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/proc-format-similar-value-and-formatted-values/m-p/787040#M1012</link>
      <description>Thanks. Just to make it clear: if the FORMAT is being applied in a DATA STEP, that would change the internal value, isn't it?</description>
      <pubDate>Wed, 22 Dec 2021 01:44:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/proc-format-similar-value-and-formatted-values/m-p/787040#M1012</guid>
      <dc:creator>mlm155</dc:creator>
      <dc:date>2021-12-22T01:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc format - similar value and formatted values</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/proc-format-similar-value-and-formatted-values/m-p/787041#M1013</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/405901"&gt;@mlm155&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks. Just to make it clear: if the FORMAT is being applied in a DATA STEP, that would change the internal value, isn't it?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, it would not. A format is really only changing how a value gets written not how it's stored.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 01:47:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/proc-format-similar-value-and-formatted-values/m-p/787041#M1013</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-12-22T01:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc format - similar value and formatted values</title>
      <link>https://communities.sas.com/t5/Programming-1-and-2/proc-format-similar-value-and-formatted-values/m-p/787042#M1014</link>
      <description>Great, thanks!</description>
      <pubDate>Wed, 22 Dec 2021 01:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Programming-1-and-2/proc-format-similar-value-and-formatted-values/m-p/787042#M1014</guid>
      <dc:creator>mlm155</dc:creator>
      <dc:date>2021-12-22T01:51:23Z</dc:date>
    </item>
  </channel>
</rss>

