Chapter Contents

Previous

Next
SAS Companion for the OS/390 Environment

Directing Output to External Files with System Options

You can use SAS system options to change the destination of the SAS log and procedure output. The options that you use depend on which of the following tasks you want to accomplish:

Specify the system options in any of the following ways:

See Specifying or Changing System Option Settings for more information about specifying SAS system options.


Directing Output to an External File at SAS Invocation

Use the LOG= and PRINT= system options to change the destination of your SAS log or procedure output. The log and procedure output are then not directed to their default destinations.

When you invoke SAS, use the LOG= and PRINT= options to specify the DDnames or physical file names of the output data sets. See LOG= and PRINT= for option syntax and other host-specific details.

SAS automatically allocates a file when a system option is specified with an physical file name. The following example illustrates a SAS invocation in noninteractive mode using the SAS CLIST with internal allocation of output files.

sas options ('log=myid.output.logdata
   print=myid.output.ptrdata')
   input('''myid.sas.program''')

This example illustrates the same SAS invocation using external allocation.

alloc fi(logout) 
   da('myid.output.logdata') old
alloc fi(printout) 
   da('myid.output.prtdata') old
sas options('log=logout print=printout')
   input('''myid.sas.program''')

This example illustrates a SAS invocation in batch mode, using a JCL EXEC statement and internal allocation of output files.

//SASSTEP EXEC SAS,
//   OPTIONS='LOG=<file> PRINT=<file> ALTLOG=<file>'

This example illustrates the same SAS invocation with external allocation.

//SASSTEP  EXEC SAS,
//              OPTIONS='LOG=LOGOUT PRINT=PRINTOUT'
//LOGOUT   DD   DSN=MYID.OUTPUT.LOGDATA,DISP=OLD
//PRINTOUT DD   DSN=MYID.OUTPUT.PRTDATA,DISP=OLD
//SYSIN    DD   DSN=MYID.SAS.PROGRAM,DISP=SHR

The LOG= and PRINT= system options are normally used in batch, noninteractive, and interactive line modes. These options have no effect in the windowing environment, which will continue to display SAS log and procedure output data in the LOG and OUTPUT windows. To capture and print data in the LOG and OUTPUT windows, use the ALTLOG= and ALTPRINT= options, as described in the next section.

See ALTLOG= and ALTPRINT= for option syntax and other host-specific details.


Copying Output to an External File

Use the ALTLOG= and ALTPRINT= system options to send a copy of your SAS log or procedure output to an external file. After specifying ALTLOG= and ALTPRINT=, the log and procedure output will continue to be displayed in the LOG and OUTPUT windows as usual. The log and procedure output will also continue to be directed to their default SAS file destinations, or to the nondefault destinations specified by the LOG= and PRINT= system options, as described in the preceding section.

When you invoke SAS, use the ALTLOG= and ALTPRINT= options as shown to specify the DDnames or physical file names of the allocated data sets:

sas options('altprint=myid.output.prtdata
   altlog=myid.output.logdata')

See the previous section for complete examples of SAS invocations in various modes.


Directing Output to External Files Using the Configuration File

This example illustrates how to direct output to external files using the SAS configuration file.

log=myid.output.logdata
* logout DDname must be allocated
log=logout

print=myid.output.prtdata
* printout DDname must be allocated
print=printout

altlog=myid.output.altlog
* altlogx DDname must be allocated
altlog=altlogx


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.