<?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: dealing with parsed characters in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/464404#M118400</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/179880"&gt;@fg175&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest that you mark &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;'s solution as the accepted solution as it solves your problem. My comment was more on the "why it happened" a possibly a very small amount of comic relief.&lt;/P&gt;</description>
    <pubDate>Wed, 23 May 2018 14:50:09 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-05-23T14:50:09Z</dc:date>
    <item>
      <title>dealing with parsed characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/460435#M117031</link>
      <description>&lt;P&gt;I have a data with issue and issuecode, both containing separators. I want to get a summary data with different issues corresponding to different issuecode, and the frequency of each type of issues (3 variables in the data).&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Ideal output&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;issue issuecode freq&lt;/P&gt;&lt;P&gt;A &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;B &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;C &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&lt;/P&gt;&lt;P&gt;D &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;E &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the following to generate separate variables for each issue, but that did not help me get the ideal output data. Any help is greatly appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My program&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set book1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array code(20) $25;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; array text(20) $25;&lt;BR /&gt;&amp;nbsp;k=countw(issue,'|');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; do _n_=1 to k;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; code(_n_)=strip(scan(scan(issuecode,_n_,'|'),1,'--'));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text(_n_)=strip(scan(scan(issue,_n_,'|'),1,'--'));&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;drop k;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original data&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;id&lt;/TD&gt;&lt;TD&gt;date&lt;/TD&gt;&lt;TD&gt;issue&lt;/TD&gt;&lt;TD&gt;issuecode&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1/1/2001&lt;/TD&gt;&lt;TD&gt;|A|B|C|&lt;/TD&gt;&lt;TD&gt;|1|2|3|&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;10/1/2002&lt;/TD&gt;&lt;TD&gt;|C|D|&lt;/TD&gt;&lt;TD&gt;|3|4|&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;4/2/2009&lt;/TD&gt;&lt;TD&gt;|E|&lt;/TD&gt;&lt;TD&gt;|5|&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 07 May 2018 14:30:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/460435#M117031</guid>
      <dc:creator>fg175</dc:creator>
      <dc:date>2018-05-07T14:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with parsed characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/460460#M117044</link>
      <description>&lt;P&gt;First,&amp;nbsp;you have to appreciate that this is fixable.&amp;nbsp; However, it never should have happened.&amp;nbsp; This is a horrible way to store data, and should never have been done.&amp;nbsp; So the first step is to put the data into its proper form:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; set book1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; length _issuecode _issue $25;&lt;BR /&gt;&amp;nbsp;k=countw(issue,'|');&lt;BR /&gt;&amp;nbsp;&amp;nbsp; do _n_=1 to k;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _issuecode=scan(issuecode, _n_, '|');&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _issue=scan(issue, _n_, '|');&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;drop k issuecode issue;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;WIth the data in proper form, it's easy enough to get your report:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc freq data=want;&lt;/P&gt;
&lt;P&gt;tables _issue * _issuecode / missing list;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, buy a baseball bat.&amp;nbsp; Find the person that constructed that data, and tell them to never do that again.&amp;nbsp; Show them the proper form for storing data.&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 15:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/460460#M117044</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-05-07T15:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with parsed characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/460551#M117071</link>
      <description>&lt;P&gt;Thanks so much! Super Astounding. The output is exactly what I want!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The party providing the data actually sells it at a hefty price to academic users around the world... I would not need the bat, as long as I am lucky enough to find help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 18:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/460551#M117071</guid>
      <dc:creator>fg175</dc:creator>
      <dc:date>2018-05-07T18:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with parsed characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/460595#M117087</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/179880"&gt;@fg175&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Thanks so much! Super Astounding. The output is exactly what I want!!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The party providing the data actually sells it at a hefty price to academic users around the world... I would not need the bat, as long as I am lucky enough to find help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &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;I think that more than one provider of commercially available data makes the "layout" obtuse so you'll cough up more money for them to do the analysis.&lt;/P&gt;</description>
      <pubDate>Mon, 07 May 2018 23:24:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/460595#M117087</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-07T23:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with parsed characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/464404#M118400</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/179880"&gt;@fg175&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest that you mark &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;'s solution as the accepted solution as it solves your problem. My comment was more on the "why it happened" a possibly a very small amount of comic relief.&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 14:50:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/464404#M118400</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-23T14:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: dealing with parsed characters</title>
      <link>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/464429#M118410</link>
      <description>&lt;P&gt;Thanks, just figured it out how to switch choices.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 May 2018 16:58:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/dealing-with-parsed-characters/m-p/464429#M118410</guid>
      <dc:creator>fg175</dc:creator>
      <dc:date>2018-05-23T16:58:17Z</dc:date>
    </item>
  </channel>
</rss>

