<?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: Delimiting Codes in a Single Variable into Multiple Variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22217#M4823</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the line numbers in the error messages to see which statement is generating the error.&lt;/P&gt;&lt;P&gt;Most likely it is because the value returned from the SCAN function call is NOT a number.&amp;nbsp; You should be able to check that by looking at the values for the variables printed in the log. The second error message is then caused by trying to use the missing value in the variable I to index into the array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can break it into smaller steps to see more in the log or to add your own error checking.&amp;nbsp; It is possible that the value of variable CRA60 has characters other than digits and semi-colons that are causing this error.&amp;nbsp; You can use the ?? modifier prefix on the format in the input statement to suppress the error messages when the value is not a valid number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P style="background-color: #eef4f9;"&gt;do j=1 by 1 while (scan(cra60,j,';') ne ' ');&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; next=scan(cra60,j,';');&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; i = input(next,??best.);&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; if i ne . then cra60_(i)=1;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; else &lt;SPAN style="font-family: monospace; white-space: pre; background-color: #eef4f9;"&gt;put case= cra60= j= next= next $hex. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;end;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;drop i j next ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Dec 2011 19:28:02 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2011-12-30T19:28:02Z</dc:date>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22210#M4816</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I work at a city level evaluation office for child welfare agencies. For each agency we evaluate, we use a series of surveys.&amp;nbsp; The surveys have questions that ask the evaluator to check “all that apply”.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is an example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q16. Which of the following controlling interventions did the case planner provide to control the safety factor(s)? (Check all that apply)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code&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; Responce Option &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; 1=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Intensive Home Based Family PreservationServices &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; 2=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Family has been provided Emergency Shelter &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; 3=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Family has been safely moved to a DV Shelter&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; 4=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Caretaker has been moved to a safe environment&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; 5=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Authorization of Emergency Food/Cash&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; 6=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Judicial Intervention &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; 7=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Order of Protection&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; 8=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Law Enforcement involvement&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt; 9=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Emergency Medical Services&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;10=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Crisis Mental Health Services have beenprovided&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;11=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Emergency In-patient Mental Health Serviceshave been provided &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;12=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Immediate Supervision/Monitoring&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;13=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Emergency Alcohol Abuse Services have beenprovided &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;14=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Emergency Drug Abuse Services &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When the raw data is &lt;SPAN style="font-family: Arial; font-size: 10pt;"&gt;generated from the database&amp;nbsp; &lt;/SPAN&gt;the “check all that apply” question response option codes are all contained in one cell and separated&amp;nbsp; by a “;” for each case. See below. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Raw Data&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="border-image: initial; height: 176px; width: 52px; border-width: 1px; border-color: #000000; border-style: solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Case &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Q16&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="text-align: -webkit-center;"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;case1&lt;/STRONG&gt;ccc&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD&gt;1;3;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;case2&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;case3&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;5;7;12;14&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;case4&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;1;2;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;case5&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;case6&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;6;8;10;12;13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;case7&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;4;8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;What I need to do is delimitate the column (kind of like the “Text to Columns” option in excel) so for each case all the response option codes have their own variable.&amp;nbsp; The new variables must be in the order the codes appear in the original variable, in this case Q16.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="font-size: 10pt; font-family: Arial;"&gt;Q16 should now look like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" height="183" style="border-image: initial; height: 183px; width: 855px; border-width: 1px; border-color: #000000; border-style: solid;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Case &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Q16_a&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;Q16_b&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;Q16_c&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;Q16_d&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;Q16_e&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD style="text-align: left;"&gt;7&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case3&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case4&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case5&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case6&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case7&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;Q16 was separated into 5 variables because in &lt;STRONG&gt;case6&lt;/STRONG&gt; &lt;SPAN style="text-decoration: underline;"&gt;5&amp;nbsp; r&lt;/SPAN&gt;esponse options were checked by the evaluator. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There will be a different number response options for the “check all that apply” questions&amp;nbsp; for each case – one case could just have 2;11 and one case could have all 14 codes . For Q16 there are 14 response options, so there is the potential the evaluator could check all the options for a case. Therefore, for that case, the codes would need to fit into 14 new variables. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;And then all the codes need to be decoded, so the final product should look like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" cellpadding="3" cellspacing="0" class="jiveBorder" style="width: 100%; border: 1px solid #000000;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Case&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Q16_a&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Q16_b&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;Q16_c&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;Q16_d&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;TH align="center" style="background-color: #6690bc;" valign="middle"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #ffffff; text-align: -webkit-center; background-color: #6690bc;"&gt;Q16_e&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case1&lt;/TD&gt;&lt;TD&gt;Intensive Home Based Family PreservationServices &lt;/TD&gt;&lt;TD&gt;Family has been safely moved to a DV Shelter&lt;/TD&gt;&lt;TD&gt;Order of Protection&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case2&lt;/TD&gt;&lt;TD&gt;Family has been provided Emergency Shelter &lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case3&lt;/TD&gt;&lt;TD&gt;Authorization of Emergency Food/Cash&lt;/TD&gt;&lt;TD&gt;Order of Protection&lt;/TD&gt;&lt;TD&gt;Immediate Supervision/Monitoring&lt;/TD&gt;&lt;TD&gt; Emergency Drug Abuse Services &lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case4&lt;/TD&gt;&lt;TD&gt;Intensive Home Based Family PreservationServices &lt;/TD&gt;&lt;TD&gt;Family has been provided Emergency Shelter &lt;/TD&gt;&lt;TD&gt;Caretaker has been moved to a safe environment&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case5&lt;/TD&gt;&lt;TD&gt;Family has been safely moved to a DV Shelter&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case6&lt;/TD&gt;&lt;TD&gt;Judicial Intervention &lt;/TD&gt;&lt;TD&gt; Law Enforcement involvement&lt;/TD&gt;&lt;TD&gt;Crisis Mental Health Services have beenprovided&lt;/TD&gt;&lt;TD&gt;Immediate Supervision/Monitoring&lt;/TD&gt;&lt;TD&gt; Emergency Alcohol Abuse Services have beenprovided &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;case7&lt;/TD&gt;&lt;TD&gt;Caretaker has been moved to a safe environment&lt;/TD&gt;&lt;TD&gt;Law Enforcement involvement&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, for &lt;STRONG&gt;case3&lt;/STRONG&gt; &lt;SPAN style="text-decoration: underline;"&gt;4&lt;/SPAN&gt; controling interventions were used and for &lt;STRONG&gt;case7&lt;/STRONG&gt;&lt;SPAN style="text-decoration: underline;"&gt; 2&lt;/SPAN&gt; controling interventions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In addtion, there will be a different sample size for each agency. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I’ve asked around for help and the b&lt;SPAN style="font-family: Arial; font-size: 10pt;"&gt;rief &lt;/SPAN&gt;responses I’ve received include:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Use SCAN and/or SUBSTR Functions &lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Create a dynamic Macros using %Do -%TO-%END ect…&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I’m not familiar with any of these procedures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly appreciated. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 16:17:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22210#M4816</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2011-12-30T16:17:31Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22211#M4817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The tables were too big. It looks like varible 16_e was cut off. Sorry. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 16:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22211#M4817</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2011-12-30T16:22:46Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22212#M4818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are a number of ways to do what you want.&amp;nbsp; Below is one such way.&amp;nbsp; I didn't complete the entire task, as I don't know your full coding scheme.&amp;nbsp; What it is missing is a proc format that assigns your definitions to each value:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input Case $ Q16 $20.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards4;&lt;/P&gt;&lt;P&gt;case1 1;3;7&lt;/P&gt;&lt;P&gt;case2 2&lt;/P&gt;&lt;P&gt;case3 5;7;12;14&lt;/P&gt;&lt;P&gt;case4 1;2;4&lt;/P&gt;&lt;P&gt;case5 3&lt;/P&gt;&lt;P&gt;case6 6;8;10;12;13&lt;/P&gt;&lt;P&gt;case7 4;8&lt;/P&gt;&lt;P&gt;;;;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data need (keep=case q16_);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do while (scan(Q16,i,";") ne "");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Q16_=input(scan(Q16,i,";"),12.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i+1;&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 &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;&amp;nbsp;&amp;nbsp; out=want (drop=_:)&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;&amp;nbsp;&amp;nbsp; prefix=q16_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var q16_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by case;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 17:31:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22212#M4818</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-30T17:31:44Z</dc:date>
    </item>
    <item>
      <title>Re: Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22213#M4819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For use in analysis it probably makes the most sense to create a new variable for each possible response and assign it a 0/1 value to indicate whether it was included in the list or not.&amp;nbsp; For example for Q16 there are 14 things to choose so you need to make 14 new variables.&amp;nbsp; You can then create an array of these new variables, loop over the values in the original string variable and use the pulled out value as an index into the array to set the flag to indicate that choice was selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array q16_ q16_1 - q16_14 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; * Set all of the flag variables to false ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to dim(q16_);&amp;nbsp; q16_(i)=0; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; * Loop over selected items and set to true ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do j=1 by 1 while (scan(q16,j,';') ne ' ');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = input(scan(q16,j,';'),best.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; q16_(i)=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop i j ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To convert it to the format you requested we would need change the logic a little.&amp;nbsp; It will be easier if you first create a format for the question responses.&amp;nbsp; Note that format names cannot end in a number so name the format something like Q16F.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;data want ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array q16_ $50 q16_1 - q16_14 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; * Loop over selected items and output formatted value of selection number ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do j=1 by 1 while (scan(q16,j,';') ne ' ');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = input(scan(q16,j,';'),best.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; q16_(j)=put(i,q16f.);&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop i j ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 17:37:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22213#M4819</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-12-30T17:37:39Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22214#M4820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much Tom! So I tried this on the dataset on a question cra60. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Pre.cra60test ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set Pre.Sheet1 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; array cra60_ cra60_1 - cra60_14 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; * Set all of the flag variables to false ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do i=1 to dim(cra60_);&amp;nbsp; cra60_ (i)=0; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; * Loop over selected items and set to true ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do j=1 by 1 while (scan(cra60,j,';') ne ' ');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = input(scan(cra60,j,';'),best.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cra60_(i)=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop i j ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I get these messages st the begining of the log:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Invalid argument to function INPUT at line 819 column 9.&lt;/P&gt;&lt;P&gt;ERROR: Array subscript out of range at line 820 column 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Then the log shows all the questions in the dataset with an =and a number =and a *&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and then the array which was created &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cra60_1=0 cra60_2=0 cra60_3=0 cra60_4=0 cra60_5=0 cra60_6=0 cra60_7=0 cra60_8=0 cra60_9=0 cra60_10=0 cra60_11=0 cra60_12=0 cra60_13=0 cra60_14=0 &lt;/P&gt;&lt;P&gt;i= j=1 _ERROR_=1 _N_=1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Then these final messages:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Each place is given by: (Number of times) at (Line):(Column).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 at 819:9&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;NOTE: There were 1 observations read from the data set PRE.SHEET1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like this is being run for all the Questions/Variables in the dataset, not just cra60.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is greatly aperciated. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 19:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22214#M4820</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2011-12-30T19:07:24Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22215#M4821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much art297!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial; font-size: 10pt;"&gt;Question:The sample and response options &lt;/SPAN&gt;are different every time and we evaluatemany agencies. We won’t be able to enter in a dataset manually using CARDS everytime. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 19:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22215#M4821</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2011-12-30T19:12:01Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22216#M4822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sorry i forgot to mention. I get 0 observations back in the new dataset. Thanks again. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 19:15:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22216#M4822</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2011-12-30T19:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22217#M4823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the line numbers in the error messages to see which statement is generating the error.&lt;/P&gt;&lt;P&gt;Most likely it is because the value returned from the SCAN function call is NOT a number.&amp;nbsp; You should be able to check that by looking at the values for the variables printed in the log. The second error message is then caused by trying to use the missing value in the variable I to index into the array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can break it into smaller steps to see more in the log or to add your own error checking.&amp;nbsp; It is possible that the value of variable CRA60 has characters other than digits and semi-colons that are causing this error.&amp;nbsp; You can use the ?? modifier prefix on the format in the input statement to suppress the error messages when the value is not a valid number.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P style="background-color: #eef4f9;"&gt;do j=1 by 1 while (scan(cra60,j,';') ne ' ');&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; next=scan(cra60,j,';');&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; i = input(next,??best.);&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; if i ne . then cra60_(i)=1;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; else &lt;SPAN style="font-family: monospace; white-space: pre; background-color: #eef4f9;"&gt;put case= cra60= j= next= next $hex. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;end;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;drop i j next ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 19:28:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22217#M4823</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-12-30T19:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22218#M4824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art just included your sample data to make it easier for others to run the code he is suggesting.&lt;/P&gt;&lt;P&gt;You can add an INFILE statement to read data from a text file.&amp;nbsp; Or use some other method to read your source data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 19:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22218#M4824</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-12-30T19:30:21Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22219#M4825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 20:22:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22219#M4825</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2011-12-30T20:22:34Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22220#M4826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Art--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Where do I assign the format definitions for each value? So if I create a format $cra60f do I add it to proc transpose?&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc transpose &lt;/P&gt;&lt;P&gt;data=Pre.Q60 &lt;/P&gt;&lt;P&gt;out=Pre.Q60&amp;nbsp; (drop=_:)&lt;/P&gt;&lt;P&gt;prefix= cra60_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var cra60_ ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by Case_No;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 20:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22220#M4826</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2011-12-30T20:37:05Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22221#M4827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My response isn't in the SAS realm. I have worked with at least two different survey software packages that can exhibit a similar data output/export behavior. Both packages had options that allowed configuration of multiple choice output in two or three different forms. It may well be worth expoloring those options as they may avoid lots of work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are working with a contractor that provides collected data, prod them to look for other export options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, another approach to data you have is to set dichotomous variables such that Q16a is yes=1/no=0 for Intensive Home Based Family PreservationServices. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on the analysis you are doing you can then use SUM in PROC MEANS, REPORT or TABULATE to get the number receiving that service, MEAN ( * 100) would be the percent receiving, and N the count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your current approach is going to require looking across multiple Q16 variables to answer questions about specific topics.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 20:38:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22221#M4827</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2011-12-30T20:38:08Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22222#M4828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial;"&gt;Hi Tom. Thank youaginin for your help. I got your code to work but I amstill not sure what these 3 lines of code mean. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;i = input(next,??best.);&lt;BR /&gt;&amp;nbsp; if i ne . then cra60_(i)=1;&lt;BR /&gt;&amp;nbsp; else put case= cra60= j= next= next $hex. ;&lt;BR /&gt;end;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial;"&gt;The variables Next, i and j mean what?&amp;nbsp; I can't seem to find a description for the format $hex.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Arial;"&gt;Again, thanks for all your help today!&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 20:56:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22222#M4828</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2011-12-30T20:56:19Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22223#M4829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you look at Tom's code, the line you are asking about is just putting some things in your log so that you can figure out what is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;next is a variable that is created by the statement: &lt;CODE class="jive-code"&gt;next=scan(cra60,j,';');&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&lt;CODE class="jive-code"&gt;&lt;/CODE&gt;i is a variable that is created by the statement:&amp;nbsp; i=&lt;SPAN style="font-family: monospace; font-size: 16px; background-color: #eef4f9;"&gt;input(next,??best.);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace; font-size: 16px; background-color: #eef4f9;"&gt;j is a variable that was created by the loop:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace; font-size: 16px; background-color: #eef4f9;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="jive-pre" style="font-size: 1.2em;"&gt;&lt;CODE class="jive-code"&gt;do j=1 by 1 while (scan(cra60,j,';') ne ' ');&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: monospace; font-size: 16px; background-color: #eef4f9;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 21:35:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22223#M4829</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-30T21:35:40Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22224#M4830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The INPUT() function is used to convert the characters in the variable NEXT to a number in the variable I.&lt;/P&gt;&lt;P&gt;The IF statement is so that only numbers will cause SAS to execute the assignment statement.&amp;nbsp; You might want to make it more specific than just testing for not missing.&amp;nbsp; Try IF 1 &amp;lt;= I &amp;lt;= dim(cra60_) THEN ....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I is missing the PUT statement will run and you will see in the log the values of the variables.&amp;nbsp; The most likely characters that you might see that could have caused the errors you got before are formatting characters like tab,line feed or carriage return. The HEX code representation of those three characters are 09,0A and 0D , respectively. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a link to the manual page for $HEX format.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000205099.htm"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000205099.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 22:00:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22224#M4830</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-12-30T22:00:59Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22225#M4831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! last question: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt;Where do I assign the format definitions for each value? So if I create a format cra60f do I add it to proc transpose? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;proc transpose&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;data=Pre.Q60&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;out=Pre.Q60&amp;nbsp; (drop=_:)&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;prefix= cra60_;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; var cra60_ ;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;&amp;nbsp; by Case_No;&lt;/P&gt;&lt;P style="background-color: #eef4f9; font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 22:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22225#M4831</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2011-12-30T22:06:25Z</dc:date>
    </item>
    <item>
      <title>Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22226#M4832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure which approach you finally took and knowing that will be necessary to provide the best advice.&amp;nbsp; If you know have a series of 1 and 0 coded variables, for example, you would probably be best assigning variable labels rather than trying to use a format and only possibly use a format to show the values of 1 and 0 as checked or not checked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What does your final datafile cuurently look like.&amp;nbsp; Can you provide a couple of its lines?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 22:15:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22226#M4832</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-30T22:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22227#M4833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Tom and Art.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;Tom, your version was perfect for analysis. I can now effectively count the frequencies of all different interventions. This is great!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;Art, your version is perfect for m&lt;/SPAN&gt;&lt;SPAN style="font-family: Arial; font-size: 10pt;"&gt;anipulating the data to &lt;/SPAN&gt;&lt;SPAN style="font-family: Arial; font-size: 10pt;"&gt;send out to agencies. Please see the version i used below . Thanks so Much!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Pre.Q60 (keep=Agency_Name Case_No Case_FirstName Case_LastName cra60_);&lt;/P&gt;&lt;P&gt;&amp;nbsp; set Pre.Presheet1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; i=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do while (scan(cra60,i,";") ne "");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cra60_=input(scan(cra60,i,";"),12.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i+1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;Proc sort data= Pre.Q60; &lt;/P&gt;&lt;P&gt;by Case_No;&lt;/P&gt;&lt;P&gt;proc transpose &lt;/P&gt;&lt;P&gt;data=Pre.Q60 &lt;/P&gt;&lt;P&gt;out=Pre.Q60 (drop=_:) &lt;/P&gt;&lt;P&gt;prefix= cra60_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; var cra60_&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; format cra60_ cra60format.; &lt;/P&gt;&lt;P&gt;&amp;nbsp; by Case_No;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 22:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22227#M4833</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2011-12-30T22:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22228#M4834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="background-color: #eef4f9;"&gt;Thanks Tom and Art.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;Tom, your version was perfect for analysis. I can now effectively count the frequencies of all different interventions. This is great!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;Art, your version is perfect for m&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;anipulating the data to &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Arial;"&gt;send out to agencies. Please see the version i used below . Thanks so Much!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;data Pre.Q60 (keep=Agency_Name Case_No Case_FirstName Case_LastName cra60_);&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; set Pre.Presheet1;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; i=1;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; do while (scan(cra60,i,";") ne "");&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cra60_=input(scan(cra60,i,";"),12.);&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i+1;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; end;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;Proc sort data= Pre.Q60;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;by Case_No;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;proc transpose&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;data=Pre.Q60&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;out=Pre.Q60 (drop=_:)&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;prefix= cra60_;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; var cra60_&amp;nbsp; ;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; format cra60_ cra60format.;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;&amp;nbsp; by Case_No;&lt;/P&gt;&lt;P style="background-color: #eef4f9;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 22:55:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22228#M4834</guid>
      <dc:creator>Mgarret</dc:creator>
      <dc:date>2011-12-30T22:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Delimiting Codes in a Single Variable into Multiple Variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22229#M4835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm still just guessing as to what your resulting file looks like, but I think that the following (or something quite similar) is what you will need to finish the task:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data labels;&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat response $50.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input Code $ Response &amp;amp;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;cra60_1&amp;nbsp; Intensive Home Based Family PreservationServices&lt;/P&gt;&lt;P&gt;cra60_2&amp;nbsp; Family has been provided Emergency Shelter&lt;/P&gt;&lt;P&gt;cra60_3&amp;nbsp; Family has been safely moved to a DV Shelter&lt;/P&gt;&lt;P&gt;cra60_4&amp;nbsp; Caretaker has been moved to a safe environment&lt;/P&gt;&lt;P&gt;cra60_5&amp;nbsp; Authorization of Emergency Food/Cash&lt;/P&gt;&lt;P&gt;cra60_6&amp;nbsp; Judicial Intervention&lt;/P&gt;&lt;P&gt;cra60_7&amp;nbsp; Order of Protection&lt;/P&gt;&lt;P&gt;cra60_8&amp;nbsp; Law Enforcement involvement&lt;/P&gt;&lt;P&gt;cra60_9&amp;nbsp; Emergency Medical Services&lt;/P&gt;&lt;P&gt;cra60_10 Crisis Mental Health Services have beenprovided&lt;/P&gt;&lt;P&gt;cra60_11 Emergency In-patient Mental Health Serviceshave been provided&lt;/P&gt;&lt;P&gt;cra60_12 Immediate Supervision/Monitoring&lt;/P&gt;&lt;P&gt;cra60_13 Emergency Alcohol Abuse Services have beenprovided&lt;/P&gt;&lt;P&gt;cra60_14 Emergency Drug Abuse Services&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;&amp;nbsp; select "label "||Code||'="'||Response||'"'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; into :labels&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; separated by " "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from labels&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*What I think you currently have*/&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input cra60_1-cra60_14;&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;1 0 1 0 1 1 1 1 1 1 0 1 0 1&lt;/P&gt;&lt;P&gt;0 1 1 1 0 0 0 1 1 0 1 1 1 1&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;amp;labels.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Dec 2011 23:27:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Delimiting-Codes-in-a-Single-Variable-into-Multiple-Variables/m-p/22229#M4835</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-12-30T23:27:17Z</dc:date>
    </item>
  </channel>
</rss>

