BookmarkSubscribeRSS Feed
chandru1dev
Fluorite | Level 6

Hi,

 

I am using the below script for creating the excel pivot table. Can you please help for the below 2 issues

 

1) I am able to create the excel with the pivot, but I could not save the excel automatically. The excel opens and promts me to save.

    Error: Unable to set the Orientation property of the PivotField class

    Also I tried using excel_save_file option, before trying update_target

2) I need to suppress the sub totals and I want only the grand total


/* Create file to update */
ods tagsets.Excelxp file="c:\temp.xls" options(sheet_name="temp") ;
proc print data=fin_all;
run;
ods tagsets.Excelxp close;

/* update the file with a simple pivot table by creating a javascript file that we execute */
options xnowait noxsync;
ods noresults;
ods tagsets.tableeditor file="C:\temp.js"
options(output_type="script"
update_target="c:\\temp.xls"
sheet_name = "temp"

pivotrow="Name, ID, TGT_NOS"
PIVOTDATA_TOCOLUMNS="YES"
pivotpage="AREA, LOC_CD, LOCATIONNAME, product, ACTIVITY_DATE");
data _null_;
file print;
put "test";
run;
ods tagsets.tableeditor close;
/* execute Script file */
x "C:\temp.js";

 

1 REPLY 1
chandru1dev
Fluorite | Level 6

Hi

 

I resolved the orientation error

 

Can anybody share your idea for resolving

1. To save the excel ouput file automatically?

2. To eliminate the sub totals

 

Thanks

Chandramohan

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
  • 1025 views
  • 0 likes
  • 1 in conversation