<?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: add format to existing varaible without change the values in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Proc-format-add-format-to-existing-varaible-without-change-the/m-p/627127#M20490</link>
    <description>&lt;P&gt;The&amp;nbsp;&lt;EM&gt;values&lt;/EM&gt; never change by assigning a format, only the&amp;nbsp;&lt;EM&gt;display&lt;/EM&gt;. If you want to see both formatted and raw values in a dataset viewer, you need to have two variables, one with and one without the format.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Feb 2020 08:20:21 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-02-25T08:20:21Z</dc:date>
    <item>
      <title>Proc format: add format to existing varaible without change the values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-format-add-format-to-existing-varaible-without-change-the/m-p/627123#M20488</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to add format to variable x .&lt;/P&gt;
&lt;P&gt;When I look at values of X in data set b I see that the values are the formatted values and not the original values.&lt;/P&gt;
&lt;P&gt;Why did it happen?&lt;/P&gt;
&lt;P&gt;What is the way to solve it?&lt;/P&gt;
&lt;P&gt;I want to keep have the original values of X (222,333,444,555)&amp;nbsp; but with a formatted values&amp;nbsp; in behind (abcd,efgh,aabb,ddnn)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data a;
input x ;
cards;
222
333
444
555
;
Run;

proc format;
value FFmt
222='abcd'
333='efgh'
444='aabb'
555='ddnn'
;
Run;

Data b;
set a;
format x FFmt.;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Feb 2020 08:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-format-add-format-to-existing-varaible-without-change-the/m-p/627123#M20488</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2020-02-25T08:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format: add format to existing varaible without change the values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-format-add-format-to-existing-varaible-without-change-the/m-p/627126#M20489</link>
      <description>&lt;P&gt;Do you want the formatted value to be in another variable or?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 08:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-format-add-format-to-existing-varaible-without-change-the/m-p/627126#M20489</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-02-25T08:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format: add format to existing varaible without change the values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-format-add-format-to-existing-varaible-without-change-the/m-p/627127#M20490</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;EM&gt;values&lt;/EM&gt; never change by assigning a format, only the&amp;nbsp;&lt;EM&gt;display&lt;/EM&gt;. If you want to see both formatted and raw values in a dataset viewer, you need to have two variables, one with and one without the format.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Feb 2020 08:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-format-add-format-to-existing-varaible-without-change-the/m-p/627127#M20490</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-25T08:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format: add format to existing varaible without change the values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-format-add-format-to-existing-varaible-without-change-the/m-p/627154#M20494</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159549"&gt;@Ronein&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this answer your question?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
	invalue $in_FFmt '222'='abcd' '333'='efgh' '444'='aabb' '555'='ddnn';
	value   $FFmt 'abcd'=222 'efgh'=333 'aabb'=444 'ddnn'=555;
Run;

Data a;
	input x $in_FFmt.;
	cards;
222
333
444
555
;
Run;

title "Without format (= real stored value)";
proc print noobs data=a;
run;

title "With format";
proc print noobs data=a;
	format x $FFmt.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Feb 2020 11:21:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-format-add-format-to-existing-varaible-without-change-the/m-p/627154#M20494</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-25T11:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc format: add format to existing varaible without change the values</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Proc-format-add-format-to-existing-varaible-without-change-the/m-p/627182#M20497</link>
      <description>&lt;P&gt;Changing the format only changes how the data is displayed, it does not change the data.&lt;/P&gt;
&lt;P&gt;Perhaps you want to use a different format that shows both the raw and formatted values (code and decode)?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value FFmt_both
222='222 abcd'
333='333 efgh'
444='444 aabb'
555='555 ddnn'
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Feb 2020 14:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Proc-format-add-format-to-existing-varaible-without-change-the/m-p/627182#M20497</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-02-25T14:05:51Z</dc:date>
    </item>
  </channel>
</rss>

