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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register 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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 667 views
  • 0 likes
  • 2 in conversation