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!
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).
Thank you! Your response was extremely helpful. Now I can stop trying to make something work using a method that doesn't support it. 🙂
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.
It might help to provide some small example data, hopefully as data step code, and what the result should be.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.