<?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 assign all column names and respectively their values in another column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-all-column-names-and-respectively-their-values-in/m-p/523700#M142306</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a sas table and in that table I have 20 columns and all 20 columns have certain values. And here I want to create another sas table from this table where I should two column. in one column I should have all column names of first sas table and in other table I want to store all the values respective to the column names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first dataset:&lt;/P&gt;&lt;P&gt;DATA Abhi;&lt;/P&gt;&lt;P&gt;input a b c d e f g h i j k l m;&lt;/P&gt;&lt;P&gt;datalines;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;outcome dataset result:&lt;/P&gt;&lt;P&gt;1st&amp;nbsp; 2nd&amp;nbsp;&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;&lt;P&gt;c&amp;nbsp; &amp;nbsp;8&lt;/P&gt;&lt;P&gt;d&amp;nbsp; &amp;nbsp;9&lt;/P&gt;&lt;P&gt;e&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;f&amp;nbsp; 11&lt;/P&gt;&lt;P&gt;g&amp;nbsp; 12&lt;/P&gt;&lt;P&gt;h&amp;nbsp; 13&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank!&lt;/P&gt;</description>
    <pubDate>Thu, 27 Dec 2018 20:01:17 GMT</pubDate>
    <dc:creator>abhityagi</dc:creator>
    <dc:date>2018-12-27T20:01:17Z</dc:date>
    <item>
      <title>How to assign all column names and respectively their values in another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-all-column-names-and-respectively-their-values-in/m-p/523700#M142306</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a sas table and in that table I have 20 columns and all 20 columns have certain values. And here I want to create another sas table from this table where I should two column. in one column I should have all column names of first sas table and in other table I want to store all the values respective to the column names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first dataset:&lt;/P&gt;&lt;P&gt;DATA Abhi;&lt;/P&gt;&lt;P&gt;input a b c d e f g h i j k l m;&lt;/P&gt;&lt;P&gt;datalines;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;outcome dataset result:&lt;/P&gt;&lt;P&gt;1st&amp;nbsp; 2nd&amp;nbsp;&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; 4&lt;/P&gt;&lt;P&gt;a&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp;2&lt;/P&gt;&lt;P&gt;b&amp;nbsp; &amp;nbsp; &amp;nbsp; 6&lt;/P&gt;&lt;P&gt;c&amp;nbsp; &amp;nbsp;8&lt;/P&gt;&lt;P&gt;d&amp;nbsp; &amp;nbsp;9&lt;/P&gt;&lt;P&gt;e&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;f&amp;nbsp; 11&lt;/P&gt;&lt;P&gt;g&amp;nbsp; 12&lt;/P&gt;&lt;P&gt;h&amp;nbsp; 13&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank!&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 20:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-all-column-names-and-respectively-their-values-in/m-p/523700#M142306</guid>
      <dc:creator>abhityagi</dc:creator>
      <dc:date>2018-12-27T20:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign all column names and respectively their values in another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-all-column-names-and-respectively-their-values-in/m-p/523704#M142310</link>
      <description>&lt;P&gt;Take a look at proc transpose and sort.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you could post clear samples,lazy people like me would test the code for you&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 20:17:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-all-column-names-and-respectively-their-values-in/m-p/523704#M142310</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-12-27T20:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to assign all column names and respectively their values in another column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-assign-all-column-names-and-respectively-their-values-in/m-p/523713#M142318</link>
      <description>&lt;P&gt;You should get that with :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set abhi;
array _a a--m;
do _i = 1 to dim(_a);
    var = vname(_a{_i});
    value = _a{_i};
    if not missing(value) then output;
    end;
keep var value;
run;

proc sort data=want; by var; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(untested)&lt;/P&gt;</description>
      <pubDate>Thu, 27 Dec 2018 22:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-assign-all-column-names-and-respectively-their-values-in/m-p/523713#M142318</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-12-27T22:32:12Z</dc:date>
    </item>
  </channel>
</rss>

