Help using Base SAS procedures

logic help!

Reply
N/A
Posts: 0

logic help!

Now here is how my data looks like.
STORY_OUT
CUST_ID CUST_TYP MSG_ID MSG_TX
123 EVT 234 THIS EVT IS CASE FOR


This will find 2 matches in CSA table as below:
CSA
CUST_ID CUST_TYP FIELD_NM FIELD_TX
123 EVT PARTY NAME JOHN SMITH, ADAM SMITH & BBC COMPANY
123 EVT REASON_CD CASH DEPOSIT

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.

TMP table
Cust_id cust_typ cust_no field_nm Field_txt msg_id Msg_txt
123 EVT 3 REASON_CD CASH DEPOSIT 234 THIS EVT IS CASE FOR
123 EVT 3 PARTY NAME JOHN SMITH, ADAM SMITH 234 THIS EVT IS CASE FOR


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.
data MYDATA.epc_story_tmp;
set mydata.epc_story_tmp;
put msg_txt;
msg_txt =tranwrd(msg_txt,trim(field_nm),trim(field_tx));
put msg_txt;
msg_txt = compress(msg_txt,'()');
put _all_;
PUT '****';
run;

Can anyone help please?

Thank!
Thanks!
N/A
Posts: 0

Re: logic help!

Anyone?
Super Contributor
Super Contributor
Posts: 3,174

Re: logic help!

You have an active forum thread on this topic/question already started at the link below...

http://support.sas.com/forums/thread.jspa?threadID=10400
Ask a Question
Discussion stats
  • 2 replies
  • 110 views
  • 0 likes
  • 2 in conversation