<?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 freq how to change the order of yes no in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282513#M57429</link>
    <description>&lt;P&gt;Consider this code snippet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data report;
  set raw;
  if raw_value = 'Y' then display_value = 0;
  else display_value = 1;
  run;

proc format;
  value display
    0 = 'YES' 
   1 = 'NO';
    run;

proc report data = report missing;
  column &amp;lt;your-columns&amp;gt;;
  ...
  define display_value / order = internal format = display.;
 ...
  run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2016 18:42:28 GMT</pubDate>
    <dc:creator>sh0e</dc:creator>
    <dc:date>2016-07-06T18:42:28Z</dc:date>
    <item>
      <title>proc freq how to change the order of yes no</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282511#M57427</link>
      <description>&lt;P&gt;As we know, If you specify ORDER=DATA, the data are displayed in the same order as they occur in the input data set.&amp;nbsp; Other options for controlling order include ORDER=FORMATTED, which orders according to the formatted values, and ORDER=FREQUENCY, which orders by descending frequency count.&lt;/P&gt;&lt;P&gt;for me, my data is not what i expect, so the tables generate has "No" comes first beore "yes"&lt;/P&gt;&lt;P&gt;when i do copy and paste to the report, it is more time consuming&lt;/P&gt;&lt;P&gt;any advice how to change the order, so the "yes" always comes first before no, for each row, and column for each table?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 18:35:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282511#M57427</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-07-06T18:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq how to change the order of yes no</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282513#M57429</link>
      <description>&lt;P&gt;Consider this code snippet&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data report;
  set raw;
  if raw_value = 'Y' then display_value = 0;
  else display_value = 1;
  run;

proc format;
  value display
    0 = 'YES' 
   1 = 'NO';
    run;

proc report data = report missing;
  column &amp;lt;your-columns&amp;gt;;
  ...
  define display_value / order = internal format = display.;
 ...
  run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 18:42:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282513#M57429</guid>
      <dc:creator>sh0e</dc:creator>
      <dc:date>2016-07-06T18:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq how to change the order of yes no</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282514#M57430</link>
      <description>&lt;P&gt;One trick is to re-format the data.&amp;nbsp; You can put a space before the yes, so it is " yes" and leave the no as "no".&amp;nbsp; If th alignment causes you issues, you can use a non-printable character (you'll need to look at your collating sequence for that).&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 18:42:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282514#M57430</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2016-07-06T18:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq how to change the order of yes no</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282526#M57434</link>
      <description>&lt;P&gt;thank you, but i am using proc freq, and with sas macro&lt;/P&gt;&lt;P&gt;i do not now how to change your code to proc freq, since i have so many tables to generate&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 19:16:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282526#M57434</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-07-06T19:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq how to change the order of yes no</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282528#M57436</link>
      <description>&lt;P&gt;Sorry about that. I'm a PROC REPORT guy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a snippet using PROC FREQ instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc freq data = report;
  format display_value display.;
  table display_value /
     missing list order=internal;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jul 2016 19:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282528#M57436</guid>
      <dc:creator>sh0e</dc:creator>
      <dc:date>2016-07-06T19:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: proc freq how to change the order of yes no</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282529#M57437</link>
      <description>&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 19:23:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-freq-how-to-change-the-order-of-yes-no/m-p/282529#M57437</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-07-06T19:23:24Z</dc:date>
    </item>
  </channel>
</rss>

