Have -
data d1;
input id var1 var2 var3;
datalines;
1 101 102 103
;
run;
Want -
And in case var1,var2,var3 is null, then want dataset should not contain an entry for it. For example - If var3 is null then want dataset -
Thanks in advance for any kind of help 🙂
You can use the following PROC TRANSPOSE to do this:
data have; input id var1 var2 var3; cards; 1 101 102 . ; run; proc transpose data=have out=want(drop=_name_ where=(col1 ne .)); by id; var var1 var2 var3; run; proc print data=want; run;
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
Submit your proposal →
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.
Browse our catalog!