12-06-2019
dscamelo
Obsidian | Level 7
Member since
12-12-2017
- 14 Posts
- 13 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by dscamelo
Subject Views Posted 4013 12-06-2019 11:32 AM 776 02-14-2019 06:47 AM 5150 02-14-2019 06:18 AM 5157 02-14-2019 06:01 AM 5228 02-13-2019 02:57 PM 5279 02-13-2019 01:37 PM 3655 01-30-2018 04:25 AM 3733 01-29-2018 01:08 PM 5729 12-15-2017 10:25 AM 5739 12-15-2017 10:09 AM -
Activity Feed for dscamelo
- Posted Multiple reports into email HTML body. on ODS and Base Reporting. 12-06-2019 11:32 AM
- Liked Re: Custom Date Format for Reeza. 02-14-2019 06:48 AM
- Liked Re: Custom Date Format for ballardw. 02-14-2019 06:48 AM
- Posted Re: Custom Date Format on SAS Programming. 02-14-2019 06:47 AM
- Liked Re: Custom Date Format for ChrisNZ. 02-14-2019 06:19 AM
- Liked Re: Custom Date Format for ChrisNZ. 02-14-2019 06:19 AM
- Posted Re: Custom Date Format on SAS Programming. 02-14-2019 06:18 AM
- Liked Re: Custom Date Format for novinosrin. 02-14-2019 06:18 AM
- Liked Re: Custom Date Format for Tom. 02-14-2019 06:04 AM
- Posted Re: Custom Date Format on SAS Programming. 02-14-2019 06:01 AM
- Liked Re: Custom Date Format for novinosrin. 02-13-2019 02:58 PM
- Posted Re: Custom Date Format on SAS Programming. 02-13-2019 02:57 PM
- Liked Re: Custom Date Format for novinosrin. 02-13-2019 02:36 PM
- Posted Custom Date Format on SAS Programming. 02-13-2019 01:37 PM
- Posted Re: Connecting to Two Remote Servers on SAS Enterprise Guide. 01-30-2018 04:25 AM
- Liked Re: Connecting to Two Remote Servers for nhvdwalt. 01-30-2018 04:23 AM
- Liked Re: Connecting to Two Remote Servers for SASKiwi. 01-29-2018 03:46 PM
- Posted Connecting to Two Remote Servers on SAS Enterprise Guide. 01-29-2018 01:08 PM
- Posted Re: How to define optional parameters in a function? on SAS Procedures. 12-15-2017 10:25 AM
- Posted Re: How to define optional parameters in a function? on SAS Procedures. 12-15-2017 10:09 AM
-
Posts I Liked
Subject Likes Author Latest Post 2 1 2 3 1
12-06-2019
12:28 PM
Hi:
Your Style of EGDEFAULT, inherits this CSS "page break" between procedures from the DEFAULT style template used for HTML. The DEFAULT style template has this HTML style element or class:
Note that the page-break-after: always is a CSS style command that is being added to the <p> tag that will be inserted between procedures.
One way around this is to create all your reports in one RTF or PDF file (or even an HTML file, but some mail systems don't like to accept HTML files as attachments) and then write your message in a DATA step, but attach the reports as a separate attachment without writing them to HTML message body directly. That method is shown in this paper http://support.sas.com/resources/papers/proceedings11/300-2011.pdf on page 7:
The other option is to try OTHER styles (not EGDEFAULT) that don't inherit from STYLES.DEFAULT and see whether they work better for you. Some styles to try are NORMAL or MEADOW. They only use a standard <br/> between procedures as the "page-break".
The final and probably most difficult option is to create your own style template and modify the html section to avoid using page-break-after: always.
Hope this helps,
cynthia
... View more
02-14-2019
06:47 AM
That worked! Thank you, @ChrisNZ ! And thanks again to everyone who tried to help, especially @novinosrin!
... View more
01-30-2018
02:05 PM
Like @nhvdwalt, I'm a big fan of SAS/CONNECT. We use it ourselves for SAS VA load jobs which we run from our main SAS environment, to remotely load on VA - really powerful and flexible. Of course there is a cost involved but you can weigh that up by comparing it to the benefits.
... View more
12-15-2017
11:23 AM
@dscamelo wrote:
Thanks a lot, @ballardw. However, this still has one slight problem with my intended use. With it, I have to run a subquery everytime I need to use the variable. Since the table I am going to be using is fairly large, making several subqueries would be time costly.
I would need a way to store it into a variable, such as:
%let largest = %maxmin(sashelp.class, age);
then, I could run the query just once and use the &largest. wherever I needed it.
SAS is not a "functional" language and you are just going to drive yourself nuts trying to treat it as one. To me it sounds like you want a way to store a value into a macro variable. So instead of trying to shoehorn something into looking like a function just add a parameter to your macro for the name of the macro variable you want to create. So let's make a general purpose macro that can call any SQL summary function and return the result to a macro variable.
%macro sql_summary
/*-----------------------------------------------------------------------------
Generate summary statistic using PROC SQL.
-----------------------------------------------------------------------------*/
(varname /* Input variable name */
,dsname /* Input dataset name (def=&syslast) */
,stat /* Sql summary function name (def=MAX) */
,mvar /* Output macro variable name (def=sql_summary) */
,format /* Optional format to use when generating macro variable */
);
%if ^%length(&varname) %then %put ERROR: &sysmacroname requires a variable name. ;
%else %do;
%if ^%length(&dsname) %then %let dsname=&syslast;
%if ^%length(&stat) %then %let stat=max ;
%if ^%length(&mvar) %then %let mvar=sql_summary;
%if ^%symexist(&mvar) %then %global &mvar ;
%if %length(&format) %then %let format=format=&format ;
proc sql noprint ;
select &stat(&varname) &format
into :&mvar trimmed
from &dsname
;
quit;
%end;
%mend sql_summary ;
Let's try some examples.
747 %sql_summary(age,sashelp.class,mvar=largest);
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
748 %put &=largest ;
LARGEST=16
749 %sql_summary(age,sashelp.class,stat=mean,mvar=average);
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
750 %put &=average ;
AVERAGE=13.31579
751 %sql_summary(weight*height,sashelp.class,stat=sum,mvar=total,format=comma12.);
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
752 %put &=total ;
TOTAL=120,316
753 %sql_summary;
ERROR: SQL_SUMMARY requires a variable name.
... View more
12-14-2017
01:03 PM
1 Like
That use is just a subquery
proc sql;
create table example as
select name, sex, age
from sashelp.class
where age= (select max(age) from sashelp.class)
;
quit;
as long as that select returns a single value no problems.
... View more