Hi, could someone help me please. In summary I need to do the following and I have used the sashelp.Class dataset to provide my code.
1. I need to have sub totals but on the final output I need to keep the sub totals and make the contributing numeric data zero.
2. I need to format and output to the Web (IE) via SASWep Stored Process and write it to an Excel spreadsheet.
I get to point 1 ok but I when I try point 2 I get the following error
NOTE: Writing HTML Body file: c:\temp\test.xls
ERROR: A component of C:\DOCUME~1\sassrv\LOCALS~1\Temp\SAS Temporary Files\_TD6488\Prc17\1b2cd535-9fc1-4fef-acea-880f6e15e4fa\c:\temp
\test.xls is not a directory.
WARNING: No body file. HTML output will not be created.
I cannot remove the c:\temp from the destination because I need to specify the destination path in a variable.
My code is below but will be delivered via a SAS Web App not EG. :-
* Begin EG generated code (do not edit this line);
*
* Stored process registered by
* Enterprise Guide Stored Process Manager v4.1
*
*
====================================================================
* Stored process name: Test
*
====================================================================
*;
*ProcessBody;
%STPBEGIN;
* End EG generated code (do not edit this line);
* Forum Code ;
data sasclass_out;
set sashelp.class;
where age = 14 or age = 15;
if age = 14 then flag=1;
if age = 15 then flag=2;
run;
proc report data=sasclass_out out=sasclass_out2 nowindows;
columns name sex age height flag weight weight=w;
define flag / order noprint;
define Name / display "Name";
define Sex / display "Sex";
define Age/ display "Age";
define Height / display "Height";
define Weight / analysis "Weight";
define w / sum noprint;
compute after flag;
Name='Total: ';
weight.sum=w;
endcomp;
break after flag / summarize;
run;
data sasclass_out3;
set sasclass_out2;
if age = 14 or age =15 then weight=0;
run;
ods html file="c:\temp\test.xls";
proc report data= sasclass_out3 nowindows;
columns name sex age height weight ;
define Name / display "Name";
define Sex / display "Sex";
define Age/ display "Age";
define Height / display "Height";
define Weight / analysis "Weight";
compute age;
if age = 14 then
call define(_ROW_ , "style","style=[background=light brown]");
if age = 15 then
call define(_ROW_ , "style","style=[background=light yellow]");
endcomp;
run;
ods html close;
* Begin EG generated code (do not edit this line);
*';*";*/;run;
%STPEND;
* End EG generated code (do not edit this line);
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.