<?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: Array Made Data Go Missing in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251669#M56735</link>
    <description>&lt;P&gt;I went ahead and added the "&amp;lt;=" and that's what ended up "fixing" part of it - originally it was more than just the "Strongly Disagree" that were missing; now, it's just those. I notice in my proc print output that it only displays&amp;nbsp;"Strongly Disag." Could that be the problem? I assumed because my code still said "Strongly Disagree" that it didn't matter what the output display was. If so, how would I fix that?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Feb 2016 22:37:04 GMT</pubDate>
    <dc:creator>chelsealutz</dc:creator>
    <dc:date>2016-02-22T22:37:04Z</dc:date>
    <item>
      <title>Array Made Data Go Missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251641#M56725</link>
      <description>&lt;P&gt;Hello experts!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the following code to assign scores to Likert scale responses and divy them up into groups depending on the summed score, but the array I used has made many of my datapoints for my indicators go missing. Would someone happen to know why this happened? Thank you!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;array orig(7) $ norm_full_imm imm_men_take imm_resp_men imm_important imm_safe imm_protect_kids imm_heard_anything;&lt;BR /&gt;array kap(7) kap1-kap7;&lt;BR /&gt;do i=1 to 7;&lt;BR /&gt;if orig(i)='Strongly Agree' then kap(i)=5;&lt;BR /&gt;else if orig(i)='Agree' then kap(i)=4;&lt;BR /&gt;else if orig(i)='Neutral' then kap(i)=3;&lt;BR /&gt;else if orig(i)='Disagree' then kap(i)=2;&lt;BR /&gt;else if orig(i)='Strongly Disagree' then kap(i)=1;&lt;BR /&gt;end;&lt;BR /&gt;Total_KAP=sum(of kap(*));&lt;BR /&gt;if 28 &amp;lt; total_kap &amp;lt; 35 then kap_group='28-35';&lt;BR /&gt;else if 7 &amp;lt; total_kap &amp;lt; 14 then kap_group='7-14';&lt;BR /&gt;else kap_group='15-27';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 21:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251641#M56725</guid>
      <dc:creator>chelsealutz</dc:creator>
      <dc:date>2016-02-22T21:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Array Made Data Go Missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251647#M56728</link>
      <description>&lt;P&gt;The first place I would look as at the original data.&amp;nbsp; Most likely there are differences or variations in spelling.&amp;nbsp; Inspect the results from:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=have;&lt;/P&gt;
&lt;P&gt;tables norm_full_imm imm_men_take imm_resp_men imm_important imm_safe imm_protect_kids imm_heard_anything&lt;/P&gt;
&lt;P&gt;&amp;nbsp;/ missing;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That will probably point you in the right direction.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another possibility is that the variable names are not spelled correctly, so that's another item to examine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 21:56:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251647#M56728</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-02-22T21:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: Array Made Data Go Missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251654#M56730</link>
      <description>&lt;P&gt;Also, you should replace "&amp;lt;" by "&amp;lt;=". Otherwise, the categorization of several values (e.g. 7) will be incorrect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you considered defining an informat to assign the KAP values and a format to label the groups?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 22:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251654#M56730</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-22T22:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Array Made Data Go Missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251661#M56731</link>
      <description>&lt;P&gt;Nothing is missing from the original data, but I have determined that it is only the "strongly disagree" values that have gone missing. Does that shine anymore light on the situation? I'm afraid I'm stumped...&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 22:12:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251661#M56731</guid>
      <dc:creator>chelsealutz</dc:creator>
      <dc:date>2016-02-22T22:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Array Made Data Go Missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251663#M56732</link>
      <description>&lt;P&gt;I'm afraid that's a little (and by that I mean very) outside of my understanding of SAS.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 22:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251663#M56732</guid>
      <dc:creator>chelsealutz</dc:creator>
      <dc:date>2016-02-22T22:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Array Made Data Go Missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251668#M56734</link>
      <description>&lt;P&gt;No problem, it's OK to use IF/THEN/ELSE logic to assign those values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the issue with "&amp;lt;" vs.&amp;nbsp;"&amp;lt;=" is serious: If, for example, all seven questions were answered "Strongly Disagree", TOTAL_KAP would be 7, but KAP_GROUP&amp;nbsp;would be '15-27' with your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You say that the "strongly disagree" values have gone missing. This suggests that there could&amp;nbsp;be an issue with upper/lower case or with truncation ('Strongly Disagree' is the longest among the five character values). Please check if the values in question (of NORM_FULL_IMM&amp;nbsp;etc.) are exactly equal to the string &lt;FONT face="courier new,courier"&gt;Strongly Disagree&lt;/FONT&gt;. In particular, the seven character variables must have length 17 as a minimum.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 22:31:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251668#M56734</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-22T22:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Array Made Data Go Missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251669#M56735</link>
      <description>&lt;P&gt;I went ahead and added the "&amp;lt;=" and that's what ended up "fixing" part of it - originally it was more than just the "Strongly Disagree" that were missing; now, it's just those. I notice in my proc print output that it only displays&amp;nbsp;"Strongly Disag." Could that be the problem? I assumed because my code still said "Strongly Disagree" that it didn't matter what the output display was. If so, how would I fix that?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 22:37:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251669#M56735</guid>
      <dc:creator>chelsealutz</dc:creator>
      <dc:date>2016-02-22T22:37:04Z</dc:date>
    </item>
    <item>
      <title>Re: Array Made Data Go Missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251676#M56741</link>
      <description>&lt;P&gt;You have to make sure that the IF conditions are met with the actual values of your character variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, if &lt;FONT face="courier new,courier"&gt;NORM_FULL_IMM='Strongly Disag.'&lt;/FONT&gt;, the condition&lt;SPAN&gt;&amp;nbsp;&lt;FONT face="courier new,courier"&gt;if orig(1)='Strongly Disagree'&lt;/FONT&gt;&amp;nbsp;will not be met. You can modify the IF condition in different ways to be applicable:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; if orig(i)='Strongly Disag.' then kap(i)=1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This would be met for&amp;nbsp;an exact match &lt;SPAN&gt;only.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Alternatively, you could require the variable value to &lt;EM&gt;start with&lt;/EM&gt; "Strongly Dis" by using the colon modifier after the equals sign:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt; if orig(i)=:'Strongly Dis' then kap(i)=1;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Advantage: This would work even if some variables/observations contained 'Strongly Disagree' and others 'Strongly Disag.' or 'Strongly Disagr.' etc.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;(Edit: corrected a typo)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Feb 2016 08:49:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251676#M56741</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-02-23T08:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: Array Made Data Go Missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251681#M56742</link>
      <description>&lt;P&gt;The colon did the trick! Thank you very much for all of your help!&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2016 23:43:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251681#M56742</guid>
      <dc:creator>chelsealutz</dc:creator>
      <dc:date>2016-02-22T23:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Array Made Data Go Missing</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251700#M56750</link>
      <description>&lt;P&gt;You can also change the length of the variable in the array to make sure it works properly:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array array_name(*) &lt;STRONG&gt;$20.&lt;/STRONG&gt; listofvariables goes here;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Feb 2016 02:41:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-Made-Data-Go-Missing/m-p/251700#M56750</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-23T02:41:02Z</dc:date>
    </item>
  </channel>
</rss>

