<?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 to get labels in proc means output dataset ? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57935#M16168</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc means data=sashelp.heart noprint nway;&lt;/P&gt;&lt;P&gt; class status sex;&lt;/P&gt;&lt;P&gt; var ageatstart;&lt;/P&gt;&lt;P&gt; output out = want ( drop&amp;nbsp; = _: )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n=base_unwtd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum=cnt_unwtd &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mean=per_unwtd /autolabel;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*** /autolabel will append the original variable label with the stat calculated i.e.. AgeAtStart_N;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=sashelp.heart noprint nway;&lt;/P&gt;&lt;P&gt; class status sex;&lt;/P&gt;&lt;P&gt; var ageatstart;&lt;/P&gt;&lt;P&gt; output out = want ( drop&amp;nbsp; = _: )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n=base_unwtd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum=cnt_unwtd &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mean=per_unwtd /noinherit;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*** /noinherit will leave the label null;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Aug 2011 14:56:57 GMT</pubDate>
    <dc:creator>FriedEgg</dc:creator>
    <dc:date>2011-08-31T14:56:57Z</dc:date>
    <item>
      <title>How to get labels in proc means output dataset ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57933#M16166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is my code which works fine in numerous different places but not at one point:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-size: 8pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 8pt;"&gt;&lt;SPAN style="color: #000080; font-size: 8pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 8pt;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-family: Courier New; color: #000080; font-size: 8pt;"&gt;&lt;STRONG style="color: #000080; font-size: 8pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080; font-size: 8pt; font-family: Courier New;"&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;PROC &lt;STRONG style="color: #000080; font-size: 8pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080; font-size: 8pt; font-family: Courier New;"&gt;&lt;STRONG style="color: #000080; font-size: 8pt; font-family: Courier New;"&gt;MEANS&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: Courier New;"&gt;DATA&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: Courier New;"&gt;=AGE_GRP &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: Courier New;"&gt;NOPRINT&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: Courier New;"&gt;NWay&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Courier New; font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: Courier New;"&gt;CLASS &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;TIME_PERIOD MARKET ;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: Courier New;"&gt;VAR &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;age;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: Courier New;"&gt;OUTPUT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: Courier New;"&gt;OUT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;=AGE_UNWTDMEANS(DROP=_TYPE_ _FREQ_) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: Courier New;"&gt;n&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;=BASE_UNWTD &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: Courier New;"&gt;SUM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;=CNT_UNWTD &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: Courier New;"&gt;MEAN&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;=PER_UNWTD;&lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;STRONG style="color: #000080; font-size: 8pt; font-family: Courier New;"&gt;&lt;STRONG style=": ; color: #000080; font-size: 8pt; font-family: Courier New;"&gt;RUN&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-family: Courier New; font-size: 8pt;"&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Courier New; font-size: 8pt;"&gt;&lt;SPAN style="color: #000000;"&gt;;&lt;/SPAN&gt;&lt;SPAN style="font-family: Courier New; font-size: 8pt;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;The output dataset gives the variable names correctly as BASE_UNWTD, CNT_UNWTD AND PER_UNWTD but the labels for these variables is "AGE" and I want it to be the same as the variable name.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;I have used the EXACT same code for a different variable and it works !!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;(Sorry if this ques is too basic but I'm having a hard time giving the correct labels to variables in the output dataset.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: Courier New;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="mcePaste" id="_mcePaste" style="position: absolute; width: 1px; height: 1px; overflow: hidden; top: 0px; left: -10000px;"&gt;﻿&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 14:28:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57933#M16166</guid>
      <dc:creator>Xinxin</dc:creator>
      <dc:date>2011-08-31T14:28:42Z</dc:date>
    </item>
    <item>
      <title>How to get labels in proc means output dataset ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57934#M16167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I run your code I do get the same names for both variable names and labels.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 14:51:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57934#M16167</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-31T14:51:23Z</dc:date>
    </item>
    <item>
      <title>How to get labels in proc means output dataset ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57935#M16168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;proc means data=sashelp.heart noprint nway;&lt;/P&gt;&lt;P&gt; class status sex;&lt;/P&gt;&lt;P&gt; var ageatstart;&lt;/P&gt;&lt;P&gt; output out = want ( drop&amp;nbsp; = _: )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n=base_unwtd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum=cnt_unwtd &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mean=per_unwtd /autolabel;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*** /autolabel will append the original variable label with the stat calculated i.e.. AgeAtStart_N;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means data=sashelp.heart noprint nway;&lt;/P&gt;&lt;P&gt; class status sex;&lt;/P&gt;&lt;P&gt; var ageatstart;&lt;/P&gt;&lt;P&gt; output out = want ( drop&amp;nbsp; = _: )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n=base_unwtd&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sum=cnt_unwtd &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mean=per_unwtd /noinherit;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*** /noinherit will leave the label null;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 14:56:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57935#M16168</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-08-31T14:56:57Z</dc:date>
    </item>
    <item>
      <title>How to get labels in proc means output dataset ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57936#M16169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks! The /noinherit worked in the sense that all the variables didn't come up as AGE in the output dataset as the labels were null. &lt;/P&gt;&lt;P&gt;I would've liked the labels to also be BASE_UNWTD, CNT_UNWTD and PER_UNWTD ........ but your option will work for now. Thanks,again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 15:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57936#M16169</guid>
      <dc:creator>Xinxin</dc:creator>
      <dc:date>2011-08-31T15:03:56Z</dc:date>
    </item>
    <item>
      <title>How to get labels in proc means output dataset ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57937#M16170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I learned something new from your post as I didn't realize that proc means would assign the variable label as the labels in code like yours UNLESS one uses the noinherit option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is probably why it worked for all of your other variables .. they didn't have labels explicitly assigned.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 15:31:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57937#M16170</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-08-31T15:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get labels in proc means output dataset ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57938#M16171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you do not define the noinherit option (the default would be inherit) more than just the label of the former variable is actually copied.&amp;nbsp; I believe it takes on all of the original variables attributes, including: label, format and possibly length?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT:&amp;nbsp; I looked it up (&lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146734.htm"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146734.htm&lt;/A&gt;) the length is not inheritied unless the inherit option is explicitly called.&amp;nbsp; Similar to the keeplen option this could probably cause numeric impressision... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Aug 2011 15:45:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/57938#M16171</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-08-31T15:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to get labels in proc means output dataset ?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/816589#M81862</link>
      <description>noinherit works!</description>
      <pubDate>Mon, 06 Jun 2022 05:59:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-get-labels-in-proc-means-output-dataset/m-p/816589#M81862</guid>
      <dc:creator>DrAbhijeetSafai</dc:creator>
      <dc:date>2022-06-06T05:59:02Z</dc:date>
    </item>
  </channel>
</rss>

