BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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!
2 REPLIES 2
deleted_user
Not applicable
Anyone?
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 592 views
  • 0 likes
  • 2 in conversation