<?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: Coverting data in SAS in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436256#M4617</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;jc3992 wrote:
&lt;P&gt;The &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Log showed&lt;/STRONG&gt;&lt;/FONT&gt; that I might have some problem during inputing the variables without setting the distance.&lt;/P&gt;
&lt;P&gt;Is there anyone would like to give me some hints on how to modify my current code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In that case, perhaps posting the log would be helpful.&lt;/P&gt;</description>
    <pubDate>Mon, 12 Feb 2018 15:54:03 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-02-12T15:54:03Z</dc:date>
    <item>
      <title>Coverting data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436254#M4616</link>
      <description>&lt;PRE&gt;data mydata_Plus;
infile '/folders/myfolders/Programs/mydata_Plus.csv';
input workshop gender $ q1 q2 q3 q4;
set mydata_Plus;
Array new_q q1-q4;
Array old_q q1--q4;
drop i;
do i= 1 to 4;
if old_q =. then new_q = 9;
else if old_q = 4 then new_q = 4;
else if old_q = 5 then new_q =.;
end;
run;&lt;/PRE&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;My attempt is to convert "." to 9, 4's to 20, and 5's to "."&lt;/P&gt;&lt;P&gt;The Log showed that I might have some problem during inputing the variables without setting the distance.&lt;/P&gt;&lt;P&gt;Is there anyone would like to give me some hints on how to modify my current code?&lt;/P&gt;&lt;P&gt;Thanks very much!&lt;/P&gt;&lt;P&gt;The data is as attached.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 15:49:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436254#M4616</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-02-12T15:49:41Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436256#M4617</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;jc3992 wrote:
&lt;P&gt;The &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Log showed&lt;/STRONG&gt;&lt;/FONT&gt; that I might have some problem during inputing the variables without setting the distance.&lt;/P&gt;
&lt;P&gt;Is there anyone would like to give me some hints on how to modify my current code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In that case, perhaps posting the log would be helpful.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 15:54:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436256#M4617</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-12T15:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436257#M4618</link>
      <description>&lt;P&gt;The SET statement definitely doesn't belong.&amp;nbsp; You are inputting from raw data, and don't need to bring in a SAS data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Technically, you could (and should) use one array instead of two.&amp;nbsp; This statement would be perfectly acceptable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if new_q{i} = . then new_q{i} = 9;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note the proper way to refer to a variable in the array.&amp;nbsp; Since "i" is the variable used in the DO loop, it has to be the variable used to reference array elements.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 15:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436257#M4618</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-02-12T15:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436259#M4619</link>
      <description>&lt;P&gt;When you attempt to use arrays you need to point to which element of the array to use:&lt;/P&gt;
&lt;P&gt;Perhaps&lt;/P&gt;
&lt;PRE&gt;do i= 1 to 4;
   if old_q[i] =. then new_q[i] = 9;
   else if old_q[i] = 4 then new_q[i] = 20;
   else if old_q[i] = 5 then new_q[i] =.;
end;&lt;/PRE&gt;
&lt;P&gt;The value of i is the index that points to which of the array varibles/values to consider.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 16:00:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436259#M4619</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-02-12T16:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436261#M4620</link>
      <description>&lt;DIV class="sasNote"&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for workshop in line 1 1-27.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for q1 in line 3 1-11.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for q2 in line 4 1-11.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for q3 in line 5 1-2.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Invalid data for q4 in line 5 4-8.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 12 Feb 2018 16:06:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436261#M4620</guid>
      <dc:creator>jc3992</dc:creator>
      <dc:date>2018-02-12T16:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: Coverting data in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436264#M4621</link>
      <description>&lt;P&gt;That's not the full log.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/188695"&gt;@jc3992&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;DIV class="sasNote"&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid data for workshop in line 1 1-27.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid data for q1 in line 3 1-11.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid data for q2 in line 4 1-11.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid data for q3 in line 5 1-2.&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;NOTE: Invalid data for q4 in line 5 4-8.&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2018 16:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Coverting-data-in-SAS/m-p/436264#M4621</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-12T16:09:30Z</dc:date>
    </item>
  </channel>
</rss>

