BookmarkSubscribeRSS Feed
LeeJ
Calcite | Level 5

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);

1 REPLY 1
LeeJ
Calcite | Level 5

I just found this topic.

http://communities.sas.com/thread/13649

I will give this a go first.

Lee

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