I'm sure this should be simple, but it's taking me a while to find it. I want to change a wide data set to a long data set. However, I want the first sets of columns to stay the same. I'm attaching two made up, fictional data sets. Testwide.xlsx is the input data set, that has a wide format, and I want to change it to testlong.xlsx, which would be the output data set, with a long format.
I can find lots of websites on changing wide to long, but only when you pivot or transpose starting at the first variable, and all the other ones transpose. I want the first set of columns to stay the same for each row.
I usually don't include in my posts because they often don't show up the way I have them, but here goes. This is the wide version
I want to change it to this long version
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.