If your lst or log files are likely to be large and you are at or close to your space quota, running SAS will put you over the limit, causing SAS to die with a can't-write-to-file error. To get around this you can use proc printto, which places the log and lst files where you say:
proc printto new log='/sastemp7/test.log' print='/sastemp7/test.lst'; run; <further commands>
The log and the lst output from 'further commands' will be placed in the files named.
You could do the same with command line options:
sas -log /sastemp7/logfile -print /sastemp7/lstfile program.sas
The difference is that with command-line options, all output is directed as you stated; with proc printto, only commands after the proc printto statement direct output as stated.