BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
grungoo
Calcite | Level 5

It seems like this should be pretty simple, but I can't find a way to make it work.  I have a table with multiple observations and 20 variables.  I want to pull one observation from that table and put the values into a column.

 

When I try proc transpose it only gives me half the variables, namely those with numerical values.

 

I just need to go from this:

namethisthatotherthose
Bob5male425/31/2016

 

to this:

Bob
5
male
42
5/31/2016

 

Is there any easy way to do this?

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @grungoo,

 

By default, PROC TRANSPOSE transposes only numeric variables, but if you list character variables in the VAR statement, they will be transposed as well. So, the simplest way to transpose all variables is probably to use the statement

var _all_;

in the PROC TRANSPOSE step.

View solution in original post

2 REPLIES 2
FreelanceReinh
Jade | Level 19

Hi @grungoo,

 

By default, PROC TRANSPOSE transposes only numeric variables, but if you list character variables in the VAR statement, they will be transposed as well. So, the simplest way to transpose all variables is probably to use the statement

var _all_;

in the PROC TRANSPOSE step.

grungoo
Calcite | Level 5

I knew it had to be something simple.  Thank you!

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 748 views
  • 0 likes
  • 2 in conversation