<?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: Call the value for list of variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Call-the-value-for-list-of-variables/m-p/952531#M372266</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237008"&gt;@surajmetha55&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can apply the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n1x70jnnpttwy0n1gf5rvuivgyry.htm" target="_blank" rel="noopener"&gt;VVALUEX function&lt;/A&gt; to the variable names in &lt;FONT face="courier new,courier"&gt;Variable_list&lt;/FONT&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create sample data for demonstration */

data have;
set sashelp.cars(obs=2 keep=Make--MSRP);
input Variable_list $50.;
cards;
Make, Model, origin
Make, Model, Type, origin
;

/* Create new variable containing comma-separated values according to Variable_list */

data want;
set have;
length Variable_value $100;
do _n_=1 to countw(Variable_list,',');
  Variable_value=catx(', ',Variable_value,vvaluex(scan(Variable_list,_n_,',')));
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 04 Dec 2024 13:15:37 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2024-12-04T13:15:37Z</dc:date>
    <item>
      <title>Call the value for list of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-the-value-for-list-of-variables/m-p/952524#M372262</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a data as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Make&lt;/TD&gt;&lt;TD&gt;Model&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Origin&lt;/TD&gt;&lt;TD&gt;DriveTrain&lt;/TD&gt;&lt;TD&gt;MSRP&lt;/TD&gt;&lt;TD&gt;Variable_list&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Acura&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;MDX&lt;/TD&gt;&lt;TD&gt;SUV&lt;/TD&gt;&lt;TD&gt;Asia&lt;/TD&gt;&lt;TD&gt;All&lt;/TD&gt;&lt;TD&gt;$36,945&lt;/TD&gt;&lt;TD&gt;Make, Model, origin&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Acura&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;RSX Type S 2dr&lt;/TD&gt;&lt;TD&gt;Sedan&lt;/TD&gt;&lt;TD&gt;Asia&lt;/TD&gt;&lt;TD&gt;Front&lt;/TD&gt;&lt;TD&gt;$23,820&lt;/TD&gt;&lt;TD&gt;Make, Model, Type, origin&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It has a variable called&amp;nbsp;Variable_list (It has list of variable comma separated) I want to fetch value of each variable and store in one variable as show below dataset for variable "&amp;nbsp;Variable_value"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Make&lt;/TD&gt;&lt;TD&gt;Model&lt;/TD&gt;&lt;TD&gt;Type&lt;/TD&gt;&lt;TD&gt;Origin&lt;/TD&gt;&lt;TD&gt;DriveTrain&lt;/TD&gt;&lt;TD&gt;MSRP&lt;/TD&gt;&lt;TD&gt;Variable_list&lt;/TD&gt;&lt;TD&gt;Variable_value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Acura&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;MDX&lt;/TD&gt;&lt;TD&gt;SUV&lt;/TD&gt;&lt;TD&gt;Asia&lt;/TD&gt;&lt;TD&gt;All&lt;/TD&gt;&lt;TD&gt;$36,945&lt;/TD&gt;&lt;TD&gt;Make, Model, origin&lt;/TD&gt;&lt;TD&gt;Acura, MDX, Asia&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Acura&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;RSX Type S 2dr&lt;/TD&gt;&lt;TD&gt;Sedan&lt;/TD&gt;&lt;TD&gt;Asia&lt;/TD&gt;&lt;TD&gt;Front&lt;/TD&gt;&lt;TD&gt;$23,820&lt;/TD&gt;&lt;TD&gt;Make, Model, Type, origin&lt;/TD&gt;&lt;TD&gt;Acura,&amp;nbsp; RSX Type S 2dr, Sedan, Asia&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 04 Dec 2024 12:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-the-value-for-list-of-variables/m-p/952524#M372262</guid>
      <dc:creator>surajmetha55</dc:creator>
      <dc:date>2024-12-04T12:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Call the value for list of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-the-value-for-list-of-variables/m-p/952531#M372266</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/237008"&gt;@surajmetha55&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can apply the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n1x70jnnpttwy0n1gf5rvuivgyry.htm" target="_blank" rel="noopener"&gt;VVALUEX function&lt;/A&gt; to the variable names in &lt;FONT face="courier new,courier"&gt;Variable_list&lt;/FONT&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create sample data for demonstration */

data have;
set sashelp.cars(obs=2 keep=Make--MSRP);
input Variable_list $50.;
cards;
Make, Model, origin
Make, Model, Type, origin
;

/* Create new variable containing comma-separated values according to Variable_list */

data want;
set have;
length Variable_value $100;
do _n_=1 to countw(Variable_list,',');
  Variable_value=catx(', ',Variable_value,vvaluex(scan(Variable_list,_n_,',')));
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Dec 2024 13:15:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-the-value-for-list-of-variables/m-p/952531#M372266</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-12-04T13:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Call the value for list of variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Call-the-value-for-list-of-variables/m-p/952926#M372395</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;, Thank you. Perfect solution&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2024 07:19:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Call-the-value-for-list-of-variables/m-p/952926#M372395</guid>
      <dc:creator>surajmetha55</dc:creator>
      <dc:date>2024-12-09T07:19:25Z</dc:date>
    </item>
  </channel>
</rss>

