how to transpose without using proc transpose

Reply
New Contributor
Posts: 3

how to transpose without using proc transpose

hi everyone.......

  could u people please tel me how to transpose a data set without using proc transpose

Super Contributor
Posts: 1,636

Re: how to transpose without using proc transpose


using  array

Super User
Posts: 17,749

Re: how to transpose without using proc transpose

Super Contributor
Posts: 644

Re: how to transpose without using proc transpose

It would be helpful to know why you want an alternate to Proc Transpose.  Transpose is the best solution for wide to long or column to row transpositions; it is simple to use and because it is a standard procedure it is well documented and well understood.  Hand coding a transpose is more prone to errors and harder to follow if anyone has to modify your code.

Having said that there are a couple of instances I can think of where a single instance of Proc Transpose will not achieve the result you might want.  An alternate solution will need to be specific to the data and to the desired end result.  Perhaps you can give us a sample of what you want to do.  Otherwise all we can do is offer generic advice to use arrays, the retain statement, and by group processing as in the examples quoted above.

Regular Contributor
Posts: 184

Re: how to transpose without using proc transpose

Transposing Data Using PROC SUMMARY'S IDGROUP Option

http://support.sas.com/resources/papers/proceedings10/102-2010.pdf

RichardinOz wrote:

It would be helpful to know why you want an alternate to Proc Transpose.  Transpose is the best solution for wide to long or column to row transpositions; it is simple to use and because it is a standard procedure it is well documented and well understood.  Hand coding a transpose is more prone to errors and harder to follow if anyone has to modify your code.

Having said that there are a couple of instances I can think of where a single instance of Proc Transpose will not achieve the result you might want.  An alternate solution will need to be specific to the data and to the desired end result.  Perhaps you can give us a sample of what you want to do.  Otherwise all we can do is offer generic advice to use arrays, the retain statement, and by group processing as in the examples quoted above.

Contributor
Posts: 45

Re: how to transpose without using proc transpose

You can also transpose with Hash Objects. Please see the paper below:

http://www.lexjansen.com/pharmasug/2012/PO/PharmaSUG-2012-PO14.pdf

Ask a Question
Discussion stats
  • 5 replies
  • 405 views
  • 0 likes
  • 6 in conversation