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.
SAS automatically allocates
a file when a system option is specified with a physical filename.
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 still displays 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.