<?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 new variable from a value of multiples column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680316#M205565</link>
    <description>&lt;P&gt;What do you mean by &lt;STRONG&gt;&lt;FONT color="#000000"&gt;if (Class1 to Class7="1") ?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;If you mean all 7 variables&amp;nbsp;&lt;STRONG&gt;class1 to class7&lt;/STRONG&gt; have the same value then the code should be&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case (class1=1 and class2=1 and ... and class7=1) then 1 as alpha else
case (class1=2 and ..........................and class7=2) then 2 as alpha
..&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;otherwise, please post the expected output.&lt;/FONT&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;</description>
    <pubDate>Sun, 30 Aug 2020 15:35:07 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2020-08-30T15:35:07Z</dc:date>
    <item>
      <title>Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680313#M205563</link>
      <description>&lt;P&gt;I need helps, I am trying to create one variable from more columns as can you see below :&amp;nbsp;&lt;BR /&gt;Class1 Class2 Class3 Class4 Class5 Class6 Class 7&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "1"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"1"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"1"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"1"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"1"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"1"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"1"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"2"&amp;nbsp; &amp;nbsp; &amp;nbsp; "2"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"2"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"2"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"2"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "2"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"2"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "3"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"3"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"3"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"3"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;"3"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "3"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "3"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;FONT color="#000000"&gt;I handled this with "Case function" using PROC SQL, for the Class 1 it sounds work but for Class 2, I have a warning :&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#339966"&gt; "WARNING: Variable &lt;FONT color="#3366FF"&gt;ALPHA&amp;nbsp;&lt;/FONT&gt;already exists on file WORK.&lt;FONT color="#3366FF"&gt;BENELUX&lt;/FONT&gt;".&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;My goal is to create the column "Alpha" if (Class1 to Class7="1")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;PROC SQL; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;CREATE TABLE BENELUX&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;AS&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;SELECT *,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;(CASE WHEN CLASS_L1="1" THEN CLASS_L1 ELSE '' END) AS ALPHA,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;(CASE WHEN CLASS_L2="1" THEN CLASS_L2 ELSE '' END)&amp;nbsp;AS ALPHA&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#33CCCC"&gt;/*&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#33CCCC"&gt;CLASS_L3="1" OR&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#33CCCC"&gt;CLASS_L4="1" OR&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#33CCCC"&gt;CLASS_L5="1" OR&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#33CCCC"&gt;CLASS_L6="1" OR&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#33CCCC"&gt;CLASS_L7="1"))*/&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;FROM BETADSN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help will be welcome!&lt;/P&gt;&lt;P&gt;Thanks advanced&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 15:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680313#M205563</guid>
      <dc:creator>ndamo</dc:creator>
      <dc:date>2020-08-30T15:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680314#M205564</link>
      <description>&lt;P&gt;You can't have the variable ALPHA being created twice, which is what you are doing with the two CASE commands after SELECT *.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will work, although it may not be what you want. &lt;STRONG&gt;Please show us the desired output.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE BENELUX
AS

SELECT *,
(CASE WHEN CLASS_L1="1" THEN CLASS_L1 ELSE '' END) AS ALPHA1,
(CASE WHEN CLASS_L2="1" THEN CLASS_L2 ELSE '' END) AS ALPHA2
FROM BETADSN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 15:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680314#M205564</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-30T15:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680316#M205565</link>
      <description>&lt;P&gt;What do you mean by &lt;STRONG&gt;&lt;FONT color="#000000"&gt;if (Class1 to Class7="1") ?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;If you mean all 7 variables&amp;nbsp;&lt;STRONG&gt;class1 to class7&lt;/STRONG&gt; have the same value then the code should be&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case (class1=1 and class2=1 and ... and class7=1) then 1 as alpha else
case (class1=2 and ..........................and class7=2) then 2 as alpha
..&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;otherwise, please post the expected output.&lt;/FONT&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;</description>
      <pubDate>Sun, 30 Aug 2020 15:35:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680316#M205565</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-08-30T15:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680317#M205566</link>
      <description>&lt;P&gt;Thank you, Yes I would like just create the variable &lt;FONT color="#3366FF"&gt;ALPHA&lt;/FONT&gt; when&amp;nbsp;class1=1 and class2=1 and class3=1 and class4=1 class5=1 and class6= and class7=1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the expected out will be :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;ALPHA&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; "1"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; "1"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; "1"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; "1"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; "1"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; "1"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; "1"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; "1"&amp;nbsp;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 15:51:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680317#M205566</guid>
      <dc:creator>ndamo</dc:creator>
      <dc:date>2020-08-30T15:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680319#M205568</link>
      <description>&lt;P&gt;So if any of CLASS1-CLASS7 is not a "1" then what value do we assign to ALPHA? Your most recent post seems to indicate that you are using the AND operator but your original post indicates you are using the OR operator, these will not produce the same results. Why do you need ALPHA to be character?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code produces a numeric variable using the AND operator, and will produce a 0 if they are not all "1"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
CREATE TABLE BENELUX
AS
SELECT *,
(class_l1="1")*(class_l2="1")*(class_l3="1")*(class_l4="1")*(class_l5="1")*(class_l6="1")*(class_l7="1") as alpha
from betadsn;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 30 Aug 2020 15:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680319#M205568</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-30T15:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680320#M205569</link>
      <description>&lt;P&gt;Thank you, in my core data set, the format these variables(Class1 to Class7) is CHAR :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "1"="Blue"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "2"="White"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "3"="Red"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; "9"="Other"&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I put 1 or "Blue" in the program , it doesn't work. I need just the first value because I will perform the PROc FREQ for that variable .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 16:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680320#M205569</guid>
      <dc:creator>ndamo</dc:creator>
      <dc:date>2020-08-30T16:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680322#M205570</link>
      <description>&lt;P&gt;If all rows should result with alpha="1" then the code is"&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;case (class1=1 and class2=1 and ... and class7=1) or
case (class1=2 and ......................and class7=2) or
case (class1=3 and ......................and class7=3) or
...
case (class1=7 and ......................and class7=7) 
then "1" as alpha;
else "9" as alpha;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 30 Aug 2020 16:28:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680322#M205570</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-08-30T16:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680323#M205571</link>
      <description>Thank you! It works but rather than using *, I put OR because "*" doesn't work for char value.</description>
      <pubDate>Sun, 30 Aug 2020 16:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680323#M205571</guid>
      <dc:creator>ndamo</dc:creator>
      <dc:date>2020-08-30T16:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680327#M205573</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/225295"&gt;@ndamo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you! It works but rather than using *, I put OR because "*" doesn't work for char value.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You keep switching between the AND operator and the OR operator. Please stop dragging this out and clear this up. We could also benefit from a clear and &lt;STRONG&gt;complete&lt;/STRONG&gt; problem statement, instead of us having to ask question after question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the code I provided, the * does work.&lt;/P&gt;
&lt;DIV id="tap-translate"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sun, 30 Aug 2020 18:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680327#M205573</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-30T18:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680328#M205574</link>
      <description>&lt;P&gt;This is an example of what I think is the (unspoken) primary goal of this web site.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes the site has "sas" in its name, and sas coding suggestions that meet the OP's objective do get marked as "solution", but the greatest success is in getting the OP to recognize &lt;EM&gt;&lt;STRONG&gt;what is needed to properly define a problem&lt;/STRONG&gt;&lt;/EM&gt;.&amp;nbsp; That is the basic concept behind my frequent harangues of "help us help you".&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 23:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680328#M205574</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-08-30T23:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680334#M205576</link>
      <description>&lt;P&gt;Yes, I agree with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt; , I have no idea what the actual problem is that the original poster wants to solve. I am also not particularly happy that my answer was marked correct, as I don't really think I have solved the problem. I might have moved the conversation forward somewhat, but that's a different thing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All programming problems require a clear and complete understanding of what the problem is, and we never got that here.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Aug 2020 22:48:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680334#M205576</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-08-30T22:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Create new variable from a value of multiples column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680415#M205626</link>
      <description>&lt;P&gt;Sorry if you found something wrong on this exchange/post, it's my first post and I will make better in the next post.&lt;/P&gt;&lt;P&gt;Once I have more than two variables, I am confused about using "AND" and "OR".I tested both because initially, I think "AND" would work but I had not the expected output so I switched in using "OR".&amp;nbsp;Of course, your tips helped me to solve this issue and I replied to you that the Format of my variables (Class 1 -Class) is exactly as:&lt;BR /&gt;"1"="blue"&lt;BR /&gt;"2"="Red"&lt;BR /&gt;"3"="White"&lt;BR /&gt;"7"="Other"&lt;/P&gt;&lt;P&gt;I tried with your tips below but I have errors in the log: "&amp;nbsp;&lt;FONT color="#FF0000"&gt;*&amp;nbsp; required numeric value &lt;FONT color="#000000"&gt;"&amp;nbsp; and the same&amp;nbsp; error happened with &lt;FONT face="arial black,avant garde" color="#0000FF"&gt;"||"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;PRE class="language-sas"&gt;&lt;CODE&gt;PROC SQL;
CREATE TABLE BENELUX
AS
SELECT *,
(class_l1="1")*(class_l2="1")*(class_l3="1")*(class_l4="1")*(class_l5="1")*(class_l6="1")*(class_l7="1") as alpha
from betadsn;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Finally, the following program works:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;FONT face="georgia,palatino"&gt;PROC SQL;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;FONT face="georgia,palatino"&gt;CREATE TABLE BENELUX&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;FONT face="georgia,palatino"&gt;AS&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;FONT face="georgia,palatino"&gt;SELECT *,&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;FONT face="georgia,palatino"&gt;(class_l1="1") OR (class_l2="1") OR (class_l3="1") OR (class_l4="1") OR (class_l5="1") OR (class_l6="1") OR (class_l7="1") as alpha&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;FONT face="georgia,palatino"&gt;from betadsn;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;&lt;FONT face="georgia,palatino"&gt;quit;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for this help and Again Sorry for this misunderstanding.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 11:33:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-new-variable-from-a-value-of-multiples-column/m-p/680415#M205626</guid>
      <dc:creator>ndamo</dc:creator>
      <dc:date>2020-08-31T11:33:39Z</dc:date>
    </item>
  </channel>
</rss>

