02.05.2013 Views

SAS(R) 9.1.3 Companion for z/OS

SAS(R) 9.1.3 Companion for z/OS

SAS(R) 9.1.3 Companion for z/OS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

142 Sending Procedure Output as E-Mail Chapter 6<br />

data _null_;<br />

file email;<br />

put ’Here is the latest Shoe sales report’;<br />

run;<br />

The following example shows how to create ODS HTML and GIF files and send them<br />

as e-mail attachments:<br />

/* ------------------------------------------------ */<br />

/* Define the UNIX System Services HFS directory to */<br />

/* contain the graphics and HTML output. */<br />

/* ------------------------------------------------ */<br />

filename odsout ’/u/myhome/public_html’;<br />

/* ------------------------------------------------ */<br />

/* stops sending output to GRAPH and OUTPUT windows */<br />

/* ------------------------------------------------ */<br />

ods listing close;<br />

/* ---------------------------- */<br />

/* set the graphics environment */<br />

/* ---------------------------- */<br />

goptions reset=global gunit=pct<br />

colors=(black blue green red)<br />

hsize=8.42 in vsize=6.31 in ftitle=zapfb<br />

ftext=swiss htitle=4 htext=2.5<br />

device=gif transparency noborder;<br />

/* --------------------------------- */<br />

/* add the HTML variable to NEWSHOES */<br />

/* --------------------------------- */<br />

data newshoes;<br />

set sashelp.shoes;<br />

where Region in (’Canada’ ’Central America/Caribbean’<br />

’South America’ ’United States’);<br />

length regdrill $40;<br />

if Region=’Canada’ then<br />

regdrill=’HREF="shoes1_regsales.html#IDX1"’;<br />

else if Region=’Central America/Caribbean’ then<br />

regdrill=’HREF="shoes1_regsales.html#IDX2"’;<br />

else if Region=’South America’ then<br />

regdrill=’HREF="shoes1_regsales.html#IDX3"’;<br />

else if Region=’United States’ then<br />

regdrill=’HREF="shoes1_regsales.html#IDX4"’;<br />

run;<br />

/* ------------------------------------------------------*/<br />

/* Assign the destination <strong>for</strong> the ODS graphics output */<br />

/* and ODS HTML files. */<br />

/* Specify RS=NONE to write one line of HTML per record. */

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!