BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
pdhokriya
Pyrite | Level 9

Hi Reader,

 

Could you please help me out with below mentioned query.

Here I have attched a output for your reference.

 

data want;
INFILE CARDS MISSOVER ;
input Name $ seq $ TR $ VER $ col1 $ col2 $ col3 $ col4 $ col5 $ col6 $ col7 $ col8 $ col9 $ col10 $ col11$;
cards;
Rohan 10 abc xyz G02CC C01EB D11AH D10AX M02AA R02AX
rohan 20 abc xyz N03AX N07XX
Devid 30 abc xyz
John 40 abc xyz B03AB B03AC V91 B03A V03AE
John 40 abc xyz B03AB B03AC V91 B03A V03AE B03AB B03AC V91 B03A V03AE
;
run;

proc sort data=want ;
by seq tr ver col1-col11;
run;

 

 

Thank you.

Regards

Priya

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20
data have;
INFILE CARDS MISSOVER ;
input Name $ seq $ TR $ VER $ col1 $ col2 $ col3 $ col4 $ col5 $ col6 $ col7 $ col8 $ col9 $ col10 $ col11$;
cards;
Rohan 10 abc xyz G02CC C01EB D11AH D10AX M02AA R02AX 
rohan 20 abc xyz N03AX N07XX 
Devid 30 abc xyz 
John 40 abc xyz B03AB B03AC V91 B03A V03AE
John 40 abc xyz B03AB B03AC V91 B03A V03AE B03AB B03AC V91 B03A V03AE
;
run;

data want;
 set have;
 array t seq tr ver col:;
 do over t;
  if t=' ' then leave;
  q1=vname(t);
  q2=t;
  output;
 end;
 keep name q:;
run;

View solution in original post

1 REPLY 1
novinosrin
Tourmaline | Level 20
data have;
INFILE CARDS MISSOVER ;
input Name $ seq $ TR $ VER $ col1 $ col2 $ col3 $ col4 $ col5 $ col6 $ col7 $ col8 $ col9 $ col10 $ col11$;
cards;
Rohan 10 abc xyz G02CC C01EB D11AH D10AX M02AA R02AX 
rohan 20 abc xyz N03AX N07XX 
Devid 30 abc xyz 
John 40 abc xyz B03AB B03AC V91 B03A V03AE
John 40 abc xyz B03AB B03AC V91 B03A V03AE B03AB B03AC V91 B03A V03AE
;
run;

data want;
 set have;
 array t seq tr ver col:;
 do over t;
  if t=' ' then leave;
  q1=vname(t);
  q2=t;
  output;
 end;
 keep name q:;
run;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 876 views
  • 1 like
  • 2 in conversation