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

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.

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