DATA Step, Macro, Functions and more

proc transpose stopping auto sorting of var names

Reply
Contributor
Posts: 47

proc transpose stopping auto sorting of var names

Hi All,

This is what I want my table to end up looking like after a proc transpose.

Measure Mar 10 Aug 10
Month 10 11
Annual 12 13

but thanks to the way the proc transpose had been used it ends up like:

Measure Aug 10 Mar 10
Annual 13 12
Month 11 10

It sorts the variable names as well as the measures in alphabetic order Smiley Sad.

Any thoughts?

Thanks,
Sachin
Super Contributor
Super Contributor
Posts: 3,174

Re: proc transpose stopping auto sorting of var names

PROC TRANSPOSE will operate on your data as it is read up. Suggest using PROC SORT to put the data in the desired order before calling PROC TRANSPOSE. Suggest checking the DOC and also the SAS support website for technical references.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

proc transpose data order column site:sas.com
Super User
Posts: 9,681

Re: proc transpose stopping auto sorting of var names

Hi.
Without view all of your code, It is hard to say something.
But I guess you can make an index variable to get the order you need.

Ksharp
Ask a Question
Discussion stats
  • 2 replies
  • 110 views
  • 0 likes
  • 3 in conversation