As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

An Easier and Faster Way to Untranspose a Wide File

From sasCommunity
Jump to: navigation, search


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

With the decommissioning of, the macro, paper, Powerpoint, and Tip Sheet have been moved to github and can be downloaded by clicking on the following link:

Click here to download the macro, paper, Powerpoint and/or tip sheet

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
10:00am, Tuesday, April 10th, 2018
Meeting Room 502

Revision History

Created: September 25, 2017
Most Recent Version: April 3, 2018

Contact Info User:art297