<?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: PC SAS Logic in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PC-SAS-Logic/m-p/24556#M5560</link>
    <description>Sorry, I could explain well in my previous post. I will try to make you understand better with some examples.&lt;BR /&gt;
&lt;BR /&gt;
My Dataset looks like below&lt;BR /&gt;
&lt;BR /&gt;
Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9 Col10 Col11 Col12 Col13 Col14&lt;BR /&gt;
Prd1 wh1   1      0      0     0       0       0    1      0         0        0      0        0	&lt;BR /&gt;
Prd1 wh2   1      1      0     0       0       0    0      1         1        1      1        1&lt;BR /&gt;
Prd1 wh3   0      0      0     0       0       1    0      0         0        0      0        0&lt;BR /&gt;
Prd1 wh4   1      0      0     0       0       0    0      1         0        0      0        0	&lt;BR /&gt;
&lt;BR /&gt;
Row1: Col1 has Product1, Column2 has Warehouse1, Column3 through Column14 has values of 1’s and 0’s. Now, I have to do a check for column3 through column14. Now I have to test that if the value in Column 3=1 and Column 4 = 0 then values from Column 5 through Column 8 should be 0’s and at the same time if Column 9 =1 and Column 10 = 0 then values from Column 11 through Column 14 should be 0’s.&lt;BR /&gt;
Row2: If Column 3= 1 and Column 4= 1 then there is no rule to be applied. But if in the same row if Column 5=0 then values from Column 6 through Column 9 should be 0’s. (I should see that they are 0’s for atleast 5 columns including Column )5&lt;BR /&gt;
Note: I should only make sure that the values in the columns are 0’s only if there was a change in value between previous column from 1 to 0.&lt;BR /&gt;
I hope it is clear now. Please let me know if you have any questions.</description>
    <pubDate>Tue, 28 Apr 2009 20:50:44 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-04-28T20:50:44Z</dc:date>
    <item>
      <title>PC SAS Logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PC-SAS-Logic/m-p/24554#M5558</link>
      <description>I appreciate if anyone can help me with the logic as I am new to SAS.&lt;BR /&gt;
I have a dataset where I had to compare the values of 12 columns against each other.&lt;BR /&gt;
Scenario: I have Column1, Column2… Column12. The values in all the columns can only be either 1 or 0. I should compare 2 columns and make sure if the value is changing from 1 to 0. If yes, then I should make sure that it remains 0 for 5 more columns starting from second column. I am planning on having a new column with a flag to say ‘Yes’ if it meets the above criteria or else ‘No’.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advance&lt;BR /&gt;
Sarah</description>
      <pubDate>Tue, 28 Apr 2009 19:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PC-SAS-Logic/m-p/24554#M5558</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-28T19:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: PC SAS Logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PC-SAS-Logic/m-p/24555#M5559</link>
      <description>If I understand your question right, you want to see if your data have this pattern&lt;BR /&gt;
1,0,0,0,0,0&lt;BR /&gt;
and set another variable to 'Yes' if so and otherwise 'No'.&lt;BR /&gt;
&lt;BR /&gt;
A simple IF-THEN construct would do it:&lt;BR /&gt;
&lt;BR /&gt;
IF column1=1 &amp;amp; column2=0 &amp;amp; column3=0 &amp;amp; column4=0 &amp;amp; column5=0 &amp;amp; column6=0 THEN Flag='Yes';&lt;BR /&gt;
ELSE Flag='No';</description>
      <pubDate>Tue, 28 Apr 2009 19:44:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PC-SAS-Logic/m-p/24555#M5559</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2009-04-28T19:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: PC SAS Logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PC-SAS-Logic/m-p/24556#M5560</link>
      <description>Sorry, I could explain well in my previous post. I will try to make you understand better with some examples.&lt;BR /&gt;
&lt;BR /&gt;
My Dataset looks like below&lt;BR /&gt;
&lt;BR /&gt;
Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9 Col10 Col11 Col12 Col13 Col14&lt;BR /&gt;
Prd1 wh1   1      0      0     0       0       0    1      0         0        0      0        0	&lt;BR /&gt;
Prd1 wh2   1      1      0     0       0       0    0      1         1        1      1        1&lt;BR /&gt;
Prd1 wh3   0      0      0     0       0       1    0      0         0        0      0        0&lt;BR /&gt;
Prd1 wh4   1      0      0     0       0       0    0      1         0        0      0        0	&lt;BR /&gt;
&lt;BR /&gt;
Row1: Col1 has Product1, Column2 has Warehouse1, Column3 through Column14 has values of 1’s and 0’s. Now, I have to do a check for column3 through column14. Now I have to test that if the value in Column 3=1 and Column 4 = 0 then values from Column 5 through Column 8 should be 0’s and at the same time if Column 9 =1 and Column 10 = 0 then values from Column 11 through Column 14 should be 0’s.&lt;BR /&gt;
Row2: If Column 3= 1 and Column 4= 1 then there is no rule to be applied. But if in the same row if Column 5=0 then values from Column 6 through Column 9 should be 0’s. (I should see that they are 0’s for atleast 5 columns including Column )5&lt;BR /&gt;
Note: I should only make sure that the values in the columns are 0’s only if there was a change in value between previous column from 1 to 0.&lt;BR /&gt;
I hope it is clear now. Please let me know if you have any questions.</description>
      <pubDate>Tue, 28 Apr 2009 20:50:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PC-SAS-Logic/m-p/24556#M5560</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-28T20:50:44Z</dc:date>
    </item>
  </channel>
</rss>

