<?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 outputing more than one variable in proc freq in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772063#M31032</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;i was asked to print obervations with &lt;STRONG&gt;5&lt;/STRONG&gt; highest frequencies from a big dataset. i did this to order the frequency in descending order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC FREQ DATA = WEEK6.THCICSAMP ORDER = FREQ;&lt;BR /&gt;TABLES ADMITTING_DIAG PRINC_DIAG_CODE;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;but i want to print , so i tried to create a new data set with only my frequencies for the 2 variables, sort by decreasing frequencies and use proc print :&lt;/P&gt;
&lt;P&gt;PROC FREQ DATA = WEEK6.THCICSAMP STACKODSOUTPUT NOPRINT;&lt;BR /&gt;TABLES ADMITTING_DIAG PRINC_DIAG_CODE /OUT = WEEK6.FREQDIAG;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;i noticed that the new data set week6.freqdiaq i created has only one of the variable, PRINC_DIAG_CODE. how can i get all my variables out into the new dataset please?&lt;/P&gt;</description>
    <pubDate>Tue, 05 Oct 2021 04:07:45 GMT</pubDate>
    <dc:creator>Banke</dc:creator>
    <dc:date>2021-10-05T04:07:45Z</dc:date>
    <item>
      <title>outputing more than one variable in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772063#M31032</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;i was asked to print obervations with &lt;STRONG&gt;5&lt;/STRONG&gt; highest frequencies from a big dataset. i did this to order the frequency in descending order.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC FREQ DATA = WEEK6.THCICSAMP ORDER = FREQ;&lt;BR /&gt;TABLES ADMITTING_DIAG PRINC_DIAG_CODE;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;but i want to print , so i tried to create a new data set with only my frequencies for the 2 variables, sort by decreasing frequencies and use proc print :&lt;/P&gt;
&lt;P&gt;PROC FREQ DATA = WEEK6.THCICSAMP STACKODSOUTPUT NOPRINT;&lt;BR /&gt;TABLES ADMITTING_DIAG PRINC_DIAG_CODE /OUT = WEEK6.FREQDIAG;&lt;BR /&gt;RUN;&lt;/P&gt;
&lt;P&gt;i noticed that the new data set week6.freqdiaq i created has only one of the variable, PRINC_DIAG_CODE. how can i get all my variables out into the new dataset please?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 04:07:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772063#M31032</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-10-05T04:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: outputing more than one variable in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772070#M31033</link>
      <description>You need two TABLES statements ,and combine them later by data step.&lt;BR /&gt;&lt;BR /&gt;PROC FREQ DATA = WEEK6.THCICSAMP NOPRINT;&lt;BR /&gt;TABLES ADMITTING_DIAG /OUT = WEEK6.ADMITTING_DIAG ;&lt;BR /&gt;TABLES PRINC_DIAG_CODE /OUT = WEEK6.PRINC_DIAG_CODE ;&lt;BR /&gt;RUN;</description>
      <pubDate>Tue, 05 Oct 2021 06:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772070#M31033</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-10-05T06:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: outputing more than one variable in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772239#M31039</link>
      <description>&lt;P&gt;Thank you so much, I wanted to do it all in one step.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 18:06:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772239#M31039</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-10-05T18:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: outputing more than one variable in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772246#M31041</link>
      <description>&lt;P&gt;the variables in the two dataset i have created have similar names, so if i use merge command in my datastep, one will overwrite the other, do i have to rename the observations? they both have count and percentage of frequency count in common as variable names. do i also have to create a common variable like ID number to merge them ?&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 18:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772246#M31041</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-10-05T18:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: outputing more than one variable in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772247#M31042</link>
      <description>&lt;P&gt;You could use ODS.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC FREQ DATA = WEEK6.THCICSAMP ORDER = FREQ;
TABLES ADMITTING_DIAG PRINC_DIAG_CODE;
ods output onewayfreqs=out;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 18:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772247#M31042</guid>
      <dc:creator>Watts</dc:creator>
      <dc:date>2021-10-05T18:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: outputing more than one variable in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772261#M31044</link>
      <description>&lt;P&gt;When&amp;nbsp; I wanted to print out the observations though, I noticed the PRINC_DIAG_CODE variable is blank&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Olajumoke_0-1633461979747.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64378i6F5E649D5D39BFF9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Olajumoke_0-1633461979747.png" alt="Olajumoke_0-1633461979747.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 19:26:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772261#M31044</guid>
      <dc:creator>Banke</dc:creator>
      <dc:date>2021-10-05T19:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: outputing more than one variable in proc freq</title>
      <link>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772400#M31071</link>
      <description>&lt;P&gt;yes. you need rename it before set them all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc freq data=sashelp.class noprint ;
table weight/out=weight(rename=(weight=vname));
table age/out=age(rename=(age=vname));
run;

data want;
 set weight age indsname=dsn;
 dsname=dsn;
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Oct 2021 11:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/outputing-more-than-one-variable-in-proc-freq/m-p/772400#M31071</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2021-10-06T11:16:44Z</dc:date>
    </item>
  </channel>
</rss>

