BookmarkSubscribeRSS Feed
kbelang1
Fluorite | Level 6

Hello,

 

Do anyone know if first.variable/last.variable can be used to transpose data? For instance, I want to transform a long list of character variables to a single list by a group. Does that make sense and is this possible? Thanks!

 

 

4 REPLIES 4
Astounding
PROC Star

No, they can't be used since they are not saved in the data set.  They are temporary variables only.

 

Choices abound.  The DATA step could copy the first. and last. variables to new variables which could be used later.  Or, PROC TRANSPOSE could use a BY statement (perhaps the same BY statement that appears in the DATA step).

kbelang1
Fluorite | Level 6

Thank you! Your response was extremely helpful. Now I can stop trying to make something work using a method that doesn't support it. 🙂

Astounding
PROC Star

Just a follow-up note .... it depends on how you plan to transpose.  PROC TRANSPOSE is out.  But there are ways to transpose data using a DATA step.  If that's the route you are taking, you can use the BY variables in the same DATA step.

ballardw
Super User

It might help to provide some small example data, hopefully as data step code, and what the result should be.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 4 replies
  • 721 views
  • 1 like
  • 3 in conversation