<?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: create a new variable with combinations in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/654631#M196569</link>
    <description>&lt;P&gt;It's hard to imagine a use for such a thing. It is not hard to image how this method will fail since SAS variable names can not exceed 32 characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why do you want this? Perhaps we can find better approaches.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jun 2020 17:52:15 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-06-08T17:52:15Z</dc:date>
    <item>
      <title>create a new variable with combinations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/654628#M196567</link>
      <description>&lt;P&gt;Hello there,&lt;/P&gt;
&lt;P&gt;I have a variable with combination of colors&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID&amp;nbsp; &amp;nbsp;variable_combination&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;"blue, yellow, red"&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp;"white, grey"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and would like to get&amp;nbsp; new indicator variables for each combination so I will get:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ID variable_combination&amp;nbsp; &amp;nbsp;blue_yellow_red&amp;nbsp; &amp;nbsp; white_grey&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp;"blue, yellow, red"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&lt;/P&gt;
&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp;"white, grey"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;all your help will be appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Lalohg&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 17:40:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/654628#M196567</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2020-06-08T17:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: create a new variable with combinations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/654631#M196569</link>
      <description>&lt;P&gt;It's hard to imagine a use for such a thing. It is not hard to image how this method will fail since SAS variable names can not exceed 32 characters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why do you want this? Perhaps we can find better approaches.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jun 2020 17:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/654631#M196569</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-08T17:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: create a new variable with combinations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/654632#M196570</link>
      <description>Can you provide some more records so we understand how this might scale? How many different combinations will you have? Do you know them all ahead of time?&lt;BR /&gt;&lt;BR /&gt;Why do you need to make dummy variables? Most SAS Procs will do that for you these days.</description>
      <pubDate>Mon, 08 Jun 2020 17:52:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/654632#M196570</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-08T17:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: create a new variable with combinations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/655489#M196642</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID   variable_combination	$40.;
cards;
1     "blue, yellow, red"
2     "white, grey"
;
data temp;
 set have;
 length _ $ 40;
 do i=1 to countw(variable_combination,,'ka');
  _=catx('_',_,scan(variable_combination,i,,'ka'));
 end;
 y=1;
run;
proc logistic data=temp outdesign=design(drop=y) outdesignonly;
class _ / param=glm ;
model y=_/nofit noint;
run;
data want;
 merge have design;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jun 2020 11:57:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/655489#M196642</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-06-09T11:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: create a new variable with combinations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/655493#M196644</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input ID   variable_combination	$40.;
v=1;
cards;
1     "blue, yellow, red"
2     "white, grey"
;
proc transpose data=have out=temp;
by id  variable_combination;
var v;
id  variable_combination;
run;
proc stdize data=temp out=want reponly missing=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jun 2020 12:06:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/655493#M196644</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-06-09T12:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: create a new variable with combinations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/655616#M196697</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi&amp;nbsp; Ksharp,&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV&gt;the code worked just fine!!!!&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Thank you&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;have a nice day&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;Lalohg&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 09 Jun 2020 19:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/655616#M196697</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2020-06-09T19:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: create a new variable with combinations</title>
      <link>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/655617#M196698</link>
      <description>this code also worked just fine!!&lt;BR /&gt;&lt;BR /&gt;Thanks again</description>
      <pubDate>Tue, 09 Jun 2020 19:07:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/create-a-new-variable-with-combinations/m-p/655617#M196698</guid>
      <dc:creator>lalohg</dc:creator>
      <dc:date>2020-06-09T19:07:47Z</dc:date>
    </item>
  </channel>
</rss>

