<?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: Can I create a new variable from text in another variable? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599161#M16442</link>
    <description>&lt;P&gt;If the survey, for example, allows choices A B C or multiple choices such as BC or ABC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could have variable A to be a 1 or zero, variable B to be a 1 or zero, variable C to be a 1 or zero. Not knowing the full details of your situation and planned analyses, I would prefer this one (but other methods might work depending on situation)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in order to provide code, we'd need to know how your data is arriving, and what you plan to do with it.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Oct 2019 21:45:49 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-10-24T21:45:49Z</dc:date>
    <item>
      <title>Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599140#M16439</link>
      <description>&lt;P&gt;I have survey data I'm trying to process and have the situation that a few of the questions ask a person filling out the form to "select all that apply". The result is a meaningless collection of text in one column (variable) such as the following:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Question on the survey is:&amp;nbsp;Check all that apply... how was the HSS helpful?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Connecting me with resources&lt;/P&gt;&lt;P&gt;Helping me with feeding issues&lt;/P&gt;&lt;P&gt;Providing me with information about my child's development&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If a person selects all answers my variable text looks like the following and is useless:&amp;nbsp;&lt;/P&gt;&lt;P&gt;"Connecting me with resources Helping me with feeding issues Providing me with information about my child's development"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to search the variable text and create a new (dummy) variable from the identification of key words? Or is a better way to think about processing this and creating a new variable? Thanks in advance!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 19:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599140#M16439</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-10-24T19:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599161#M16442</link>
      <description>&lt;P&gt;If the survey, for example, allows choices A B C or multiple choices such as BC or ABC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could have variable A to be a 1 or zero, variable B to be a 1 or zero, variable C to be a 1 or zero. Not knowing the full details of your situation and planned analyses, I would prefer this one (but other methods might work depending on situation)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But in order to provide code, we'd need to know how your data is arriving, and what you plan to do with it.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 21:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599161#M16442</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-10-24T21:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599187#M16456</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/285053"&gt;@accintron&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have survey data I'm trying to process and have the situation that a few of the questions ask a person filling out the form to "select all that apply". The result is a meaningless collection of text in one column (variable) such as the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Question on the survey is:&amp;nbsp;Check all that apply... how was the HSS helpful?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Connecting me with resources&lt;/P&gt;
&lt;P&gt;Helping me with feeding issues&lt;/P&gt;
&lt;P&gt;Providing me with information about my child's development&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If a person selects all answers my variable text looks like the following and is useless:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Connecting me with resources Helping me with feeding issues Providing me with information about my child's development"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to search the variable text and create a new (dummy) variable from the identification of key words? Or is a better way to think about processing this and creating a new variable? Thanks in advance!!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You will likely be better off creating a separate variable that is coded 1(present) or 0(not present) using the entire text of the responses as provided. An example plus something that does not occur in your example but uses likely keywords in a different sense.&lt;/P&gt;
&lt;PRE&gt;data example;
   string= "Connecting me with resources Helping me with feeding issues Providing me with information about my child's development";

   ConnectResources= index(string,"Connecting me with resources")&amp;gt;0;
   HelpFeed        = index(string,"Helping me with feeding issues")&amp;gt;0;
   ChildDevelop    = index(string,"Providing me with information about my child's development")&amp;gt;0 ;
   FeedingResources= index(string,"Connecting me with feeding resources")&amp;gt;0;
run;&lt;/PRE&gt;
&lt;P&gt;SAS will return a numeric value of 1 for true and 0 for false. The index function returns information about where in the string your search text returns or 0 if not found. So comparing the index result &amp;gt; 0 returns 1.&lt;/P&gt;
&lt;P&gt;I would also apply a label to the variables with the Text of the response value as that will make nicer reports.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest using the 1/0 coding as then you can use statistics like Sum to get the number of True/Yes results or Mean to get the percent true.&lt;/P&gt;
&lt;P&gt;There are some nice things that can be done on a per respondent basis like using sum/mean to get the respondents profile for a question(group), Range to tell if all the responses are the same (range=0), Any Yes (max = 1) , any No (min=0).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 22:00:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599187#M16456</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-24T22:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599208#M16467</link>
      <description>&lt;P&gt;You know what answers are possible (as text) so you can just search for this text in your variable to determine if it has been given or not (using the find() function for example).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How you then best store the data depends on how you plan to analyse it. You could create a code for any possible combination and just store the code, or you create a variable array with a variable per possible answer and with values 0 and 1.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 01:11:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599208#M16467</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-10-25T01:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599348#M16490</link>
      <description>&lt;P&gt;Thanks for your response Paige. When a respondent checks multiple responses, all the answers are currently output to the dataset into one column as running text like:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV align="center"&gt;"Connecting me with resources (e.g., housing assistance, diapers, employment, etc.) Helping me with feeding issues (e.g., breastfeeding support) Providing me with information about my childs development Helping me with concerns I have about my child Being available to&lt;/DIV&gt;&lt;DIV align="center"&gt;me in between my childs doctor visits"&lt;/DIV&gt;&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV align="center"&gt;I want to just be able to run frequencies for each response, counting the number of occurences, so I think dummy variables 0,1 would be best, but need to have SAS be able to read the text and create a variable from that.&lt;/DIV&gt;&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 25 Oct 2019 14:44:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599348#M16490</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-10-25T14:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599353#M16491</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/285053"&gt;@accintron&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for your response Paige. When a respondent checks multiple responses, all the answers are currently output to the dataset into one column as running text like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV align="center"&gt;"Connecting me with resources (e.g., housing assistance, diapers, employment, etc.) Helping me with feeding issues (e.g., breastfeeding support) Providing me with information about my childs development Helping me with concerns I have about my child Being available to&lt;/DIV&gt;
&lt;DIV align="center"&gt;me in between my childs doctor visits"&lt;/DIV&gt;
&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV align="center"&gt;I want to just be able to run frequencies for each response, counting the number of occurences, so I think dummy variables 0,1 would be best, but need to have SAS be able to read the text and create a variable from that.&lt;/DIV&gt;
&lt;DIV align="center"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Does the system insert anything between the values (perhaps there is TAB or CR or LF there you are not showing)? If so you could scan the list to break into the components.&amp;nbsp; In that case you might be able to write a generic program that could convert any of these type of multi-response questions into multiple variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise you will need to know the possible values to be able to make the new variables. Some thing like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have ;
  q1_resource = 0&amp;lt;indexw(q1,'Connecting me with resources (e.g., housing assistance, diapers, employment, etc.) ');
  q1_feeding = 0&amp;lt;indexw(q1,'Helping me with feeding issues (e.g., breastfeeding support)');
  ....
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;NOTE; If there is no delimiter then watch out to make sure some choices are not sub strings of other possible choices.&amp;nbsp; That is why i used INDEXW() instead of INDEX() in the example above as it will reduce the risk of mismatching when you have choices like:&amp;nbsp; FATHER, GRANDFATHER, ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a metadata source that lists the possible answers to a question then you should be able to write a program that generates the code you need from that metadata.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 15:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599353#M16491</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-25T15:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599355#M16492</link>
      <description>&lt;P&gt;Creating the dummy variables is what I had in mind...&lt;/P&gt;&lt;P&gt;I've adopted your code but it does not seem to be capturing the responses and creating variables appropriately...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my actual code with all the possible responses a respondent can select:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data test;&lt;BR /&gt;set site3.parent;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;ConnectResources = index(Q20_HSS_Helpful, "Connecting me with resources (e.g., housing assistance, diapers, employment, etc.)")&amp;gt;0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;HelpFeed = index(Q20_HSS_Helpful, "Helping me with feeding issues (e.g., breastfeeding support)")&amp;gt;0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;ChildDevelop = index(Q20_HSS_Helpful, "Providing me with information about my childs development")&amp;gt;0 ;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;ChildCareInfo = index(Q20_HSS_Helpful, "Providing me with information about how to care for my child")&amp;gt;0; &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;HelpChildConcerns = index(Q20_HSS_Helpful, "Helping me with concerns I have about my child")&amp;gt;0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;HelpSelfFamilyConcerns = index(Q20_HSS_Helpful, "Helping me with concerns I have about myself or my family")&amp;gt;0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;AvailableBtwnVisits = index(Q20_HSS_Helpful, "Being available to me in between my childs doctor visits")&amp;gt;0;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the resulting columns in the table:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33401i46DC2ED59E968C59/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 15:05:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599355#M16492</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-10-25T15:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599360#M16493</link>
      <description>&lt;P&gt;Something else to consider if you have access or are working with a good contractor is the actual data export.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on the survey software used you may be able to ask for multiple response variables to be exported from the collection software as either dummy coded (some sort of true/false selected/not selected ) for each possible response or other one variable per possible response value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know that several Survey collection packages I used had different options for how the data was exported and often the default wasn't always the most useful.&lt;/P&gt;
&lt;P&gt;For example one package with multiple response variables would default to the order selected, which is useful for some tasks (i.e, how many respondents&amp;nbsp;picked choice A first)&amp;nbsp;but a PITA to read as any column could have a specific value. So that often would entail reading the data and then creating extra variables for the "did this response get chosen" for each possible response to do frequencies as you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 15:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599360#M16493</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-25T15:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599361#M16494</link>
      <description>&lt;P&gt;Hard to tell what is in that text variable from Polaroids of the data.&lt;/P&gt;
&lt;P&gt;Try copy and paste.&amp;nbsp; Try printing the value using $HEX format so you can tell if those are actual spaces (hexcode '20'x) between the words or something else.&lt;/P&gt;
&lt;P&gt;Try using FINDW() function as it has options to do case insensitive search.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 15:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599361#M16494</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-25T15:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599377#M16495</link>
      <description>&lt;P&gt;Ok, thank you for the feedback. I can't figure out the hexformat thing, it's giving me lots of problems for something that is probably so simple, but thanks for the suggestion anyway. I'm going to have to give this coding issue a break and come back to it later. Thanks for your suggestions.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 15:44:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599377#M16495</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-10-25T15:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599381#M16496</link>
      <description>&lt;P&gt;Thank you, that's a good point. I'll start by asking the ladies who use the survey software more frequently to see how they handle the select all answers questions and go from there. Thansk for all of your help!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 15:45:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/599381#M16496</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-10-25T15:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/602773#M16857</link>
      <description>&lt;P&gt;I finally came back to this. The issue I was having was punctuation wasn't allowing responses to be captured appropriately so I ended up using only the portion of the response needed to uniquely identify it to create new variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;For instance, instead of: 
ChildDevelop    = index(string,"Providing me with information about my &lt;STRONG&gt;child's development&lt;/STRONG&gt;")&amp;gt;0 ;&lt;BR /&gt;&lt;BR /&gt;I did:&lt;BR /&gt;ChildDevelop = index(string,"Providing me with information about my")&amp;gt;0 ;
 &lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 16:59:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/602773#M16857</guid>
      <dc:creator>accintron</dc:creator>
      <dc:date>2019-11-08T16:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can I create a new variable from text in another variable?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/602786#M16860</link>
      <description>&lt;P&gt;Exporting the data to a CSV file, since appears that you may have had this as a spreadsheet, may help. Then you can copy and paste text from the actual values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I note that you apparently have at least one value that is , likely, replacing a curly ' (not the simple programing single quote) to a " |" or similar. I suspect the text expected would be "child's" but because of any number of places the quote became a "smart quote" and so some text may not search as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that in SAS you can use different quotes&amp;nbsp;of single and double&amp;nbsp;as needed such as "Some text with a single quote's" to control interpretation. And if that gets difficult because of mixed quotes in the text you can search for quotes by doubling them:&lt;/P&gt;
&lt;PRE&gt;data example;
   x="Some text with ' in it";
   y="Some text with ' and "" in it";
   z='Some text with '' in the middle';
run;&lt;/PRE&gt;
&lt;P&gt;And I do sympathize. I have had to parse out data collected for "fillable" PDF forms that provided should "check all data".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 17:33:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Can-I-create-a-new-variable-from-text-in-another-variable/m-p/602786#M16860</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-11-08T17:33:01Z</dc:date>
    </item>
  </channel>
</rss>

