The SAS Information
Delivery Portal provides a macro that creates a properly formatted
XML file from your SAS data set, and adds the XML file to the WebDAV
repository. The XML file uses the standard SAS Report Model format
that is used by other SAS applications, such as SAS Web Report Studio.
The macro provides additional formats and labels that the WebDAV graph
portlet requires in order to generate a graph.
To create and add the
XML file, follow these steps:
-
Create a SAS program
that invokes the
publishToWebDAV
macro.
The macro file is located in the
SAS-configuration-directory
\Lev1\Web\Applications\SASPortal4.3\sasJobs
directory.
-
In your SAS program,
when you invoke
publishToWebDAV
, you must
pass a set of arguments that specify the name of the SAS data set,
the WebDAV location, and the credentials that are required to write
to that location. The
publishToWebDAV
syntax
is described after these steps.
-
Save and run the SAS
program.
If there are any DBCS
characters in the parameters (for example, davloc) the
publishToWebDAV
macro
must run in a language-specific SAS environment. Another option is
to save the SAS program in UTF-8 format, and use the Batch Submit
with SAS 9.3 (UTF8) program to run the job.
The
publishToWebDAV
macro
creates an XML file named
data.xml
in
the WebDAV location that you specified.
Note: If you later update the SAS
data set, you must run the macro again to re-create the
data.xml
file
in order to see those updates in WebDAV graph portlets.
Here is the syntax for
the
publishToWebDAV
macro:
%publishToWebDAV (sasdsn, davloc, userid, passwd)
All parameters are required
in order to create and publish the XML file. Here are descriptions
of the parameters:
sasdsn
Specify the full name
of the SAS data set, in the format libref.SAS-data-set,
and enclosed in single quotation marks. For example: 'sashelp.class'
davloc
Specify the URL for
the WebDAV location, enclosed in single quotation marks. For example: 'http://<WebDAVHost>:8080/SASContentServer/repository/default
/sasdav/Users/sasdemo/graph1'
In this example, the
macro creates a
graph1
directory under
sasdav/Users/sasdemo
on
the WebDAV server, and creates an XML file named
data.xml
in
that directory.
Be sure to specify
a unique location for each data set to be published. If the location
that you specify already exists on the WebDAV server, you will overwrite
the existing XML file.
The macro does not
create nested directories within the parent directory. If you want
nested directories, create the directory structure before running
the macro.
For example:
'http://<WebDAVHost>:8080/SASContentServer/repository/default
/sasdav/graph1/ClassData'
The top level WebDAV
directory (sasdav) should already exist. The intermediate directory
(graph1) must be manually created before running this macro. The parent
directory (ClassData) is automatically created by this macro if the
directory does not exist. If it already exists, the parent directory
(and its contents) are removed and the directory is re-created.
user ID
Specify the user ID
that is used to connect to the WebDAV server, enclosed in single quotation
marks. If the WebDAV server runs on a Windows system, the user ID
for an external user (for example, a user defined on the host system)
should be qualified with either the domain name or the machine name.
For example: <machine or Windows
domain>\'sasdemo'
The user ID that you
specify must be authorized to write to the WebDAV location that is
specified for the davloc parameter.
passwd
Specify the password
that is used to authenticate the user that you specified in the previous
argument, enclosed in single quotation marks. It is recommended that
you encrypt the password, but you are not required to do so.
Use SAS proprietary
32-bit encryption to encrypt passwords. For example, to encrypt a
password of SASDemo1, submit this code in the SAS Program Editor:
proc pwencode in='SASDemo1' method=sasenc; run;
The encrypted password
is written to your SAS log. When you use
method=sasenc,
the first part of the password is
{sasenc}.
Here is a sample SAS
program that includes and invokes the
publishToWebDAV
macro:
%include 'publishToWebDAV.sas';
%publishToWebDAV('sashelp.class',
'http://localhost:8080/SASContentServer/repository/default/sasdav/graph1/ClassData',
'sasadm@saspw', '{sasenc}E19F24391F7B576C45200E543F0B37B4');