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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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