combining Art ant Tom's methods:
data x;
input VAR0 $40.;
cards;
ABC_F_P_LOW
DEF_K__HIGH
ZPQ_M_X_MEDIUM
GKL_J_B
;
data want;
set x;
array v{4} $ ;
do _n_=1 to 4;
v{_n_}=scan(tranwrd(var0,'__','_ _'),_n_,'_');
end;
proc print;run;
obs VAR0 v1 v2 v3 v4
1 ABC_F_P_LOW ABC F P LOW
2 DEF_K__HIGH DEF K HIGH
3 ZPQ_M_X_MEDIUM ZPQ M X MEDIUM
4 GKL_J_B GKL J B
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Latest Updates
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.
Ready to level-up your skills? Choose your own adventure.
Browse our catalog!