The SAS Output Delivery System and reporting techniques

ODS Pivot Table using Java Script

Reply
Super Contributor
Posts: 336

ODS Pivot Table using Java Script

Hello,

 

I am looking for a way to create an excel pivot table (which seem to work), saving and closing it automatically (which does not work) preferably under a different name using a java script.

 

Data A;
  Length A B $200.;
  Do i=1 To 0.5e3; * 500 rows;
    A=Byte(Int(Ranuni(1)*4)+65);
	B=Byte(Int(Ranuni(1)*4)+65);
	Output;
  End;
Run;

ODS Excel File="D:\XXX\Test.csv" Options(Sheet_Name="Sheet_x");
Proc Print Data=A;
Run;
ODS Excel Close;

*ODS Noxsync Noxwait;
ODS Tagsets.TableEditor File="D:\XXX\JTest.js"
Options (Output_Type="script"
         Update_Target="D:\\XXX\\Test.csv"
		 Sheet_Name="Sheet_x"
         Pivotrow='A,B'
         Pivotdata='i'
		 /*Excel_Save_File="D:\XXX\Test.xlsx"
         Quit='YES'*/);

Data _NULL_;
  File Print;
  Put "Test";
Run;
ODS Tagsets.TableEditor Close;

x "D:\XXX\JTest.js";

My question is how to save and close, and is there a reason that this method can handle larger datasets in comparison to the "classic" tableeditor-pivot-creation using a HTML-file?

 

 

Thanks&kind regards

Ask a Question
Discussion stats
  • 0 replies
  • 315 views
  • 0 likes
  • 1 in conversation