Reputation: 886
Today I faced a problem and solved it, but I am not quite sure why the problem occured. We have a SAS batch job:
/path_to_script/sasbatch.sh -log /some_path/Logs/replication_#Y.#m.#d_#H.#M.#s.log -batch -noterminal -logparm "rollover=session" -sysin /another_path/macros/replication.sas
And today the job fell over with error:
ERROR: Insufficient authorization to access /sas_path/sasconfig/Lev1/SASApp/replication.lst.
I found that the cause of error was NOPRINT
statement was not present at one of PROC SQL
statements. After embedding NOPRINT
inside PROC SQL
header it worked normally.
So what role does NOPRINT
really act in SAS job and why does it cause the error?
Upvotes: 2
Views: 3628
Reputation: 1062
NOPRINT
prevents anything to be written to the lst file. The lst file is the batch equivalent of the output window. Anything that would get written to the output window in an interactive session (because ODS LISTING is active) will be written to the lst file. I always run the batch jobs with NOPRINT
Upvotes: 2
Reputation: 5452
Error diagnosis
You haven't set the -print
option in your SAS batch job, so it chooses to write to the default directory. The user submitting the job doesn't have write access to this directory:
/sas_path/sasconfig/Lev1/SASApp
NOPRINT option & typical uses
The NOPRINT
option on the PROC SQL
statement suppresses any output from the SQL Procedure. You must have a statement in your SQL procedure that is producing output, typically this is something similar to:
select col1 into :c1
from table;
Which produces output unnecessarily, as it is creating a macro variable called c1 that can be used elsewhere in the program.
Resolutions
Either set NOPRINT
, or set the -print
option in your batch jobs to a writable directory, and review/delete the output files as necessary.
Upvotes: 3