<?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 Group by, index and concatenate in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Group-by-index-and-concatenate/m-p/168900#M301126</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Need help with doing the following... dont know where to start or how to do it! :smileyconfused:&lt;/P&gt;&lt;P&gt;seems pretty hard to do!&lt;/P&gt;&lt;P&gt;&lt;IMG alt="ts1.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/6783_ts1.png" width="450" /&gt;&lt;IMG alt="ts2.png" class="jive-image-thumbnail jive-image" height="335" src="https://communities.sas.com/legacyfs/online/6784_ts2.png" style="width: 679px; height: 334.97333333333336px;" width="679" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 07 Jul 2014 14:30:20 GMT</pubDate>
    <dc:creator>maryam_h_research</dc:creator>
    <dc:date>2014-07-07T14:30:20Z</dc:date>
    <item>
      <title>Group by, index and concatenate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Group-by-index-and-concatenate/m-p/168900#M301126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Need help with doing the following... dont know where to start or how to do it! :smileyconfused:&lt;/P&gt;&lt;P&gt;seems pretty hard to do!&lt;/P&gt;&lt;P&gt;&lt;IMG alt="ts1.png" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/6783_ts1.png" width="450" /&gt;&lt;IMG alt="ts2.png" class="jive-image-thumbnail jive-image" height="335" src="https://communities.sas.com/legacyfs/online/6784_ts2.png" style="width: 679px; height: 334.97333333333336px;" width="679" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 14:30:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Group-by-index-and-concatenate/m-p/168900#M301126</guid>
      <dc:creator>maryam_h_research</dc:creator>
      <dc:date>2014-07-07T14:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: Group by, index and concatenate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Group-by-index-and-concatenate/m-p/168901#M301127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain artname2 artedit_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr(art_name,1,1) ne "2" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; artname2=art_name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; artedit_id=art_name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 15:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Group-by-index-and-concatenate/m-p/168901#M301127</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-07T15:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Group by, index and concatenate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Group-by-index-and-concatenate/m-p/168902#M301128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;They there RW9,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this was very helpful, and much easier than I thought.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just 2 questions;&lt;/P&gt;&lt;P&gt;1. can you explain to me : &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt; if substr(art_name,1,1) ne "2" then do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;2. in &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;artedit_id=art_name;&lt;/SPAN&gt; how does one concatenate 2 different data types - a character and number, does a copy of version need to be created as a character and then concatenated with art_name_2?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanking you &amp;amp; regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 16:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Group-by-index-and-concatenate/m-p/168902#M301128</guid>
      <dc:creator>maryam_h_research</dc:creator>
      <dc:date>2014-07-07T16:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Group by, index and concatenate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Group-by-index-and-concatenate/m-p/168903#M301129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello RW9,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;following on from my post below.&lt;/P&gt;&lt;P&gt;i got this done.&lt;/P&gt;&lt;P&gt;i did it over a number of data steps, but its okay i guess, it got the job done &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sample_wiki7;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain artname2 artedit_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr(art_name,1,1) ne "2" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; artname2=art_name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test2;&lt;/P&gt;&lt;P&gt;set test;&lt;/P&gt;&lt;P&gt;&amp;nbsp; version2 = put(version, 3.) ; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data test3;&lt;/P&gt;&lt;P&gt;set test2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ID = catx('', artname2,version2) ; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 16:18:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Group-by-index-and-concatenate/m-p/168903#M301129</guid>
      <dc:creator>maryam_h_research</dc:creator>
      <dc:date>2014-07-07T16:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Group by, index and concatenate</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Group-by-index-and-concatenate/m-p/168904#M301130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For your questions:&lt;/P&gt;&lt;P&gt;1)&amp;nbsp; It basically means if the first character of art_name is a 2, so it s not one we hold over the next rows, then retain that value.&lt;/P&gt;&lt;P&gt;2)&amp;nbsp; To concatenate different types, there is several options.&amp;nbsp; The main one would be put (and input) which convert data.&amp;nbsp; So string || put(number,best.)&amp;nbsp; will transform the number into a string defined by the format - best. in this case) - and then concatenate that string to the other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Glad you got your job done, you can wrap up the code lines as:&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sample_wiki7;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; retain artname2 artedit_id;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if substr(art_name,1,1) ne "2" then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; artname2=art_name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; version2 = put(version, 3.) ; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ID = catx('', artname2,version2) ; &lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Jul 2014 16:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Group-by-index-and-concatenate/m-p/168904#M301130</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-07-07T16:24:12Z</dc:date>
    </item>
  </channel>
</rss>

