<?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: Concatenate characters across rows in Enterprise Guide in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-characters-across-rows-in-Enterprise-Guide/m-p/86233#M8198</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CATX is the right function to use but you do not need to split the tables.&lt;/P&gt;&lt;P&gt;Try this in a code segment (might need tweaking because I can't test it).&lt;/P&gt;&lt;P&gt;Data needs to be pre-sorted by Patient_Id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: #660066;"&gt;Data&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt; Combined_Diagnoses&amp;nbsp; (Drop = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;Diagnoses) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: blue;"&gt;Set&lt;/SPAN&gt; Individual_Diagnoses ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: blue;"&gt;By&lt;/SPAN&gt;&amp;nbsp; Patient_Id ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN style="font-family: 'Lucida Console'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp;&amp;nbsp; Length needs to be 8x max number of diagnoses ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN style="font-family: 'Lucida Console'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp;&amp;nbsp; Or even longer in case of unexpected number ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: blue;"&gt;Length&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;Concatenation_Of_Diagnoses $ 200 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: blue;"&gt;Retain&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;Concatenation_Of_Diagnoses ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN style="font-family: 'Lucida Console'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp;&amp;nbsp; Set initial value per patient to blank ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: blue;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;&amp;nbsp; First.Patient_Id&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: blue;"&gt;Then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt; Concatenation_Of_Diagnoses = &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Calibri; color: #6b006d;"&gt;'&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Calibri; color: #6b006d;"&gt;'&lt;/SPAN&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;&amp;nbsp; Concatenation_Of_Diagnoses = CATX (&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Calibri; color: #6b006d;"&gt;'&lt;/SPAN&gt;; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Calibri; color: #6b006d;"&gt;'&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN style="font-family: 'Lucida Console';"&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;&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; Concatenation_Of_Diagnoses, Diagnoses) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: blue;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;&amp;nbsp; Last.Patient_Id&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: blue;"&gt;Then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt; Output ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: #660066;"&gt;Run&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Oct 2012 03:59:10 GMT</pubDate>
    <dc:creator>RichardinOz</dc:creator>
    <dc:date>2012-10-05T03:59:10Z</dc:date>
    <item>
      <title>Concatenate characters across rows in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-characters-across-rows-in-Enterprise-Guide/m-p/86232#M8197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to concatenate characters from different rows as per example below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Starting table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Patient_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Diagnoses&lt;/P&gt;&lt;P&gt;123456&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 463.0&lt;/P&gt;&lt;P&gt;123456&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 472.9&lt;/P&gt;&lt;P&gt;123456&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; V10.0&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; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Finishing table:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Patient ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Concatenation_Of_Diagnoses&lt;/P&gt;&lt;P&gt;123456&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; 463.0; 472.9; V10.0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have been splitting tables and using CATX, but if there are a lot of different diagnoses, writing the CATX function can take a long time and it doesn't seem to be an efficient process. Is there a better way to do that or a function in EG that allows to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;BR /&gt;Chantal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Oct 2012 20:34:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-characters-across-rows-in-Enterprise-Guide/m-p/86232#M8197</guid>
      <dc:creator>choly1</dc:creator>
      <dc:date>2012-10-04T20:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate characters across rows in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-characters-across-rows-in-Enterprise-Guide/m-p/86233#M8198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CATX is the right function to use but you do not need to split the tables.&lt;/P&gt;&lt;P&gt;Try this in a code segment (might need tweaking because I can't test it).&lt;/P&gt;&lt;P&gt;Data needs to be pre-sorted by Patient_Id.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: #660066;"&gt;Data&lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt; Combined_Diagnoses&amp;nbsp; (Drop = &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;Diagnoses) &lt;/SPAN&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: blue;"&gt;Set&lt;/SPAN&gt; Individual_Diagnoses ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: blue;"&gt;By&lt;/SPAN&gt;&amp;nbsp; Patient_Id ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN style="font-family: 'Lucida Console'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp;&amp;nbsp; Length needs to be 8x max number of diagnoses ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN style="font-family: 'Lucida Console'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp;&amp;nbsp; Or even longer in case of unexpected number ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: blue;"&gt;Length&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;Concatenation_Of_Diagnoses $ 200 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: blue;"&gt;Retain&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;Concatenation_Of_Diagnoses ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN style="font-family: 'Lucida Console'; color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp;&amp;nbsp; Set initial value per patient to blank ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: blue;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;&amp;nbsp; First.Patient_Id&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: blue;"&gt;Then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt; Concatenation_Of_Diagnoses = &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Calibri; color: #6b006d;"&gt;'&lt;/SPAN&gt; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Calibri; color: #6b006d;"&gt;'&lt;/SPAN&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;&amp;nbsp; Concatenation_Of_Diagnoses = CATX (&lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Calibri; color: #6b006d;"&gt;'&lt;/SPAN&gt;; &lt;SPAN lang="EN-US" style="font-size: 10.0pt; font-family: Calibri; color: #6b006d;"&gt;'&lt;/SPAN&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN style="font-family: 'Lucida Console';"&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;&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; Concatenation_Of_Diagnoses, Diagnoses) ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: blue;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt;&amp;nbsp; Last.Patient_Id&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: blue;"&gt;Then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt; Output ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: 6pt; margin-bottom: 6pt;"&gt;&lt;SPAN lang="EN-US" style="font-family: 'Lucida Console'; color: #660066;"&gt;Run&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Lucida Console';"&gt; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2012 03:59:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-characters-across-rows-in-Enterprise-Guide/m-p/86233#M8198</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2012-10-05T03:59:10Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate characters across rows in Enterprise Guide</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-characters-across-rows-in-Enterprise-Guide/m-p/86234#M8199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much, it worked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Oct 2012 17:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Concatenate-characters-across-rows-in-Enterprise-Guide/m-p/86234#M8199</guid>
      <dc:creator>choly1</dc:creator>
      <dc:date>2012-10-08T17:53:19Z</dc:date>
    </item>
  </channel>
</rss>

