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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Directing <strong>SAS</strong> Log and <strong>SAS</strong> Procedure Output Viewing ODS Output on an External Browser 123<br />

The FILENAME statement includes the options SYSOUT=A and DEST=xyz16670.<br />

The values of these options are site specific. In this case, the output class, A, specifies<br />

that the output will be directed to a printer. The destination, xyz16670, links the fileref<br />

to a particular printer.<br />

The PROC PRINTTO statement then specifies the fileref OUTPUT in the PRINT=<br />

option. This option directs the procedure output file to the destination that was<br />

associated with the fileref OUTPUT in the FILENAME statement. When the PRINT<br />

procedure is executed, <strong>SAS</strong> sends the procedure output to the job entry subsystem<br />

(JES); the output is not displayed in the OUTPUT window. JES holds the output until<br />

the file identified by the fileref OUTPUT is closed and deassigned. Then the output is<br />

printed at the remote destination.<br />

To send the output to the printer <strong>for</strong> the previous example, submit:<br />

proc printto; run;<br />

filename output;<br />

To direct the <strong>SAS</strong> log to a remote destination, use the same procedure, but use the<br />

LOG= option instead of the PRINT= option with the PROC PRINTTO statement.<br />

Directing Procedure Output: ODS Examples<br />

<strong>SAS</strong> supports three output <strong>for</strong>mats <strong>for</strong> procedure output: the Output Delivery<br />

System (ODS), <strong>SAS</strong>/GRAPH, and the FORM subsystem.<br />

Most of ODS is portable and there<strong>for</strong>e documented elsewhere, including the The<br />

Complete Guide to the <strong>SAS</strong> Output Delivery System and the <strong>SAS</strong> Language Reference:<br />

Dictionary. Two <strong>for</strong>mat options provided by ODS are HTML and XML. This section<br />

shows examples of how the ODS HTML and ODS XML statements are used and the<br />

steps that are required to route the output between operating environments. A <strong>SAS</strong>/<br />

GRAPH example is also provided.<br />

In a mainframe environment, by default, ODS produces a binary file that contains<br />

embedded record-separator characters. While this approach means that the file is not<br />

restricted by the line-length restrictions on ASCII files, it also means that if you view<br />

the file in an editor, the lines all run together.<br />

If you want to <strong>for</strong>mat the HTML files so that you can read them with an editor, use<br />

RECORD_SEPARATOR=NONE. In this case, ODS writes one line of HTML at a time to<br />

the file. When you use a value of NONE, the logical record length of the file that you<br />

are writing to must be at least as long as the longest line that ODS produces. If it isn’t,<br />

the HTML may wrap to another line at an inappropriate place. We recommend that<br />

you use rs=none if you are writing to a standard z/<strong>OS</strong> file, but not if you are writing to<br />

an HFS file. See “Writing ODS XML Output to EBCDIC, ASCII Transfer to UNIX” on<br />

page 128 <strong>for</strong> an example that uses rs=none to <strong>for</strong>mat output.<br />

Note: The NLSCOMPATMODE system option might affect the <strong>for</strong>mat of outputs<br />

produced with ODS. If you are using ODS, set the NLSCOMPATMODE value to<br />

NONLSCOMPATMODE. R<br />

Viewing ODS Output on an External Browser<br />

The following example stores ODS HTML output in a UNIX System Services (USS)<br />

file. You can then display the output in an external HTML browser with the universal<br />

resource locator (URL) appropriate to your site.<br />

/* if needed, create web directory */<br />

%sysexec mkdir ’/u/myuid/public_html’ ;

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

Saved successfully!

Ooh no, something went wrong!