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.

Directing <strong>SAS</strong> Log and <strong>SAS</strong> Procedure Output PUT Statement Syntax <strong>for</strong> E-Mail 137<br />

replaces the current address of the sender of the message with address. For<br />

example:<br />

PUT "!EM_FROM! "john@hisplace.org"<br />

or<br />

user="john@hisplace.org";<br />

put ’!EM_FROM!’ user;<br />

!EM_SUBJECT! subject<br />

replaces the current subject of the message with subject.<br />

!EM_CONTENTTYPE! content-type<br />

replaces the current content type of the message with content-type.<br />

!EM_ATTACH! “file-specification”<br />

replaces the current list of attachments with file-specification. Enclose the<br />

file-specification in double quotation marks.<br />

To attach more than one file or a file with additional attachment options,<br />

enclose the list of file specifications or options in parentheses and separate each<br />

file-specification with a space. The attachment options are<br />

CONTENT_TYPE=’content/type’<br />

specifies the MIME content type that should be associated with this<br />

attachment. The default content type is text/plain. CONTENT_TYPE= may<br />

be specified as:<br />

3 CONTENT_TYPE=<br />

3 CONTENT-TYPE=<br />

3 TYPE=<br />

3 CT=<br />

EXTENSION=’extension’<br />

specifies the filename extension on the recipient’s file that is attached. This<br />

extension will be used by the recipient’s e-mail system <strong>for</strong> selecting the<br />

appropriate utility to use <strong>for</strong> displaying the attachment. The default<br />

attachment extension is "txt". EXTENSION= may be specified as EXT=.<br />

NAME=’name’<br />

specifies a different name to be used <strong>for</strong> the attachment.<br />

The following examples show the syntax <strong>for</strong> specifying attachment options in a<br />

PUT statement:<br />

put ’!EM_ATTACH!’ "(’user.misc.pds(member)’ content_type=’text/html’<br />

extension=’html’)";<br />

put ’!EM_ATTACH!’ "(’user.misc.jcl(sasjcl)’ extension=’doc’,<br />

’userid.sas.output’ content_type=’image/gif’ extension=’gif’<br />

name=’Test Results’)";<br />

mycfg="’user.misc.jcl(sasjcl)’";<br />

syscfg="’user.sas.output’ content_type=’image/gif’ ext=’gif’";<br />

put ’!EM_ATTACH!’ "("mycfg","syscfg")";<br />

These directives per<strong>for</strong>m actions:<br />

!EM_SEND!<br />

sends the message with the current attributes. By default, <strong>SAS</strong> sends a message<br />

when the fileref is closed. The fileref closes when the next FILE statement is

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

Saved successfully!

Ooh no, something went wrong!