<?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: Another problem in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20486#M4243</link>
    <description>Try it.&lt;BR /&gt;
&lt;BR /&gt;
1 - 0 = 1&lt;BR /&gt;
1 - 1 = 0</description>
    <pubDate>Wed, 02 Mar 2011 19:12:48 GMT</pubDate>
    <dc:creator>Doc_Duke</dc:creator>
    <dc:date>2011-03-02T19:12:48Z</dc:date>
    <item>
      <title>Another problem</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20483#M4240</link>
      <description>I was wondering how I can reverse the value of my dichotomous items that are 0 to 1 and those that are 1 to 0.&lt;BR /&gt;
&lt;BR /&gt;
I have 4 items I am doing this within a Macro and it is not working&lt;BR /&gt;
&lt;BR /&gt;
DATA WR;&lt;BR /&gt;
set Matrix;&lt;BR /&gt;
DO i=1 TO &amp;amp;numi;&lt;BR /&gt;
&lt;BR /&gt;
if skills(i)=0 THEN skills(i)=1;&lt;BR /&gt;
ELSE if SKILLS(i)=1 then skills(i)=0;&lt;BR /&gt;
end;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 02 Mar 2011 18:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20483#M4240</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-03-02T18:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Another problem</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20484#M4241</link>
      <description>An easy way to do this for dichotomous variables is to use code like&lt;BR /&gt;
&lt;BR /&gt;
skills(i) = 1 - skills(i);</description>
      <pubDate>Wed, 02 Mar 2011 19:06:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20484#M4241</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-03-02T19:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Another problem</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20485#M4242</link>
      <description>Thank you Doc,&lt;BR /&gt;
&lt;BR /&gt;
But what if the skill=0 &lt;BR /&gt;
&lt;BR /&gt;
my data looks like this&lt;BR /&gt;
&lt;BR /&gt;
skill1     kills2     skills3     skills4&lt;BR /&gt;
0             1             1             0&lt;BR /&gt;
1              0             1            1&lt;BR /&gt;
&lt;BR /&gt;
and so on,&lt;BR /&gt;
&lt;BR /&gt;
I need to change all 1's to 0 and all 0's to 1&lt;BR /&gt;
&lt;BR /&gt;
Thank you</description>
      <pubDate>Wed, 02 Mar 2011 19:11:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20485#M4242</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-03-02T19:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Another problem</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20486#M4243</link>
      <description>Try it.&lt;BR /&gt;
&lt;BR /&gt;
1 - 0 = 1&lt;BR /&gt;
1 - 1 = 0</description>
      <pubDate>Wed, 02 Mar 2011 19:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20486#M4243</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2011-03-02T19:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Another problem</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20487#M4244</link>
      <description>I feel dumb &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;
sorry&lt;BR /&gt;
and thanks Doc</description>
      <pubDate>Wed, 02 Mar 2011 19:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20487#M4244</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-03-02T19:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Another problem</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20488#M4245</link>
      <description>help!!&lt;BR /&gt;
&lt;BR /&gt;
I am getting the following error, &lt;BR /&gt;
&lt;BR /&gt;
DATA WR;&lt;BR /&gt;
set Matrix;&lt;BR /&gt;
do i=1 to 4;&lt;BR /&gt;
	&lt;BR /&gt;
skills(i)=1- skills(i);&lt;BR /&gt;
END;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I am getting the following error why?&lt;BR /&gt;
&lt;BR /&gt;
16821  skills(i)=1- skills(i);&lt;BR /&gt;
                    ------&lt;BR /&gt;
                    68&lt;BR /&gt;
ERROR: Undeclared array referenced: skills.&lt;BR /&gt;
ERROR: Variable skills has not been declared as an array.&lt;BR /&gt;
ERROR 68-185: The function SKILLS is unknown, or cannot be accessed.&lt;BR /&gt;
&lt;BR /&gt;
16822  END;</description>
      <pubDate>Wed, 02 Mar 2011 19:55:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20488#M4245</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-03-02T19:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Another problem</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20489#M4246</link>
      <description>You need to declare an array before using it.&lt;BR /&gt;
&lt;BR /&gt;
DATA WR;&lt;BR /&gt;
set Matrix;&lt;BR /&gt;
array skills(4);&lt;BR /&gt;
do i=1 to 4;&lt;BR /&gt;
skills(i)=1- skills(i);&lt;BR /&gt;
END;&lt;BR /&gt;
run;</description>
      <pubDate>Wed, 02 Mar 2011 20:07:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20489#M4246</guid>
      <dc:creator>RickM</dc:creator>
      <dc:date>2011-03-02T20:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Another problem</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20490#M4247</link>
      <description>THANK YOU&lt;BR /&gt;
It worked!!</description>
      <pubDate>Wed, 02 Mar 2011 20:11:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Another-problem/m-p/20490#M4247</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2011-03-02T20:11:41Z</dc:date>
    </item>
  </channel>
</rss>

