If a SAS® stored process request requires more than 5 minutes to complete execution, then it might not be able to publish a permanent package to the SAS® Content Server's WebDAV repository.
A SAS stored process request, by default, uses a One-Time-Password (OTP) to connect to a WebDAV server. The OTP is created before the stored process begins execution, and it expires in 5 minutes. So, if a stored process requires more than 5 minutes to complete execution and it tries to publish a permanent package to WebDAV (and uses the OTP), then the following error messages appears in a SAS® 9.3 stored process log file:
ERROR: WEBDAV transport engine encountered errors while publishing the package.
ERROR: The result package could not be created. The error encountered was:
ERROR: The MKCOL request failed with an HTTP status of 401 (Unauthorized).
And a warning message similar to the following appears in the SAS® Metadata Server log file:
Access Denied due to expired SAS token from sasdemo.
New client connection (829) rejected from server port 8561 for user sasdemo@!* generatedpassworddomain)*!.
In SAS® 9.4, the stored process log contains the following error messages:
ERROR: WEBDAV transport engine encountered errors while publishing the package.
ERROR: The result package could not be created. The error encountered was:
ERROR: Unauthorized: Check username/password.
As a workaround, you could specify a user account and password in the stored process code to connect to the WebDAV server. Then, this user account is used and the expired OTP is not used. Here is an example:
options nosource; /* Turn off source logging */
%let _HTTP_USER=sasdemo;
%let _HTTP_PASSWORD=your_password_here;
options source; /* Turn on logging again. */
%stpend; /* For debugging use: %stpend(debug=1); */
Note: You can use the PWENCODE procedure to encode the password that you specify for the _HTTP_PASSWORD macro variable value.