BookmarkSubscribeRSS Feed

How to untranspose a wide file

Started ‎01-05-2018 by
Modified ‎05-11-2018 by
Views 5,716

You may or may not have seen the post this past August (https://communities.sas.com/t5/SAS-Procedures/Reverse-Transpose/m-p/392011 ) that asked how one can transpose a wide file back to the form it existed before it was transposed. That post motivated me to put together a team to come up with a better solution than any that have already been made public. I immediately thought of @FriedEgg and @snoopy369 to help me co-author a novel approach and, when @Rick_SAS mentioned @Gerhard_SAS's macro, I knew that with him I had the perfect team to address the question.

 

The four of us have created the macro I had envisioned, and the paper has been accepted for presentation at this year's (2018) SGF. The unpaid team is currently testing the code but, of course, we might be too close to the code to see any problems or oversights we hadn't considered.

 

That's where you (anyone and everyone in the Communities who might be interested) can help.

 

I've attached the current macro, and draft paper and materials. If you have any wide files, and don't mind spending a few minutes to untranspose them, we'd love to hear from you. You can reach me, directly, at art@analystfinder.com.

 

Of course, we'll post updates if either the paper or macro change prior to the paper's publication.

 

Download the paper and tip sheet here

 

You can also download the macro from the link at the bottom of this page.

 

Art, CEO, AnalystFinder.com

 

Comments

Hi Art. I'm sure your macro is fabulous. I encourage you to think about whether 'untranspose' is the best name. Many wide data sets did not start off as long data, so there is no initial transpose that you are "undoing." Furthermore, if a data set started out in long form, you do not know the details by which it was converted to wide form. You are basing your analysis on prefixes, IDs, suffixes, etc. I have not studied your code, but I guess that the code treats those quantities as coming from a single variable, which might not have been the case. Thirdly, if you want to attract traffic from internet searches, I suspect you could choose a more SEO-friendly name.

 

A name like 'SuperWideToLong' or 'FlexibleWideToLong' might be more accurate and better communicate the purpose of the macro.

Rick, Thanks for your comments and, yes, we may well change the name to something more SEO friendly. As for the code, the macro uses prefixes/suffixes etc to identify variable names and ID values. The combination of task, and wide-file variable metadata, determine the variable characteristics applied to the new (i.e., long or less wide) datasets that the macro creates.

 

Version history
Last update:
‎05-11-2018 10:17 AM
Updated by:
Contributors

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags