<?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: HELP: Coding; cleaning data in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/HELP-Coding-cleaning-data/m-p/124271#M6508</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SCAN() function can be used to break up the composite response into separate responses.&amp;nbsp; You will need to know, or estimate, an upper bound to the number of possible individual responses to any question, and the maximum length of any individual reponse.&amp;nbsp; I'll assume 8 and 16. Also whether the comma is the only delimiter used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data recoded ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&amp;nbsp;&amp;nbsp;&amp;nbsp; survey ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Array resp (8) $16 resp1 - resp8 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do k = 1 to 8 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resp(k) = left(scan(reponse, k, ',')) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Drop k ;&lt;/P&gt;&lt;P&gt;Run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note - untested code.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard in Oz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Nov 2012 23:29:45 GMT</pubDate>
    <dc:creator>RichardinOz</dc:creator>
    <dc:date>2012-11-12T23:29:45Z</dc:date>
    <item>
      <title>HELP: Coding; cleaning data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/HELP-Coding-cleaning-data/m-p/124270#M6507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am very new to SAS. I was hoping someone would help we with a question. I have to do simple frequency diagrams for my professors survey. Anyhow, the excel data where all the answers are plugged in for a survey generate multiple answers for a question into 1 singular column rather than having seperate column for each answer for&amp;nbsp; example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Question A; How many colors do you like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Red&lt;/P&gt;&lt;P&gt;2. Green&lt;/P&gt;&lt;P&gt;3. Yellow&lt;/P&gt;&lt;P&gt;4. Bue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and so on and so forth, so instead of having a sepearte column for red, and green and yellow. The raw data is coming out like this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COLUMN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COLUMN1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; COLUMN2&lt;/P&gt;&lt;P&gt;User 1 : Red, Green&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rather than&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RED&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GREEN&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAS when generating frequencies, will simply list all the answers into 1 column like the raw data, I need them to be seperated. Can someone help me out&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Nov 2012 23:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/HELP-Coding-cleaning-data/m-p/124270#M6507</guid>
      <dc:creator>fides</dc:creator>
      <dc:date>2012-11-12T23:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: HELP: Coding; cleaning data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/HELP-Coding-cleaning-data/m-p/124271#M6508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SCAN() function can be used to break up the composite response into separate responses.&amp;nbsp; You will need to know, or estimate, an upper bound to the number of possible individual responses to any question, and the maximum length of any individual reponse.&amp;nbsp; I'll assume 8 and 16. Also whether the comma is the only delimiter used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Data recoded ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set&amp;nbsp;&amp;nbsp;&amp;nbsp; survey ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Array resp (8) $16 resp1 - resp8 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do k = 1 to 8 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; resp(k) = left(scan(reponse, k, ',')) ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Drop k ;&lt;/P&gt;&lt;P&gt;Run ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note - untested code.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard in Oz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Nov 2012 23:29:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/HELP-Coding-cleaning-data/m-p/124271#M6508</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2012-11-12T23:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: HELP: Coding; cleaning data</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/HELP-Coding-cleaning-data/m-p/124272#M6509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Another way to do it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat column $30.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input user column &amp;amp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 Red, Green&lt;/P&gt;&lt;P&gt;2 Yellow, Blue, Red&lt;/P&gt;&lt;P&gt;3 Yellow, Blue, Red, Green&lt;/P&gt;&lt;P&gt;4 Red&lt;/P&gt;&lt;P&gt;5 Green&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data need (drop=_:);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have (rename=(column=_column));&lt;/P&gt;&lt;P&gt;&amp;nbsp; _i=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do while (scan(_column,_i) ne "");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; column=scan(_column,_i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; _i+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose data=need out=want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var column;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by user;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2012 00:18:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/HELP-Coding-cleaning-data/m-p/124272#M6509</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-11-13T00:18:55Z</dc:date>
    </item>
  </channel>
</rss>

