<?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: Keep same label  name as column name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706028#M216665</link>
    <description>Thanks,&lt;BR /&gt;Will do that</description>
    <pubDate>Tue, 15 Dec 2020 14:10:17 GMT</pubDate>
    <dc:creator>harshpatel</dc:creator>
    <dc:date>2020-12-15T14:10:17Z</dc:date>
    <item>
      <title>Keep same label  name as column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706015#M216655</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I have a table properties as below in which i want to keep &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;label name same as column name&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#000000"&gt;Please help me on this&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="harshpatel_0-1608038256659.png" style="width: 628px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/52620iB17CDFA18F6FA71E/image-dimensions/628x496?v=v2" width="628" height="496" role="button" title="harshpatel_0-1608038256659.png" alt="harshpatel_0-1608038256659.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Harsh&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 13:15:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706015#M216655</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2020-12-15T13:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Keep same label  name as column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706016#M216656</link>
      <description>&lt;P&gt;Why not just delete all labels then ?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 13:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706016#M216656</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-12-15T13:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Keep same label  name as column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706017#M216657</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;But if i am generating proc report then it is taking label instead of columns so what to do in this case,&lt;/P&gt;
&lt;P&gt;my code is as below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc report data=test;&lt;BR /&gt;column idd description &amp;amp;names;&lt;BR /&gt;define idd/'id';&lt;BR /&gt;define description/'desc';&lt;BR /&gt;&amp;amp;defines;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 13:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706017#M216657</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2020-12-15T13:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Keep same label  name as column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706020#M216659</link>
      <description>&lt;P&gt;Then remove all the label from table .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
 set sashelp.class;
run;


proc datasets library=work nolist nodetails;
modify have;
attrib _all_ label=' ';
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Dec 2020 13:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706020#M216659</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-12-15T13:33:05Z</dc:date>
    </item>
    <item>
      <title>Re: Keep same label  name as column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706022#M216661</link>
      <description>&lt;P&gt;Transpose to a long dataset layout, and use _NAME_ as ACROSS variable in PROC REPORT.&lt;/P&gt;
&lt;P&gt;See Maxim 19 and Maxim 33.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS still better:&lt;/P&gt;
&lt;P&gt;Convert _LABEL_ to a SAS date value (INPUT with YYMMN6.), use that as ACROSS, with a format to your liking.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 13:55:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706022#M216661</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-15T13:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Keep same label  name as column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706024#M216662</link>
      <description>&lt;P&gt;With dictionary tables and call execute it's quite simply:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data HAVE;&lt;BR /&gt;attrib AUG12 label='201208' length=8&lt;BR /&gt;SEP12 label='201209' length=8&lt;BR /&gt;OCT12 label='201210' length=8&lt;BR /&gt;NOV12 label='201211' length=8&lt;BR /&gt;DEC12 label='201212' length=8&lt;BR /&gt;JAN13 label='201301' length=8&lt;BR /&gt;FEB13 label='201302' length=8&lt;BR /&gt;MAR13 label='201303' length=8&lt;BR /&gt;APR13 label='201304' length=8&lt;BR /&gt;MAY13 label='201305' length=8&lt;BR /&gt;JUN13 label='201306' length=8&lt;BR /&gt;JUL13 label='201307' length=8&lt;BR /&gt;AUG13 label='201308' length=8 ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table Have_Cols as&lt;BR /&gt;select memname,&lt;BR /&gt;name,&lt;BR /&gt;label&lt;BR /&gt;from dictionary.columns&lt;BR /&gt;where memname = 'HAVE'&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;set Have_cols end=EOF;&lt;BR /&gt;if _N_ = 1 then call execute ('data Have2; set Have;');&lt;BR /&gt;call execute ('Attrib '||name||' label="'||name||' ');&lt;BR /&gt;if EOF then call execute('; run;');&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 14:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706024#M216662</guid>
      <dc:creator>Aku</dc:creator>
      <dc:date>2020-12-15T14:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Keep same label  name as column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706026#M216663</link>
      <description>Thanks,&lt;BR /&gt;It works for me</description>
      <pubDate>Tue, 15 Dec 2020 14:09:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706026#M216663</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2020-12-15T14:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Keep same label  name as column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706027#M216664</link>
      <description>Thanks,&lt;BR /&gt;Great it works for me</description>
      <pubDate>Tue, 15 Dec 2020 14:09:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706027#M216664</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2020-12-15T14:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Keep same label  name as column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706028#M216665</link>
      <description>Thanks,&lt;BR /&gt;Will do that</description>
      <pubDate>Tue, 15 Dec 2020 14:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706028#M216665</guid>
      <dc:creator>harshpatel</dc:creator>
      <dc:date>2020-12-15T14:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Keep same label  name as column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706030#M216666</link>
      <description>&lt;P&gt;A simple example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data wide;
input id $ aug12 sep12 oct12;
label
  aug12 = "201208"
  sep12 = "201209"
  oct12 = "201210"
;
datalines;
A 1 2 3
;

proc transpose data=wide out=trans (rename=(col1=value));
by id;
var aug12--oct12;
run;

data long;
set trans;
period = input(_label_,yymmn6.);
format period monyy5.;
drop _name_ _label_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;With this vastly improved dataset layout, the code is now very simple:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc report data=long;
column id value,period;
define id / group;
define value / "" analysis;
define period / "" across order=data;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;PRE&gt;id	AUG12	SEP12	OCT12
A	1	2	3
&lt;/PRE&gt;
&lt;P&gt;By changing the format for the ACROSS variable in PROC REPORT, you can get anything you like, without having to resort to macro programming or CALL EXECUTE steps.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 14:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keep-same-label-name-as-column-name/m-p/706030#M216666</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-15T14:20:41Z</dc:date>
    </item>
  </channel>
</rss>

