Difference between revisions of "An Easier and Faster Way to Untranspose a Wide File"

From sasCommunity
Jump to: navigation, search
(Powerpoint Presentation: Fixed link)
(Revision History)
Line 27: Line 27:
== Revision History ==
== Revision History ==
Created: September 25, 2017 <BR>
Created: September 25, 2017 <BR>
Most Recent Version: October 16, 2017 <BR>
Most Recent Version: November 30, 2017 <BR>
==Contact Info==
==Contact Info==

Revision as of 12:50, 30 November 2017


PROC TRANSPOSE is an extremely powerful tool for making long files wide, and wide files less wide or long, but getting it to do what you need often involves a lot of time, effort, and a substantial knowledge of SAS® functions and data step processing. This is especially true when you have to untranspose a wide file that contains both character and numeric variables. And, while the procedure usually seamlessly handles variable types, lengths and formats, it doesn’t always do that and only creates a system variable (i.e., _label_) to capture variable labels. The present paper introduces a macro that simplifies the process, significantly reduces the amount of coding and programming skills needed (thus reducing the likelihood of producing the wrong result), runs up to 50 or more times faster than the multiple PROC TRANSPOSE and data steps that would otherwise be needed, and either creates untransposed variables that inherit all of the original variables’ characteristics or creates a file that contains all of the relevant metadata.

Online Materials

Click here to view the paper

Click here to download the SAS code described in this paper

Powerpoint Presentation

The presentation is shown in the box, below, but the behavior is different for different browsers. With Chrome, the pdf menu will appear if you move your pointer to the lower part of the box. Click on the menu's far left item, then you can PgDn through the presentation. Also, with Chrome's menu, one of the icons will let you save the file so that you can open it, directly, using the free Adobe Reader. With Explorer the menu appears if you move your pointer toward the upper part of the box, but is only needed if you want to save the pdf. With Firefox, clicking the >> symbol at the upper-righthand corner of the box lets you save the file.


SAS Global Forum 2018

Revision History

Created: September 25, 2017
Most Recent Version: November 30, 2017

Contact Info

art@analystfinder.com User:art297