<?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 Formatting issue in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Formatting-issue/m-p/532101#M5977</link>
    <description>&lt;P&gt;I am using SAS 9.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used a format to make 'C' and 'X' both become 'Y'&lt;/P&gt;&lt;P&gt;In my frequency both C and X have become Y but they are still separate. So I now have 2 'Y's with different frequencies when I want 1 'Y' with the frequency of the 2 'Y's put together. If this doesn't make sense I can clarify but I am looking for why this would. I have used the format before on a previous data set and it worked but now for this data set it is not. My type, length, format and informat are the same for both datasets I used this format on.Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data = working.GI_ED_visits_DP0_5_013119 order=freq;&lt;BR /&gt;tables admt_cmplnt_ftdesc;&lt;BR /&gt;by chs_site_desc;&lt;BR /&gt;format site_desc $site_desc.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;VALUE $SITE_DESC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'C','X'&amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;nbsp; &amp;nbsp; &amp;nbsp;'X';&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2019 17:05:32 GMT</pubDate>
    <dc:creator>GS2</dc:creator>
    <dc:date>2019-02-01T17:05:32Z</dc:date>
    <item>
      <title>Formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Formatting-issue/m-p/532101#M5977</link>
      <description>&lt;P&gt;I am using SAS 9.4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used a format to make 'C' and 'X' both become 'Y'&lt;/P&gt;&lt;P&gt;In my frequency both C and X have become Y but they are still separate. So I now have 2 'Y's with different frequencies when I want 1 'Y' with the frequency of the 2 'Y's put together. If this doesn't make sense I can clarify but I am looking for why this would. I have used the format before on a previous data set and it worked but now for this data set it is not. My type, length, format and informat are the same for both datasets I used this format on.Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc freq data = working.GI_ED_visits_DP0_5_013119 order=freq;&lt;BR /&gt;tables admt_cmplnt_ftdesc;&lt;BR /&gt;by chs_site_desc;&lt;BR /&gt;format site_desc $site_desc.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;BR /&gt;VALUE $SITE_DESC&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'C','X'&amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;nbsp; &amp;nbsp; &amp;nbsp;'X';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 17:05:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Formatting-issue/m-p/532101#M5977</guid>
      <dc:creator>GS2</dc:creator>
      <dc:date>2019-02-01T17:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Formatting-issue/m-p/532107#M5978</link>
      <description>'C','X' = 'Y'&lt;BR /&gt;&lt;BR /&gt;Typo, Sorry!</description>
      <pubDate>Fri, 01 Feb 2019 17:10:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Formatting-issue/m-p/532107#M5978</guid>
      <dc:creator>GS2</dc:creator>
      <dc:date>2019-02-01T17:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Formatting-issue/m-p/532112#M5981</link>
      <description>&lt;P&gt;When you use a format with PROC FREQ it will collapse based on the formatted value, but the actual value it stores will be one of the values in the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't want that behavior then use the PUT() function to convert the values.&lt;/P&gt;
&lt;P&gt;Might be faster to convert AFTER collapsing with PROC FREQ.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value $site_desc
'C','X'     =     'X'
;
run;

data have ;
  input bygrp $ site $ ;
cards;
1 A
1 C
1 X
2 C
3 X
4 A
;

proc freq ;
  by bygrp;
  tables site / out=want noprint;
  format site $site_desc. ;
run;

proc print data=want;
run;
proc print data=want;
  format _all_;
run;

data want2;
  set want ;
  new_site = put(site,$site_desc.);
  format _all_;
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs    bygrp    site    COUNT    PERCENT    new_site

 1       1       A        1       33.333       A
 2       1       C        2       66.667       X
 3       2       C        1      100.000       X
 4       3       X        1      100.000       X
 5       4       A        1      100.000       A&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2019 17:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Formatting-issue/m-p/532112#M5981</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-02-01T17:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Formatting issue</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Formatting-issue/m-p/532411#M6022</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; What you're describing is not what I see. When I run a version of your program, using slightly different data, I do see that PROC FREQ collapses both C and X into 1 row for Y in PROC FREQ:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="freq_collapse.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26813iF35E7CBB4AC7168B/image-size/large?v=v2&amp;amp;px=999" role="button" title="freq_collapse.png" alt="freq_collapse.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I'm not sure what's going on with your program or data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Sun, 03 Feb 2019 16:04:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Formatting-issue/m-p/532411#M6022</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-02-03T16:04:02Z</dc:date>
    </item>
  </channel>
</rss>

