DATA Step, Macro, Functions and more

Transpose a dataset and retaining a column without transpose

Accepted Solution Solved
Reply
Contributor
Posts: 55
Accepted Solution

Transpose a dataset and retaining a column without transpose

I need a help in transposing a dataset without transposing a column in the data . Transpose the label names instead of column names in the dataset since column names are truncated due to length restriction in SAS. 

 

I have tried transpose dataset with copy and by commands but I am not able to retrieve the exacts results. I have upload a document to have a view of Current and expected dataset.

 


Accepted Solutions
Solution
‎09-08-2016 12:05 PM
Super User
Posts: 17,868

Re: Transpose a dataset and retaining a column without transpose

Easier with a data step. Set up two arrays, one for character values and one for numeric and follow the methods illustrated in the link below. 

 

http://www.ats.ucla.edu/stat/sas/modules/widetolong_data.htm

View solution in original post


All Replies
Solution
‎09-08-2016 12:05 PM
Super User
Posts: 17,868

Re: Transpose a dataset and retaining a column without transpose

Easier with a data step. Set up two arrays, one for character values and one for numeric and follow the methods illustrated in the link below. 

 

http://www.ats.ucla.edu/stat/sas/modules/widetolong_data.htm

Contributor
Posts: 55

Re: Transpose a dataset and retaining a column without transpose

Thank you so much again for showing me a different direction to proceed futher
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 307 views
  • 0 likes
  • 2 in conversation