I'm working on a SAS programming project with a large team. Each team member is responsible for a piece of the overall system, and the "contract" for how it all fits together is The Data. For example, I've got a piece that performs some data manipulation and produces several output data sets, and my colleagues Bryan and Cindy will then pick those up as input into their pieces. In order for this puzzle to fit together cleanly, we need to agree on library names, data set names, and the column names, lengths and formats.
So the team members have been flinging PROC CONTENTS output at each other for several weeks, in an effort to make sure that this jigsaw puzzle comes together as it should. However, I know that the team is using a spreadsheet to keep track of all of these data schemas, and so the PROC CONTENTS exercise turns into an exercise of getting the output listing into Excel.
If all you want is a quick Excel-friendly listing of your data columns and their attributes, that's easy to get from SAS Enterprise Guide. Here's how:
1. Add the data set to your SAS Enterprise Guide project. (You can accomplish this from File->Open->Data, or drag the data set file onto your process flow.)
2. In the data grid view, select the Properties button from the toolbar. The Properties window appears for your data set.
3. Select the Columns tab, then click the Copy to clipboard button.
4. Paste the result into your Excel spreadsheet.
The result: a listing of your data column attributes, with each attribute in its own column. Easy!
7 Comments
I would like to be cut-and-pasted to the Bahamas, please.
:-)
There is a keyboard shortcut for that. Ctrl+$
Pingback: Comparing data set schemas in SAS - The SAS Dummy
Copying SAS attributes to Excel tips is too fast. Thanks.
Pingback: Copy data and column names from SAS Enterprise Guide - The SAS Dummy
Cant we do this by using SAS code?
Srinivas - of course you can. You can use PROC CONTENTS output or query the DICTIONARY tables to come up with similar output that you can export to Excel or copy/paste.