BookmarkSubscribeRSS Feed
neha_sas
Calcite | Level 5

1)Is there a way  that I could directly create Pivot table from sas instead of creating a HTML file with a " Create Pivottable " button on it.

The reason i ask is that I need to export the SAS data into a Pivot in Unix and upload it at a certain location.

Also, the data I am dealing with is huge and opening a HTML file is taking a lot of time , let alone the time it takes to create the Pivot Table

2)Second question: Is there any option that can be used to just retain the excel tab with Pivot table and delete the rest of the sheets ( including data sheet).

Thanks

1 REPLY 1
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

As far as I am aware there is no "pivot table" file format, but it is normally part of an Excel file.  With this in mind, I don't see any way to directly create this from SAS using tagsets etc. so you would need to investigate the Open XML document format used by latest incarnations of Excel, Overview of the XML file formats in Office 2010

You can pretty much build any type of Excel file directly as text files and zip them up.  Its really not straightforward though, took a fair time to get just a few values into a new file doing it this way when I tried as there are several files/folder with the xlsx (which is a zip - rename the extension .zip and you can open it).

One way could be to create the pivot table as you would in Excel.  Then rename the to zip and open and see what xml files are generated.  From there work back to your SAS program.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1200 views
  • 0 likes
  • 2 in conversation