<?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 put vars labels as values in a new data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/put-vars-labels-as-values-in-a-new-data-set/m-p/810067#M319442</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create a data set that will contain 1 row .&lt;/P&gt;
&lt;P&gt;The values in this row will be the variables labels.&lt;/P&gt;
&lt;P&gt;what is the way to do it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
label ID='customer_ID'
       X1='Weight'
	   X2='Height'
	   X3='Education'
	   W='Health';
Input ID X1 X2 X3 W;
cards;
111 10 20 30 40
222 15 30 45 60
777 30 20 20 80
;
run;

Data wanted;
Input ID $ X1 $ X2 $ X3 $ W $;
cards;
cust_ID
Weight
Height
Education
Health
;
Run;
/***The question-How to create wanted data set autmctically***/&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Apr 2022 05:46:44 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2022-04-27T05:46:44Z</dc:date>
    <item>
      <title>put vars labels as values in a new data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-vars-labels-as-values-in-a-new-data-set/m-p/810067#M319442</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to create a data set that will contain 1 row .&lt;/P&gt;
&lt;P&gt;The values in this row will be the variables labels.&lt;/P&gt;
&lt;P&gt;what is the way to do it please?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data have;
label ID='customer_ID'
       X1='Weight'
	   X2='Height'
	   X3='Education'
	   W='Health';
Input ID X1 X2 X3 W;
cards;
111 10 20 30 40
222 15 30 45 60
777 30 20 20 80
;
run;

Data wanted;
Input ID $ X1 $ X2 $ X3 $ W $;
cards;
cust_ID
Weight
Height
Education
Health
;
Run;
/***The question-How to create wanted data set autmctically***/&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Apr 2022 05:46:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-vars-labels-as-values-in-a-new-data-set/m-p/810067#M319442</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-04-27T05:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: put vars labels as values in a new data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-vars-labels-as-values-in-a-new-data-set/m-p/810068#M319443</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=have out=cont(keep=NAME LABEL) noprint;
run;
proc transpose data=cont out=want(drop=_NAME_ _LABEL_);
  var LABEL;
  ID NAME;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Apr 2022 05:58:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-vars-labels-as-values-in-a-new-data-set/m-p/810068#M319443</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-04-27T05:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: put vars labels as values in a new data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-vars-labels-as-values-in-a-new-data-set/m-p/810070#M319445</link>
      <description>&lt;P&gt;I am 100% sure that this question has been asked and answered multiple times, so please use the search function.&lt;/P&gt;
&lt;P&gt;Are you 100% sure that the values of all labels have values that are valid for variable names?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 06:01:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-vars-labels-as-values-in-a-new-data-set/m-p/810070#M319445</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-04-27T06:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: put vars labels as values in a new data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/put-vars-labels-as-values-in-a-new-data-set/m-p/810071#M319446</link>
      <description>&lt;P&gt;I didn't ask to put the labels as variables names.&lt;/P&gt;
&lt;P&gt;I asked to put these values as values and use same variables names (and define them as chars)&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 06:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/put-vars-labels-as-values-in-a-new-data-set/m-p/810071#M319446</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-04-27T06:03:55Z</dc:date>
    </item>
  </channel>
</rss>

