<?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: SAS program in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464574#M118458</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/93207"&gt;@cm3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;sorry, did not work&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;"Did not work" is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you did not provide any actual data other than a string that by face value is invalid in SAS, to have imbedded ' as you you use the definition would have to have " " around the entire value, I provided a guess.&lt;/P&gt;</description>
    <pubDate>Wed, 23 May 2018 20:52:24 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-05-23T20:52:24Z</dc:date>
    <item>
      <title>SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464536#M118445</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Pls help with this logic to write in SAS code&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;If response contains &lt;/FONT&gt;&lt;SPAN style="background: white; color: purple; line-height: 107%; font-family: &amp;quot;Courier New&amp;quot;; font-size: 10pt;"&gt;'i1'/'i2'/'i3', &lt;/SPAN&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;Res=A or B or C respectively.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;for ex:&amp;nbsp;&amp;nbsp; response=i1,i2 then Res=AB&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&lt;FONT face="Calibri"&gt;response=i1,i3 then Res=AC&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" face="Calibri" size="3"&gt;&lt;FONT face="Calibri"&gt;Thnks&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 19:19:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464536#M118445</guid>
      <dc:creator>cm3</dc:creator>
      <dc:date>2018-05-23T19:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464544#M118447</link>
      <description>&lt;P&gt;Create a format for the individual conversions, and then loop through the string (1 to countw) and extract the "words" with scan.&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 19:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464544#M118447</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-05-23T19:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464546#M118449</link>
      <description>&lt;P&gt;Without seeing more examples of actual data I would start with something like this:&lt;/P&gt;
&lt;PRE&gt;data want;
   set have;
   length res $ 3;
   if findw(response,'i1',"/'")&amp;gt;0 then res='A';
   if findw(response,'i2',"/'")&amp;gt;0 then res=cats(res,'B'); 
   if findw(response,'i3',"/'")&amp;gt;0 then res=cats(res,'C'); 
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 May 2018 19:34:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464546#M118449</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-23T19:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464556#M118453</link>
      <description>&lt;P&gt;sorry, did not work&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 19:54:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464556#M118453</guid>
      <dc:creator>cm3</dc:creator>
      <dc:date>2018-05-23T19:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464562#M118455</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;'s suggestion didn't include looking for commas, and was case sensitive. Does the following work on your data?:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input response $;
  cards;
I1,I3
I3,I2
i1,i2,i3
I1,I2
I2,I3
;

data want;
  set have;
  length res $3;
  if findw (Response,'I1',"/,",'i') then Res='A';
  if findw (Response,'I2',"/,",'i') then Res=catt(Res,'B');
  if findw (Response,'I3',"/,",'i') then Res=catt(Res,'C');
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 20:10:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464562#M118455</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-05-23T20:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS program</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464574#M118458</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/93207"&gt;@cm3&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;sorry, did not work&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;"Did not work" is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you did not provide any actual data other than a string that by face value is invalid in SAS, to have imbedded ' as you you use the definition would have to have " " around the entire value, I provided a guess.&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 20:52:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-program/m-p/464574#M118458</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-23T20:52:24Z</dc:date>
    </item>
  </channel>
</rss>

