<?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: Why am I getting _LABEL_ column after PROC TRANSPOSE in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-am-I-getting-LABEL-column-after-PROC-TRANSPOSE/m-p/847658#M335126</link>
    <description>&lt;P&gt;okay so if SAS create labels during the import stage, how come&amp;nbsp;_LABEL_ is not printed in PROC PRINT, but it is there after PROC TRANSPOSE?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to suppress&amp;nbsp;_LABEL_ from being printed in&amp;nbsp;PROC PRINT?&lt;/P&gt;</description>
    <pubDate>Sun, 04 Dec 2022 19:36:48 GMT</pubDate>
    <dc:creator>Nietzsche</dc:creator>
    <dc:date>2022-12-04T19:36:48Z</dc:date>
    <item>
      <title>Why am I getting _LABEL_ column after PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-am-I-getting-LABEL-column-after-PROC-TRANSPOSE/m-p/847633#M335120</link>
      <description>&lt;P&gt;Hi, I am trying follow the book example on PROC TRANSPOSE&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_1-1670147826872.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77988i702ACFB34D07211D/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_1-1670147826872.png" alt="Nietzsche_1-1670147826872.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I did the same thing, except first, I imported the class data from an excel file.&lt;/P&gt;
&lt;P&gt;But you can see from the report that the imported is the same as the cert.class used in the book from the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After I transposed it and print out the result, I got an extra "_LABEL_" column after _NAME_ column in the transposed data.&lt;/P&gt;
&lt;P&gt;What is that the case?&lt;/P&gt;
&lt;PRE&gt;***************************************************************;
proc import datafile='~/spg/cert/class.xlsx'
    dbms=xlsx
    out=class
    replace;
    getnames=yes;
run;
***************************************************************;
proc print data=class; run;

proc transpose data=class out=transposed;run;

proc print data=transposed noobs; 
title 'scores for the year';
run;&lt;/PRE&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="Nietzsche_2-1670148247605.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77989iE732E51A7D02D8BA/image-size/large?v=v2&amp;amp;px=999" role="button" title="Nietzsche_2-1670148247605.png" alt="Nietzsche_2-1670148247605.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I have attached the xlsx file if you wish to replicate the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Dec 2022 10:09:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-am-I-getting-LABEL-column-after-PROC-TRANSPOSE/m-p/847633#M335120</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2022-12-04T10:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting _LABEL_ column after PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-am-I-getting-LABEL-column-after-PROC-TRANSPOSE/m-p/847634#M335121</link>
      <description>&lt;P&gt;Both output are correct. The output you get depends on whether the original data set contains labels for the variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you import data from an Excel file, SAS automatically creates labels for each variable. I think that the output in the book is from a data set that does NOT contain labels.&amp;nbsp; Run the following example to see the difference:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title "Data set with NO labels";
data Class;
length Name $7;
input Name  Score1 Score2 Score3 Homework;
datalines;
LINDA 53 60 66 42
DEREK 72 64 56 32
KATHY 98 82 100 48
MICHAEL 80 55 95 50
;

proc transpose data=class out=transposed;
run;

proc print data=transposed noobs; 
run;

title "Data set with LABELS";
data Class2;
set Class;
label Name='Name' Score1='Score1' Score2='Score2' Score3='Score3' Homework='Homework';
run;

proc transpose data=class2 out=transposed;
run;

proc print data=transposed noobs; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So, your output is correct because your input data set contains labels. It doesn't match the book because they used data that did not have labels.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Dec 2022 11:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-am-I-getting-LABEL-column-after-PROC-TRANSPOSE/m-p/847634#M335121</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-12-04T11:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting _LABEL_ column after PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-am-I-getting-LABEL-column-after-PROC-TRANSPOSE/m-p/847658#M335126</link>
      <description>&lt;P&gt;okay so if SAS create labels during the import stage, how come&amp;nbsp;_LABEL_ is not printed in PROC PRINT, but it is there after PROC TRANSPOSE?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to suppress&amp;nbsp;_LABEL_ from being printed in&amp;nbsp;PROC PRINT?&lt;/P&gt;</description>
      <pubDate>Sun, 04 Dec 2022 19:36:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-am-I-getting-LABEL-column-after-PROC-TRANSPOSE/m-p/847658#M335126</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2022-12-04T19:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting _LABEL_ column after PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-am-I-getting-LABEL-column-after-PROC-TRANSPOSE/m-p/847697#M335144</link>
      <description>&lt;P&gt;Sure. The easiest way is to DROP the _LABEL_ column:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=transposed(drop=_LABEL_) noobs; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alternatively, you could use the VAR statement to explicitly name the variables that you want to print:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=transposed(drop=_LABEL_) noobs; 
var _NAME_ COL: ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Dec 2022 00:39:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-am-I-getting-LABEL-column-after-PROC-TRANSPOSE/m-p/847697#M335144</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-12-05T00:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting _LABEL_ column after PROC TRANSPOSE</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-am-I-getting-LABEL-column-after-PROC-TRANSPOSE/m-p/847698#M335145</link>
      <description>&lt;P&gt;You can also prevent the _LABEL_ columns from being created by using the system option NOLABEL.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options nolabel;
proc transpose .....
run;
options label;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Dec 2022 00:46:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-am-I-getting-LABEL-column-after-PROC-TRANSPOSE/m-p/847698#M335145</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-12-05T00:46:41Z</dc:date>
    </item>
  </channel>
</rss>

