<?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: logic help! in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/logic-help/m-p/49716#M13498</link>
    <description>Anyone?</description>
    <pubDate>Thu, 15 Jul 2010 13:10:48 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-07-15T13:10:48Z</dc:date>
    <item>
      <title>logic help!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/logic-help/m-p/49715#M13497</link>
      <description>Now here is how my data looks like.&lt;BR /&gt;
STORY_OUT&lt;BR /&gt;
CUST_ID CUST_TYP MSG_ID MSG_TX &lt;BR /&gt;
123 EVT 234 THIS EVT IS &lt;REASON_CD&gt;&lt;/REASON_CD&gt; CASE FOR &lt;PARTY&gt;&lt;/PARTY&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
This will find 2 matches in CSA table as below: &lt;BR /&gt;
CSA&lt;BR /&gt;
CUST_ID CUST_TYP FIELD_NM FIELD_TX&lt;BR /&gt;
123 EVT PARTY NAME JOHN SMITH, ADAM SMITH &amp;amp; BBC COMPANY&lt;BR /&gt;
123 EVT REASON_CD CASH DEPOSIT&lt;BR /&gt;
&lt;BR /&gt;
I did a left join on the CSA and teh story table which gives me a temp table.This temp table which replicates the story table and an additionals - FIELD_NM, field_txt from the CSA table. This will basically help in using TRANWRD funtion given below.&lt;BR /&gt;
 &lt;BR /&gt;
TMP table &lt;BR /&gt;
Cust_id cust_typ cust_no field_nm          Field_txt              msg_id           Msg_txt&lt;BR /&gt;
123       EVT	3    REASON_CD   CASH DEPOSIT  234	            THIS EVT IS &lt;REASON_CD&gt;&lt;/REASON_CD&gt; CASE FOR &lt;PARTY name=""&gt;&lt;/PARTY&gt;&lt;BR /&gt;
123       EVT	3    PARTY NAME  JOHN SMITH, ADAM SMITH 234 THIS EVT IS &lt;REASON_CD&gt;&lt;/REASON_CD&gt; CASE FOR &lt;PARTY name=""&gt;&lt;/PARTY&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
I am using the tranwrd function but it updates only one field at a time. But I want the result to be  - 'This evt is cash deposit case for john smith,adam smith'.  I want to merge the results into one if cust_id,cust_typ and cust_no fields are same.&lt;BR /&gt;
data MYDATA.epc_story_tmp;&lt;BR /&gt;
set mydata.epc_story_tmp;&lt;BR /&gt;
put msg_txt;&lt;BR /&gt;
msg_txt =tranwrd(msg_txt,trim(field_nm),trim(field_tx));&lt;BR /&gt;
put msg_txt;&lt;BR /&gt;
msg_txt = compress(msg_txt,'()');&lt;BR /&gt;
put _all_;&lt;BR /&gt;
PUT '****';&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Can anyone help please?&lt;BR /&gt;
&lt;BR /&gt;
Thank!&lt;BR /&gt;
Thanks!</description>
      <pubDate>Wed, 14 Jul 2010 20:31:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/logic-help/m-p/49715#M13497</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-14T20:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: logic help!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/logic-help/m-p/49716#M13498</link>
      <description>Anyone?</description>
      <pubDate>Thu, 15 Jul 2010 13:10:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/logic-help/m-p/49716#M13498</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-15T13:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: logic help!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/logic-help/m-p/49717#M13499</link>
      <description>You have an active forum thread on this topic/question already started at the link below...&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?threadID=10400" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?threadID=10400&lt;/A&gt;</description>
      <pubDate>Thu, 15 Jul 2010 13:57:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/logic-help/m-p/49717#M13499</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-15T13:57:32Z</dc:date>
    </item>
  </channel>
</rss>

