DATA Step, Macro, Functions and more

Updated Transpose Macro

Posts: 7,363

Updated Transpose Macro

I mentioned this in a post to a different forum, but thought you might want to know about it. At last year's SGF and MWSUG meetings I presented a transpose macro that I wrote together with and one other author.

The macro enables faster and less complicated transpositions when one needs to make tall files wide and wide files even wider.

Each time the paper has been presented we've expanded the macro to accomplish additional tasks. Two capabilities have been added since the macro was last presented, namely parameters that allow one to specify that ID values should be output in descending order (descendingid), and preloadfmt (which lets you specify the precise desired orderings of ID values).

The macro's parameters are virtually identical to those of PROC TRANSPOSE, but the macro (besides requiring much less code) runs up to 50 times faster than PROC TRANSPOSE, and is more capable of obtaining desired output files.

You can download the free macro, and paper, at:

Note: if you've downloaded earlier versions of the macro, you may have to refresh your browser page after clicking on the download paper and/or code links.


Ask a Question
Discussion stats
  • 0 replies
  • 1 like
  • 1 in conversation