<?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 Separating multiple response variables in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Separating-multiple-response-variables-in-SAS/m-p/883604#M349105</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a multiple choice data set in which respondents can select more than one answer (select all that apply). The Excel sheet separates these multiple answers with a comma (i.e. 1,3). Value labels are assigned in the syntax but SAS groups these numbers into one new number; therefore, there is no value assigned. How can I make SAS separate these multiple answers?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="icedcoffee3011_0-1688576253671.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85570i9C0EAD966B068C12/image-size/medium?v=v2&amp;amp;px=400" role="button" title="icedcoffee3011_0-1688576253671.png" alt="icedcoffee3011_0-1688576253671.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;*Frequencies should be: 9 and 3 not 8, 2 and 1*&lt;/P&gt;&lt;P&gt;The image above shows my output for one of the variables. The values are as follows: 1='Intervention clinic', 2='Medical office', and 3='Other'. The 13 in the table is because someone selected options 1 and 3 in the survey.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope I am being clear on what I want and appreciate any help.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jul 2023 17:05:03 GMT</pubDate>
    <dc:creator>icedcoffee3011</dc:creator>
    <dc:date>2023-07-05T17:05:03Z</dc:date>
    <item>
      <title>Separating multiple response variables in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separating-multiple-response-variables-in-SAS/m-p/883604#M349105</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a multiple choice data set in which respondents can select more than one answer (select all that apply). The Excel sheet separates these multiple answers with a comma (i.e. 1,3). Value labels are assigned in the syntax but SAS groups these numbers into one new number; therefore, there is no value assigned. How can I make SAS separate these multiple answers?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="icedcoffee3011_0-1688576253671.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/85570i9C0EAD966B068C12/image-size/medium?v=v2&amp;amp;px=400" role="button" title="icedcoffee3011_0-1688576253671.png" alt="icedcoffee3011_0-1688576253671.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;*Frequencies should be: 9 and 3 not 8, 2 and 1*&lt;/P&gt;&lt;P&gt;The image above shows my output for one of the variables. The values are as follows: 1='Intervention clinic', 2='Medical office', and 3='Other'. The 13 in the table is because someone selected options 1 and 3 in the survey.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope I am being clear on what I want and appreciate any help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2023 17:05:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separating-multiple-response-variables-in-SAS/m-p/883604#M349105</guid>
      <dc:creator>icedcoffee3011</dc:creator>
      <dc:date>2023-07-05T17:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Separating multiple response variables in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separating-multiple-response-variables-in-SAS/m-p/883605#M349106</link>
      <description>&lt;P&gt;If you want to convert '1,3' into two separate observations do something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want; 
  set have ;
  single=scan(multiple,1,',');
  output;
  do i=2 to countw(multiple,',');
    single=scan(multiple,1,',');
    output;
  end;
  format single $responce. ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now you can run PROC FREQ on the variable SINGLE instead of the original variable MULTIPLE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your format for decoding the codes into human recognizable text is a numeric format then use the INPUT() function to convert the string into a number.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;...
    single=input(scan(multiple,1,','),32.);
...
  format single responce. ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Jul 2023 17:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separating-multiple-response-variables-in-SAS/m-p/883605#M349106</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-07-05T17:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Separating multiple response variables in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Separating-multiple-response-variables-in-SAS/m-p/883607#M349107</link>
      <description>&lt;P&gt;Separate the multiple choices into multiple observations:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have (rename=(placeenc=_placeenc));
do i = 1 to countw(_placeenc,",");
  placeenc = scan(_placeenc,i,",");
  output;
end;
drop i _placeenc;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Jul 2023 17:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Separating-multiple-response-variables-in-SAS/m-p/883607#M349107</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-07-05T17:17:31Z</dc:date>
    </item>
  </channel>
</rss>

