Your SAS program and
SAS Model Manager use global macro variables to pass information about
the SAS environment and the SAS Model Manager model repository to
the access macros. Some macros set these global macro variables. You
can set any of these global macro variables in your SAS program. At
the end of each macro execution, the global macro variable _MM_RC
is set to a number that indicates either that the macro executed successfully
or that there was an error.
Here is a description
of the SAS Model Manager global macro variables:
_MM_CId
contains the name of
the current SAS Model Manager object identifier. _MM_CId is either
the URL or the SAS Model Manager path to the object in the model repository.
You can use the %MM_GetURL to obtain a URL for any object in the SAS
Model Manager repository.
The %MM_Register macro
sets _MM_CId to contain the SAS Model Manager identifier for the registered
model. The %MM_AddModelFile macros sets _MM_CId to the SAS Model Manager
identifier for the model to which the file was added.
_MM_Password
contains a password
for the SAS Model Manager user. If you do not encode the password
using the PWENCODE procedure, the password is printed in the SAS log.
_MM_RC
contains one of the
following return codes after processing a SAS Model Manager macro:
|
|
|
|
|
|
|
Macro parameter processing
error
|
|
|
|
Repository operation
failed
|
|
Generic critical Java
error
|
|
|
_MM_ResourceURL
contains the URL of
the Resources folder. the _MM_Resource URL
is set by the %MM_GetURL macro when the macro returns a version URL
in the _MM_URL global macro variable.
_MM_Service_Registry_URL
contains the URL for
a SAS environment file that defines the SAS environment.
_MM_URL
contains a URL for
a SAS Model Manager object. The %MM_GetURL macro returns a URL in
the _MM_URL global macro variable.
_MM_User
contains the name of
a SAS Model Manager user on the server that is specified by the _MM_MulticastAddress
global macro variable.
Default: the value
of SAS automatic macro variable &SYSUSERID.
When you use the access
macros, the macros need to know the following information:
-
• how to access the SAS
environment XML file and environment name
-
a user and password for processing
requests to SAS Model Manager
-
the URL or path to the SAS Model
Manager repository
Make sure that your
SAS program defines values for these macro variables when you use
the access macros:
To
secure the Model Manager user password, encode the password using
the PWENCODE procedure and save it in a file on the network. You can
then use a fileref to access the password file and a DATA step to
assign the password to the _MM_Password global macro variable. For
more information,
see Encoding SAS Model Manager User Passwords.
Here is a code example
that uses the four macro variables to describe how to the access to
the server for the Web Infrastructure Platform.
Filename pwfile “my-network-drive\pwfile”;
%let _MM_Service_Registry_URL=
%STR(http://abcdef.sas.com:7980/SASWIPClientAccess/remote/ServiceRegistry);
%let _MM_User = miller;
data _null_;
infile pwfile obs=1 length=l;
input @;
input @1 line $varying1024. l;
call symput('_MM_Password',substr(line,1,l));
run;