11-28-2017 02:51 AM - edited 11-28-2017 03:01 AM
Use the following functions - COUNTC, SUM, SCAN
data sample; a="'abc','def','xyz'"; count_commas=countc(a); if count_commas>1 then do; count_commas=count_commas+1; do i=1 to count_commas; var=scan(a,",",i); output; end; end;
if count_commas=0 or count_commas=. then var=a; run;
11-28-2017 04:03 AM
What do you mean by "I need to get..."? This is where posting test data as a datastep and what you want out is so important. We are now all guessing what you want to do! From what you post, it seems that you want to replace , with " ", which would be:
Posting clear concise questions will get you clear concise answers.