BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Linlin
Lapis Lazuli | Level 10

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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 15 replies
  • 3872 views
  • 7 likes
  • 8 in conversation