<?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 How do I rename proc univariate output variables? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-rename-proc-univariate-output-variables/m-p/601503#M76383</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've written a proc univariate to calculate percentiles for a few different metrics. It works great. The problem is the output variable names are the names I've given them concatenated with the percentile amount. So pcap_br95 and so forth. I want to reference these elsewhere in my script, but I don't want to have to change the script in four places, I just want to change the percentile if necessary and run it. So I need to rename the dynamically named variables to something static.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyway to create a dataset from an existing dataset like this but only by referencing the column number or position?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc univariate data= percentile_test noprint;&lt;BR /&gt;where br &amp;gt; 0;&lt;BR /&gt;var br pr k_starts;&lt;BR /&gt;;&lt;BR /&gt;output out=mk.br_percentile&lt;BR /&gt;pctlpts= 95&lt;BR /&gt;pctlpre = pcap_br&lt;BR /&gt;pctlpre = pcap_pr&lt;BR /&gt;pctlpre = pcap_kstarts&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried creating another data set, but it requires me to name the original variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-11-04_15-27-21.png" style="width: 403px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33639i4D0DCD2DA29327E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-11-04_15-27-21.png" alt="2019-11-04_15-27-21.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Nov 2019 20:29:19 GMT</pubDate>
    <dc:creator>logistics_00</dc:creator>
    <dc:date>2019-11-04T20:29:19Z</dc:date>
    <item>
      <title>How do I rename proc univariate output variables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-rename-proc-univariate-output-variables/m-p/601503#M76383</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've written a proc univariate to calculate percentiles for a few different metrics. It works great. The problem is the output variable names are the names I've given them concatenated with the percentile amount. So pcap_br95 and so forth. I want to reference these elsewhere in my script, but I don't want to have to change the script in four places, I just want to change the percentile if necessary and run it. So I need to rename the dynamically named variables to something static.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyway to create a dataset from an existing dataset like this but only by referencing the column number or position?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc univariate data= percentile_test noprint;&lt;BR /&gt;where br &amp;gt; 0;&lt;BR /&gt;var br pr k_starts;&lt;BR /&gt;;&lt;BR /&gt;output out=mk.br_percentile&lt;BR /&gt;pctlpts= 95&lt;BR /&gt;pctlpre = pcap_br&lt;BR /&gt;pctlpre = pcap_pr&lt;BR /&gt;pctlpre = pcap_kstarts&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried creating another data set, but it requires me to name the original variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance for your help.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-11-04_15-27-21.png" style="width: 403px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33639i4D0DCD2DA29327E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-11-04_15-27-21.png" alt="2019-11-04_15-27-21.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 20:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-rename-proc-univariate-output-variables/m-p/601503#M76383</guid>
      <dc:creator>logistics_00</dc:creator>
      <dc:date>2019-11-04T20:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rename proc univariate output variables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-rename-proc-univariate-output-variables/m-p/601509#M76385</link>
      <description>&lt;P&gt;I don't know if there's a way to do this in PROC UNIVARIATE, but in PROC SUMMARY its simple and the suffix 95 does not get appended to your output variable names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data= percentile_test;
where br &amp;gt; 0;
var br pr k_starts;
output out=mk.br_percentile p95 = pcap_br pcap_pr pcap_kstarts;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Nov 2019 20:38:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-rename-proc-univariate-output-variables/m-p/601509#M76385</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-11-04T20:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rename proc univariate output variables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-rename-proc-univariate-output-variables/m-p/601513#M76386</link>
      <description>Perfect. Turns out I was asking the wrong question, I should have started with how do I calculate these percentiles. Much appreciated!&lt;BR /&gt;</description>
      <pubDate>Mon, 04 Nov 2019 20:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-rename-proc-univariate-output-variables/m-p/601513#M76386</guid>
      <dc:creator>logistics_00</dc:creator>
      <dc:date>2019-11-04T20:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rename proc univariate output variables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-rename-proc-univariate-output-variables/m-p/601518#M76387</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/298203"&gt;@logistics_00&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Perfect. Turns out I was asking the wrong question, I should have started with how do I calculate these percentiles. Much appreciated!&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;For what it may be worth, I tend to think of Proc Univariate as much more of an exploratory procedure to look at lots of information about the variables at one time. If I know that I want to summarize variables then going to the procedures that are more oriented to such like Proc Means, Summary or Freq seems more efficient plus the controls for such naming are more direct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 21:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-rename-proc-univariate-output-variables/m-p/601518#M76387</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-04T21:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I rename proc univariate output variables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-rename-proc-univariate-output-variables/m-p/601521#M76388</link>
      <description>Or change your output so that each variable goes to a unique line so whatever you're doing next can be done using by group processing.</description>
      <pubDate>Mon, 04 Nov 2019 21:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-rename-proc-univariate-output-variables/m-p/601521#M76388</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-11-04T21:37:42Z</dc:date>
    </item>
  </channel>
</rss>

