You can also use the PIPE
device type to send output to a UNIX command. When you specify the
print command, you might also want to specify a destination for any
error messages that are produced by the print command. Enclose the
UNIX command in either single or double quotation marks. The following
example associates the fileref MyOutput with the print command
lp
, which will send output to the printer named myljet:
filename myoutput pipe 'lp -dmyljet';
proc printto print=myoutput;
run;
You can send the SAS log to the same printer by
using the LOG= option:
filename mylog pipe 'lp -dmyljet';
proc printto log=mylog;
run;
The log and procedure
output continue to be routed to the designated external file until
another PROC PRINTTO statement reroutes them.