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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Submit your idea!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for:
View all other training opportunities.