Copy SAS variable names to the clipboard in SAS Enterprise Guide

This post was kindly contributed by The SAS Dummy - go there to comment and to read the full post.

I recently met SAS user “CSC” at the Analytics 2015 conference. It might be generous to say that he’s an avid user of SAS Enterprise Guide; it’s probably more accurate to say that he’s now accustomed to the tool and he’s once again productive. But he still misses some features from his PC SAS days, including this one.

He wants to be able to copy just a list of SAS variables names from a SAS data set, so that he can then paste them into a SAS program (or another document). In PC SAS he had a simple GSUBMIT sequence that captured the names and “copied” them to the Windows clipboard with FILENAME CLIPBRD. That does not work in SAS Enterprise Guide, because SAS doesn’t have direct access to the clipboard on your local machine.

CSC posted his question to the SAS Enterprise Guide community, and Tom suggested that a custom task might help. Good answer, but there it sat until CSC and I met in person this week in Las Vegas. After a short discussion and a personal plea, I was able to create the task in about 30 minutes.

copycolsmenu
Actually, it’s three tasks, to cover three variations of the “Paste” operation. One supports a CSV-style, another supports CSV over multiple lines, and a third produces just a straight list on separate lines with no commas.

threecopytasks

You can download and try this custom task too. It works with SAS Enterprise Guide 4.3 and later. Download the task from the SAS support site as a ZIP file. The instructions for installation and use are in the README.txt in the ZIP file.

Related articles

tags: SAS Communities, SAS custom tasks, SAS Enterprise Guide

The post Copy SAS variable names to the clipboard in SAS Enterprise Guide appeared first on The SAS Dummy.

This post was kindly contributed by The SAS Dummy - go there to comment and to read the full post.