Hello
The data set contain 3 variables: Customer ID, transfer description, amount.
transfer description is a char variable.
Each customer ID can have multiple rows.
I want to do the following :
Find the frequency distribution of separate words from field "transfer description"
data have;
informat transfer_description $5000.;
input ID transfer_description amount;
infile datalines delimiter='|';
datalines;
111|Transfer to my friend Joe Kaplan|1000
111|Salary IBM|2000
111|Salary WIZZ|3980
111|Transfer to my father|500
333|Transfer to my gf|4000
333|Son help|3000
222|Salary IBM|1500
222|Charity|2500
222|Charity|3000
222|transfer to my friend Jula|8000
;
Run;
Seems to be dealing with the same problem as https://communities.sas.com/t5/SAS-Programming/split-char-into-multiple-columns-and-then-append-the-...
Do you want the frequencies by id?
data long;
set have;
length desc $20; /* set sufficient length as needed */
do i = 1 to countw(transfer_description," ");
desc = scan(transfer_description,i," ");
output;
end;
keep desc;
run;
proc freq data=long;
tables desc;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.