How to get your SAS data set attributes into Excel

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!

tags: SAS Enterprise Guide, SAS tips


  1. Posted August 14, 2012 at 2:39 pm | Permalink

    I would like to be cut-and-pasted to the Bahamas, please.


    • Chris Hemedinger Chris Hemedinger
      Posted August 14, 2012 at 2:41 pm | Permalink

      There is a keyboard shortcut for that. Ctrl+$

  2. Rahul Gupta
    Posted January 31, 2013 at 4:47 am | Permalink

    Copying SAS attributes to Excel tips is too fast. Thanks.

  3. srinivas
    Posted November 5, 2015 at 12:16 am | Permalink

    Cant we do this by using SAS code?

    • Chris Hemedinger Chris Hemedinger
      Posted November 5, 2015 at 9:14 am | Permalink

      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.

2 Trackbacks

  1. By Comparing data set schemas in SAS - The SAS Dummy on August 15, 2012 at 10:04 am

    [...] post has moved! SAS Blogs Home > The SAS Dummy > Comparing data set schemas in SAS « How to get your SAS data set attributes into Excel Comparing data set schemas in SAS Chris Hemedinger|August 15, 2012 [...]

  2. […] Excel spreadsheet or other table structure (like a Google Docs spreadsheet). Note: this is different than the "copy data attributes" tip that I published a while back. That tip captures the column properties, but not the actual data […]

Post a Comment

Your email is never published nor shared. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>