BookmarkSubscribeRSS Feed
deleted_user
Not applicable
My data set Names have only one variable, Person, like this:

Person
********
Adam
Eve
Ask
Embla

With the code:

proc transpose data=names out=names prefix=Name;
var person;
run;


I get:

_NAME_ _LABEL_ Name1 Name2 Name 3 Name4
person personlabel Adam Eve Ask Embla

In a data statement I can drop _NAME_ and _LABEL_, so I get what I want:

Name1 Name2 Name3 Name4
Adam Eve Ask Embla

Could that have been done directly in proc transpose?
1 REPLY 1
DanielSantos
Barite | Level 11
Yes.

You should specify the drop statement at the output table, like this:

[pre]proc transpose data=names out=names (drop = _:) prefix=Name;
var person;
run;[/pre]

drop = _: is actually a wildcard (_*) , it works like drop any variable that stars with _

Cheers from portugal.

Daniel Santos @ www.cgd.pt

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 1025 views
  • 0 likes
  • 2 in conversation